/* ==========================================================================
   Village des Sourires – Pop-in « Pourquoi parrainer ? »
   Tout est préfixé .vsp- pour éviter les conflits avec le thème.
   ========================================================================== */

.vsp-root {
	/* Palette (contrastes vérifiés WCAG AA sur fond crème) */
	--vsp-navy: #243a5e;        /* texte, boutons : ~11:1 */
	--vsp-navy-dark: #1a2b47;
	--vsp-coral: #c2412d;       /* accent texte : ~4,8:1 (l'ancien corail clair échouait) */
	--vsp-coral-soft: #fde8e3;
	--vsp-yellow: #ffd633;
	--vsp-yellow-soft: #fff6cc;
	--vsp-cream: #f4f0e8;
	--vsp-paper: #fbf8f2;
	--vsp-ink: #3b2f2a;         /* texte courant : ~11:1 */
	--vsp-muted: #5f544d;       /* texte secondaire : ~6,9:1 */
	--vsp-line: #d9cfbd;        /* bordures de cartes (contraste non-textuel renforcé par l'épaisseur 2px) */

	font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--vsp-ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.vsp-root *, .vsp-root *::before, .vsp-root *::after { box-sizing: border-box; }

/* Bloque le scroll de la page derrière la pop-in */
html.vsp-lock { overflow: hidden; }

/* ---------- Fond assombri + animation d'apparition ---------- */
.vsp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 28, 46, 0.62);
	opacity: 0;
	transition: opacity 300ms ease;
}
.vsp-overlay.is-open { opacity: 1; }

.vsp-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(980px, 100%);
	max-height: min(780px, 100%);
	overflow: hidden;
	border-radius: 24px;
	background-color: var(--vsp-cream);
	/* Motif discret de maisons / enfants (SVG inline, aucune requête réseau) */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 74l30-26 30 26v34H18z'/%3E%3Cpath d='M38 108V88h20v20'/%3E%3Ccircle cx='126' cy='38' r='9'/%3E%3Cpath d='M126 47v28m-15-18l15 7 15-7m-15 21l-11 20m11-20l11 20'/%3E%3C/svg%3E");
	box-shadow: 0 24px 70px rgba(10, 16, 32, 0.45);
	transform: translateY(18px) scale(0.98);
	opacity: 0;
	transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease;
}
.vsp-overlay.is-open .vsp-dialog { transform: none; opacity: 1; }

/* ---------- En-tête ---------- */
.vsp-header { padding: 24px 72px 16px 32px; }

.vsp-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--vsp-coral);
}
.vsp-eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: var(--vsp-yellow); }

.vsp-title {
	margin: 0;
	font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
	font-size: clamp(2rem, 4.2vw, 2.75rem);
	font-weight: 700;
	line-height: 1.1;
	color: #2d2a28;
}
.vsp-title mark {
	background: linear-gradient(transparent 55%, var(--vsp-yellow) 55%);
	color: inherit;
	padding: 0 4px;
}

.vsp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 0.9rem; color: var(--vsp-muted); }
.vsp-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 12px;
	border: 1px solid var(--vsp-line);
	border-radius: 999px;
	background: #fff;
	font-size: 0.8rem; font-weight: 700; color: var(--vsp-navy);
}
.vsp-chip svg { width: 15px; height: 15px; color: var(--vsp-coral); }

/* ---------- Bouton de fermeture (zone de clic 44 px) ---------- */
.vsp-close {
	position: absolute; top: 14px; right: 14px;
	display: grid; place-items: center;
	width: 44px; height: 44px;
	border: 0; border-radius: 50%;
	background: #fff; color: var(--vsp-navy);
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	transition: background 150ms, transform 150ms;
}
.vsp-close:hover { background: var(--vsp-yellow-soft); transform: rotate(90deg); }
.vsp-close svg { width: 20px; height: 20px; }

/* ---------- Carte principale : menu latéral + contenu ---------- */
.vsp-card-shell {
	display: grid;
	grid-template-columns: 236px minmax(0, 1fr);
	flex: 1;
	min-height: 0;
	margin: 0 24px 24px;
	overflow: hidden;
	border-radius: 20px;
	background: var(--vsp-paper);
	box-shadow: 0 6px 24px rgba(36, 58, 94, 0.12);
}

