/**
 * Sportiva — Onboarding Wizard Widget CSS
 * Classes: .spv-ww__*
 * 3 layout: card, split, dashboard
 *
 * @package SportivaUser
 * @version 1.2.0
 */

/* ============================================================
   BASE
   ============================================================ */

.spv-ww {
	font-family: inherit;
	box-sizing: border-box;
}

.spv-ww *,
.spv-ww *::before,
.spv-ww *::after {
	box-sizing: inherit;
}

.spv-ww__error {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	margin-bottom: 1rem;
	padding: .75rem 1rem;
}

/* -------- Checkbox grid (discipline / ruoli) -------- */
.spv-ww__checkbox-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 6px 12px;
	max-height: 280px;
	overflow-y: auto;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 10px 12px;
	background: #fafafa;
	margin-top: 4px;
}

.spv-ww__check-label--grid {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .875rem;
	cursor: pointer;
	padding: 3px 0;
}

.spv-ww__check-label--grid input[type="checkbox"] {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	accent-color: var(--spv-accent, #27ae60);
}

.spv-ww__field--full {
	grid-column: 1 / -1;
}

.spv-ww__field-label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	font-size: .9rem;
}

/* -------- Info box e status badge -------- */
.spv-ww__info-box {
	background: #e8f4fd;
	border: 1px solid #bee3f8;
	border-radius: 6px;
	color: #2c5f7a;
	font-size: .875rem;
	line-height: 1.5;
	margin-bottom: 1.25rem;
	padding: .875rem 1rem;
}

.spv-ww__status-badge {
	border-radius: 4px;
	font-size: .85rem;
	font-weight: 600;
	margin-bottom: 1rem;
	padding: .5rem .875rem;
}

.spv-ww__status-badge--approved {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.spv-ww__status-badge--pending {
	background: #fff3cd;
	border: 1px solid #ffeeba;
	color: #856404;
}

.spv-ww__status-badge--rejected {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.spv-ww__step {
	display: none;
}

.spv-ww__step.is-active {
	display: block;
}

.spv-ww__step-title {
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 1.5rem;
	font-weight: 700;
	color: #1a1a2e;
}

.spv-ww__step-desc {
	color: #666;
	margin-bottom: 28px;
	font-size: 1rem;
}

.spv-ww__not-logged,
.spv-ww__done {
	padding: 16px;
	background: #f9f9f9;
	border-left: 4px solid #0073aa;
	color: #444;
	border-radius: 4px;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.spv-ww__progress {
	margin-bottom: 32px;
}

.spv-ww__step-indicators {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-bottom: 12px;
}

.spv-ww__step-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #aaa;
	font-size: 0.85rem;
}

.spv-ww__step-indicator.is-active {
	color: #0073aa;
	font-weight: 600;
}

.spv-ww__step-indicator.is-done {
	color: #00a32a;
}

.spv-ww__step-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background-color: #f0f0f0;
	border: 2px solid #ddd;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8rem;
	flex-shrink: 0;
	transition: background-color 0.2s, border-color 0.2s;
}

.spv-ww__step-num.is-active {
	background-color: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

.spv-ww__step-num.is-done {
	background-color: #00a32a;
	border-color: #00a32a;
	color: #fff;
}

.spv-ww__step-label {
	white-space: nowrap;
}

.spv-ww__progress-track {
	width: 100%;
	height: 6px;
	background-color: #f0f0f0;
	border-radius: 3px;
	margin-bottom: 8px;
	overflow: hidden;
}

.spv-ww__progress-fill {
	height: 6px;
	background-color: #0073aa;
	border-radius: 3px;
	transition: width 0.35s ease;
}

.spv-ww__progress-text {
	text-align: center;
	color: #888;
	font-size: 0.82rem;
	margin: 0;
}

/* ============================================================
   FORM
   ============================================================ */

.spv-ww__form-fields {
	margin-bottom: 24px;
}

.spv-ww__field {
	margin-bottom: 20px;
}

.spv-ww__field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.9rem;
	color: #333;
}

.spv-ww__field input:not([type="checkbox"]):not([type="radio"]),
.spv-ww__field select,
.spv-ww__field textarea {
	width: 100%;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.95rem;
	font-family: inherit;
	background-color: #fff;
	color: #333;
	transition: border-color 0.15s;
	-webkit-appearance: none;
	appearance: none;
}

.spv-ww__field select {
	padding-right: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.spv-ww__field textarea {
	height: auto;
	min-height: 100px;
	padding: 10px 12px;
	resize: vertical;
}

.spv-ww__field input:focus,
.spv-ww__field select:focus,
.spv-ww__field textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0,115,170,0.12);
}

.spv-ww__field input:disabled,
.spv-ww__field select:disabled,
.spv-ww__field textarea:disabled {
	background-color: #f5f5f5;
	cursor: not-allowed;
	opacity: 0.7;
}

.spv-ww__field--check {
	margin-bottom: 12px;
}

.spv-ww__check-label {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400 !important;
	cursor: pointer;
}

.spv-ww__check-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 1px;
	accent-color: #0073aa;
	cursor: pointer;
}

.spv-ww__required {
	color: #d63638;
	margin-left: 2px;
}

/* ============================================================
   AZIONI
   ============================================================ */

.spv-ww__actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	margin-top: 8px;
}

.spv-ww__actions--center {
	justify-content: center;
}

.spv-ww__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 24px;
	border: none;
	border-radius: 4px;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s, box-shadow 0.15s;
	white-space: nowrap;
}

.spv-ww__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.spv-ww__btn-primary {
	background-color: #0073aa;
	color: #fff;
	border: 2px solid #0073aa;
}

.spv-ww__btn-primary:hover:not(:disabled) {
	background-color: #005d8e;
	border-color: #005d8e;
	color: #fff;
	text-decoration: none;
}

.spv-ww__btn-secondary {
	background-color: transparent;
	color: #555;
	border: 2px solid #ddd;
}

.spv-ww__btn-secondary:hover:not(:disabled) {
	border-color: #aaa;
	color: #333;
}

/* ============================================================
   SKIP
   ============================================================ */

.spv-ww__skip-wrap {
	text-align: center;
	margin-top: 16px;
	margin-bottom: 0;
}

.spv-ww__skip {
	color: #888;
	font-size: 0.85rem;
	text-decoration: underline;
}

.spv-ww__skip:hover {
	color: #555;
}

/* ============================================================
   WELCOME IMAGE
   ============================================================ */

.spv-ww__welcome-image {
	text-align: center;
	margin-bottom: 20px;
}

.spv-ww__welcome-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* ============================================================
   COMPLETE STEP
   ============================================================ */

.spv-ww__complete-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background-color: #00a32a;
	color: #fff;
	font-size: 1.8rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.spv-ww__complete-preview {
	text-align: center;
}

.spv-ww__summary {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.spv-ww__summary-row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: 1px solid #eee;
	font-size: 0.9rem;
}

.spv-ww__summary-row:last-child {
	border-bottom: none;
}

.spv-ww__summary-row span {
	font-weight: 600;
	color: #555;
}

.spv-ww__summary-row em {
	font-style: normal;
	color: #333;
}

/* ============================================================
   LAYOUT: CARD (default)
   ============================================================ */

.spv-ww--card {
	display: block;
}

.spv-ww--card .spv-ww__card {
	max-width: 640px;
	margin: 40px auto;
	background: #fff;
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

/* ============================================================
   LAYOUT: SPLIT (2 colonne)
   ============================================================ */

.spv-ww--split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 480px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.spv-ww__brand {
	background-color: #0073aa;
	color: #fff;
	padding: 48px 40px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.spv-ww__brand-title {
	font-size: 1.6rem;
	font-weight: 700;
	color: #fff;
	margin-top: 0;
	margin-bottom: 16px;
}

.spv-ww__brand-text {
	color: rgba(255,255,255,0.85);
	font-size: 1rem;
	line-height: 1.6;
	margin: 0;
}

.spv-ww__form-area {
	background: #fff;
	padding: 48px 40px;
	overflow-y: auto;
}

/* ============================================================
   LAYOUT: DASHBOARD (larghezza piena)
   ============================================================ */

.spv-ww--dashboard {
	display: block;
}

.spv-ww--dashboard .spv-ww__dashboard-inner {
	background: #fff;
	padding: 32px;
	border-radius: 0;
	border: 1px solid #e5e5e5;
}

.spv-ww--dashboard .spv-ww__step-indicators {
	flex-wrap: nowrap;
	overflow-x: auto;
	padding-bottom: 8px;
}

.spv-ww--dashboard .spv-ww__step-indicator {
	flex-direction: column;
	text-align: center;
	gap: 4px;
	flex: 1;
	min-width: 80px;
}

.spv-ww--dashboard .spv-ww__step-num {
	width: 36px;
	height: 36px;
	font-size: 0.9rem;
}

.spv-ww--dashboard .spv-ww__step-label {
	font-size: 0.75rem;
	white-space: normal;
}

.spv-ww--dashboard .spv-ww__form-fields {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0 32px;
}

.spv-ww--dashboard .spv-ww__field--check {
	grid-column: 1 / -1;
}

/* ============================================================
   EDITOR PREVIEW
   ============================================================ */

.spv-ww--editor-preview .spv-ww__btn {
	pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
	.spv-ww--split {
		grid-template-columns: 1fr;
	}

	.spv-ww__brand {
		padding: 32px 24px;
		min-height: 140px;
		justify-content: flex-start;
	}

	.spv-ww__form-area {
		padding: 32px 24px;
	}

	.spv-ww--card .spv-ww__card {
		margin: 20px 0;
		padding: 24px;
		border-radius: 8px;
	}

	.spv-ww--dashboard .spv-ww__form-fields {
		grid-template-columns: 1fr;
	}

	.spv-ww--dashboard .spv-ww__field--check {
		grid-column: 1;
	}

	.spv-ww__step-indicators {
		flex-wrap: wrap;
	}

	.spv-ww__actions {
		flex-direction: column-reverse;
		gap: 8px;
	}

	.spv-ww__btn {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 480px) {
	.spv-ww__brand-title {
		font-size: 1.3rem;
	}

	.spv-ww__step-title {
		font-size: 1.3rem;
	}

	.spv-ww--dashboard .spv-ww__step-indicator {
		min-width: 64px;
	}
}