/* Navigation latérale */
.vsp-aside { padding: 20px; border-right: 1px solid var(--vsp-line); background: #fcfaf5; overflow-y: auto; }
.vsp-progress-label { margin: 0; font-size: 0.8rem; color: var(--vsp-muted); }
.vsp-progress-name { margin: 0 0 8px; font-weight: 700; color: var(--vsp-navy); }
.vsp-progress {
	height: 8px; margin-bottom: 20px;
	border-radius: 999px;
	background: #e6dfd2;
	overflow: hidden;
}
.vsp-progress > span {
	display: block; height: 100%;
	border-radius: inherit;
	background: var(--vsp-coral);
	transition: width 400ms ease;
}

.vsp-steps { position: relative; margin: 0; padding: 0; list-style: none; }
.vsp-steps__item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 0.88rem; font-weight: 600; color: var(--vsp-muted); }
.vsp-steps__item:not(:last-child)::before { /* trait de liaison */
	content: ""; position: absolute; left: 15px; top: 36px; width: 2px; height: calc(100% - 28px);
	background: var(--vsp-line);
}
.vsp-steps__dot {
	position: relative; z-index: 1;
	display: grid; place-items: center; flex: none;
	width: 32px; height: 32px;
	border: 2px solid var(--vsp-line); border-radius: 50%;
	background: #fff; font-size: 0.8rem; font-weight: 700; color: var(--vsp-muted);
}
.vsp-steps__dot svg { width: 16px; height: 16px; }
.vsp-steps__item[data-state="done"] { color: var(--vsp-navy); }
.vsp-steps__item[data-state="done"] .vsp-steps__dot { border-color: var(--vsp-coral); background: var(--vsp-coral-soft); color: var(--vsp-coral); }
.vsp-steps__item[data-state="current"] { color: var(--vsp-navy); font-weight: 800; }
.vsp-steps__item[data-state="current"] .vsp-steps__dot {
	border-color: var(--vsp-navy); background: var(--vsp-navy); color: #fff;
	box-shadow: 0 0 0 4px var(--vsp-yellow);
}

/* Contenu */
.vsp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.vsp-panel { flex: 1; min-height: 0; padding: 28px 32px 16px; overflow-y: auto; }
.vsp-panel:focus { outline: none; }

.vsp-step-title { margin: 0 0 8px; font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 800; line-height: 1.25; color: var(--vsp-navy); }
.vsp-step-title:focus { outline: none; }
.vsp-lead { margin: 0 0 22px; max-width: 56ch; font-size: 1rem; color: var(--vsp-muted); }

/* ---------- Cartes de choix (radios natifs stylés) ---------- */
.vsp-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; }
.vsp-choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vsp-choices legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.vsp-card { position: relative; display: block; cursor: pointer; }
.vsp-card input {          /* le vrai radio couvre toute la carte : zone de clic maximale, clavier natif */
	position: absolute; inset: 0; width: 100%; height: 100%;
	margin: 0; opacity: 0; cursor: pointer;
}
.vsp-card__body {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	min-height: 136px; padding: 16px 10px;
	border: 2px solid var(--vsp-line); border-radius: 16px;
	background: #fff; text-align: center;
	font-size: 0.95rem; font-weight: 700; color: var(--vsp-navy);
	transition: border-color 150ms, background 150ms, transform 150ms, box-shadow 150ms;
}
.vsp-card__body small { display: block; margin-top: 2px; font-size: 0.78rem; font-weight: 500; color: var(--vsp-muted); }
.vsp-card__icon {
	display: grid; place-items: center;
	width: 52px; height: 52px; border-radius: 50%;
	background: var(--vsp-coral-soft); color: var(--vsp-coral);
}
.vsp-card__icon svg { width: 26px; height: 26px; }
.vsp-card:hover .vsp-card__body { border-color: var(--vsp-coral); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(36, 58, 94, 0.1); }

/* État sélectionné : bordure navy + fond jaune pâle + pastille ✓ (le feedback ne repose pas que sur la couleur) */
.vsp-card input:checked ~ .vsp-card__body { border-color: var(--vsp-navy); background: var(--vsp-yellow-soft); box-shadow: 0 0 0 1px var(--vsp-navy); }
.vsp-card input:checked ~ .vsp-card__body .vsp-card__icon { background: var(--vsp-navy); color: #fff; }
.vsp-card__check {
	position: absolute; top: 8px; right: 8px;
	display: grid; place-items: center;
	width: 24px; height: 24px; border-radius: 50%;
	background: var(--vsp-navy); color: #fff;
	opacity: 0; transform: scale(0.6);
	transition: opacity 150ms, transform 150ms;
	pointer-events: none;
}
.vsp-card__check svg { width: 14px; height: 14px; }
.vsp-card input:checked ~ .vsp-card__check { opacity: 1; transform: none; }

/* Focus clavier très visible */
.vsp-card input:focus-visible ~ .vsp-card__body { outline: 3px solid var(--vsp-navy); outline-offset: 3px; }

/* ---------- Contenus des autres étapes ---------- */
.vsp-points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.vsp-points li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--vsp-line); border-radius: 14px; background: #fff; }
.vsp-points .vsp-card__icon { width: 40px; height: 40px; flex: none; }
.vsp-points .vsp-card__icon svg { width: 20px; height: 20px; }
.vsp-points strong { display: block; color: var(--vsp-navy); }
.vsp-points span { font-size: 0.92rem; color: var(--vsp-muted); }

.vsp-quote { margin: 0 0 14px; padding: 18px 20px; border-left: 5px solid var(--vsp-yellow); border-radius: 0 14px 14px 0; background: #fff; }
.vsp-quote p { margin: 0 0 8px; font-size: 1.02rem; font-style: italic; }
.vsp-quote footer { font-size: 0.85rem; font-weight: 700; color: var(--vsp-coral); }

.vsp-recap { margin: 0 0 8px; padding: 16px 20px; border-radius: 14px; background: var(--vsp-yellow-soft); font-weight: 600; color: var(--vsp-navy); }

/* ---------- Pied : aide + boutons ---------- */
.vsp-footer {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 32px 20px;
	border-top: 1px solid var(--vsp-line);
}
.vsp-hint { margin: 0; font-size: 0.85rem; color: var(--vsp-muted); }
.vsp-hint.is-error { font-weight: 700; color: var(--vsp-coral); }
.vsp-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.vsp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px;
	border: 2px solid transparent; border-radius: 12px;
	font: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1.2; text-decoration: none;
	cursor: pointer;
	transition: background 150ms, transform 150ms, opacity 150ms;
}
.vsp-btn svg { width: 16px; height: 16px; flex: none; }
.vsp-btn--primary { background: var(--vsp-navy); color: #fff; }
.vsp-btn--primary:hover { background: var(--vsp-navy-dark); transform: translateX(2px); color: #fff; }
.vsp-btn--primary[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.vsp-btn--ghost { background: transparent; border-color: var(--vsp-line); color: var(--vsp-navy); }
.vsp-btn--ghost:hover { background: #fff; border-color: var(--vsp-navy); }
.vsp-btn--link { min-height: 44px; padding: 0 10px; background: none; color: var(--vsp-muted); text-decoration: underline; }
.vsp-btn:focus-visible, .vsp-close:focus-visible { outline: 3px solid var(--vsp-navy); outline-offset: 3px; }

.vsp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   Mobile : la pop-in occupe tout l'écran, menu latéral remplacé par la barre de progression
   ========================================================================== */
@media (max-width: 760px) {
	.vsp-overlay { padding: 0; align-items: stretch; }
	.vsp-dialog { width: 100%; max-height: none; height: 100%; height: 100dvh; border-radius: 0; transform: translateY(40px); }
	.vsp-header { padding: 16px 64px 8px 16px; }
	.vsp-meta { display: none; }
	.vsp-close { top: 10px; right: 10px; }

	.vsp-card-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); margin: 0; border-radius: 20px 20px 0 0; }
	.vsp-aside { padding: 12px 16px 4px; border-right: 0; border-bottom: 1px solid var(--vsp-line); }
	.vsp-progress { margin-bottom: 10px; }
	.vsp-steps { display: none; }
	.vsp-progress-name { margin-bottom: 6px; }

	.vsp-panel { padding: 20px 16px 12px; }
	.vsp-choices, .vsp-choices--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.vsp-choices--3 .vsp-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.vsp-card__body { min-height: 120px; }

	/* Pied collant, boutons pleine largeur */
	.vsp-footer { flex-direction: column; align-items: stretch; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--vsp-paper); }
	.vsp-hint { text-align: center; }
	.vsp-actions { margin: 0; flex-direction: row-reverse; }
	.vsp-actions .vsp-btn--primary { flex: 1; }
}

/* Respect de « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
	.vsp-overlay, .vsp-dialog, .vsp-progress > span, .vsp-card__body, .vsp-card__check, .vsp-btn, .vsp-close { transition: none !important; }
	.vsp-dialog { transform: none; }
}
