/**
 * form-lead.css — Modale/formulaire LP Déclic (charte NOVA).
 * Fullscreen sur mobile (< 768px), modale centrée sur desktop.
 * Tokens : #fa2d0a (brand), #3c3c3c (text), #636363 (text soft), #7c7c7c (stroke),
 * #a5a5a5 (disabled), #ececec (surface disabled), Radius/M=20, Radius/XXL=999, Outfit.
 */

/* ---------- Utilitaires ---------- */
.hidden { display: none !important; }
#formulaire .req { color: #ec0900; margin: 0 4px 0 0; font-weight: 400; }

/* ---------- Modale racine ---------- */
.modal-formulaire {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	font-family: "Outfit", Arial, sans-serif;
	color: #3c3c3c;
	-webkit-font-smoothing: antialiased;
}
.modal-formulaire.is-open { display: block; }

.modal-formulaire__overlay {
	position: fixed;
	inset: 0;
	background: rgba(60, 60, 60, 0.7);
	z-index: 0;
}

.modal-formulaire__wrapper {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	overflow-y: auto;
	padding: 0;
	/* Fond DS NOVA (réf. node 14083-5005) : peach fondu très doux limité au titre modale. */
	background: radial-gradient(83% 20.41% at 50% 0%, rgba(255, 216, 176, 0.30) 1.56%, rgba(255, 216, 176, 0.00) 100%), #FFF
}

/* Topbar mobile — sticky en haut, fond peach dim (matche le haut du dégradé NOVA)
   pour rester lisible quand on scrolle. */
.modal-formulaire__topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px 12px;
	position: sticky;
	top: 0;
	background: #ffd8b0;
	box-shadow: none;
	border: 0;
	z-index: 2;
}
.modal-formulaire__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	border-radius: 999px;
	color: #fa2d0a;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: background 0.15s;
}
.modal-formulaire__back:hover { background: rgba(250, 45, 10, 0.08); }
.modal-formulaire__topbar-title {
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	font-size: 20px;
	line-height: 1.2;
	color: #3c3c3c;
	margin: 0;
	padding: 0;
	width: auto;
	max-width: none;
	text-transform: none; /* neutralise le uppercase global du h2 Welko */
	letter-spacing: normal;
	text-shadow: none;
	box-shadow: none;
	background: transparent;
}
/* Neutralise la décoration « rayons » du h2 global sur ce titre */
.modal-formulaire__topbar-title::after,
.modal-formulaire__topbar-title::before { display: none !important; content: none !important; }

/* Close X desktop — caché sur mobile */
.modal-formulaire__close {
	display: none;
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px;
	height: 32px;
	background: #ececec;
	border: 0;
	border-radius: 999px;
	color: #3c3c3c;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
	z-index: 3;
	transition: background 0.15s;
}
.modal-formulaire__close:hover { background: #d5d5d5; color: #3c3c3c; }

/* ---------- Form container ---------- */
.form {
	padding: 8px 20px 120px; /* bottom padding : place pour le CTA fixe mobile */
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 640px;
	margin: 0 auto;
}

/* ---------- Champs texte notched ---------- */
.form__field {
	position: relative;
	margin: 0;
}
/* Ring bleu externe en pseudo-element — ne peut pas être clippé par un parent overflow. */
.form__field::after {
	content: "";
	position: absolute;
	inset: -6px;
	border: 2px solid #0015ff;
	border-radius: 26px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
}
.form__field:has(input:focus)::after {
	opacity: 1;
}
#formulaire .form .form__field input {
	width: 100%;
	padding: 12px 12px;
	border: 1px solid #7c7c7c;
	border-radius: 20px;
	font: inherit;
	font-family: "Outfit", sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: #3c3c3c;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
}
#formulaire .form .form__field input:hover { border-color: #3c3c3c; }
#formulaire .form .form__field input:focus {
	outline: 0;
	border-color: #636363;
}
#formulaire .form .form__field label {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	padding: 0 6px;
	margin: 0;
	font-family: "Outfit", sans-serif;
	font-size: 16px;
	font-weight: 400;
	color: #636363;
	background: #fff;
	pointer-events: none;
	transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
	line-height: 1;
	float: none;
	width: auto;
	display: block;
}
/* Label flotté au focus OU quand l'input a du contenu (comportement Material outlined) */
#formulaire .form .form__field input:focus + label,
#formulaire .form .form__field input:not(:placeholder-shown) + label {
	top: 0;
	font-size: 12px;
	color: #3c3c3c;
	transform: translateY(-50%);
}
/* Placeholder invisible — sert juste de trigger pour :not(:placeholder-shown) */
#formulaire .form .form__field input::placeholder { color: transparent; opacity: 0; }

/* Date : icône calendrier orange à droite (déjà native mais restylée) */
#formulaire .form .form__field input[type="date"]::-webkit-calendar-picker-indicator {
	filter: invert(29%) sepia(96%) saturate(4952%) hue-rotate(360deg) brightness(99%) contrast(105%);
	cursor: pointer;
	opacity: 1;
	margin-right: 4px;
}
/* Date : le label reste flotté dès l'affichage (pas de :placeholder-shown fiable sur date) */
#formulaire .form .form__field--date input:invalid + label,
#formulaire .form .form__field--date input:valid + label {
	top: 0;
	font-size: 12px;
	color: #3c3c3c;
	transform: translateY(-50%);
}
/* Focus : label bleu — via :has() sur le parent, spécificité qui bat la règle date. */
#formulaire .form .form__field:has(input:focus) label {
	color: #0015ff;
}

/* Erreurs — uniquement après interaction (submit ou blur avec valeur invalide) */
#formulaire .form .form__field input:user-invalid {
	border-color: #c62828;
}
#formulaire .form .form__field input:user-invalid + label { color: #c62828; }
#formulaire .form .form__field input:user-invalid:focus {
	box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

/* Hint sous téléphone */
.form__hint {
	font-size: 12px;
	color: #636363;
	margin: -8px 0 0;
	padding: 0 8px;
	line-height: 1.4;
}

/* ---------- Radios (Civilité) — layout inline label + options ---------- */
.form__group--radio {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	border: 0;
	padding: 4px 0;
	margin: 0;
}
.form__radio-legend {
	font-family: "Outfit", sans-serif;
	font-weight: 400;
	font-size: 16px;
	color: #3c3c3c;
	line-height: 1.4;
	margin: 0;
	padding: 0;
}
#formulaire .form .radio {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	margin: 0;
	font-weight: 400;
	font-size: 16px;
	color: #3c3c3c;
	line-height: 1.2;
	padding: 4px 0;
}
/* Radio natif masqué, remplacé par .radio__dot */
#formulaire .form .radio input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
	margin: 0;
}
#formulaire .form .radio .radio__dot {
	width: 20px;
	height: 20px;
	border: 2px solid #7c7c7c;
	border-radius: 999px;
	background: #fff;
	position: relative;
	flex-shrink: 0;
	transition: border-color 0.15s, border-width 0.15s;
	box-sizing: border-box;
}
#formulaire .form .radio .radio__dot::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #fa2d0a;
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.15s;
}
#formulaire .form .radio input[type="radio"]:checked ~ .radio__dot {
	border-color: #fa2d0a;
	border-width: 3px;
}
#formulaire .form .radio input[type="radio"]:checked ~ .radio__dot::after {
	transform: translate(-50%, -50%) scale(1);
}
#formulaire .form .radio input[type="radio"]:focus-visible ~ .radio__dot {
	outline: 2px solid #fa2d0a;
	outline-offset: 3px;
}
#formulaire .form .radio .radio__label { font-family: "Outfit", sans-serif; }

/* ---------- Cartes défis (NOVA) ---------- */
.form__group--defis { border: 0; padding: 0; margin: 0 0 8px; }
.form__group--defis legend {
	font-family: "Outfit", sans-serif;
	font-weight: 400;
	font-size: 16px;
	color: #3c3c3c;
	padding: 0 0 12px;
	margin: 0;
	line-height: 1.5;
	float: none;
	width: auto;
	display: block;
}
.challenges {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}
#formulaire .form .challenge {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px 12px 16px;
	border: 1px solid transparent;
	border-radius: 20px;
	background: #fff3e6;
	cursor: pointer;
	transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
	color: #3c3c3c;
	margin: 0;
	min-height: 128px;
	text-align: center;
}
#formulaire .form .challenge:hover { background: #ffe4c9; }
/* Checkbox natif masqué */
#formulaire .form .challenge input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
	margin: 0;
}
.challenge__ico {
	display: block;
	width: 36px;
	height: 36px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	flex-shrink: 0;
}
.challenge__ico--cloud { background-image: url(../images/ico/ico_cloud.svg); }
.challenge__ico--run   { background-image: url(../images/ico/ico_run.svg); }
.challenge__ico--apple { background-image: url(../images/ico/ico_apple.svg); }
.challenge__ico--moon  { background-image: url(../images/ico/ico_moon.svg); }
#formulaire .form .challenge .challenge__cat {
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	font-size: 15px;
	color: #3c3c3c;
	line-height: 1.2;
	margin: 0;
	padding: 0;
}
#formulaire .form .challenge .challenge__titre {
	font-family: "Outfit", sans-serif;
	font-weight: 400;
	font-size: 12px;
	color: #636363;
	line-height: 1.3;
	margin: 0;
	padding: 0;
}
.challenge__check {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 22px;
	height: 22px;
	border: 2px solid #c3c3c3;
	border-radius: 999px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.18s, background 0.18s;
}
.challenge__check svg { opacity: 0; transition: opacity 0.15s; }
/* Sélectionné : garde le fond peach de base, on change juste la bordure + l'état du check */
#formulaire .form .challenge:has(input:checked) {
	border-color: #fa2d0a;
}
#formulaire .form .challenge:has(input:checked) .challenge__check {
	background: #fa2d0a;
	border-color: #fa2d0a;
}
#formulaire .form .challenge:has(input:checked) .challenge__check svg { opacity: 1; }
/* Ring bleu au focus (pseudo-element, même pattern que .form__field) */
#formulaire .form .challenge::after {
	content: "";
	position: absolute;
	inset: -6px;
	border: 2px solid #0015ff;
	border-radius: 26px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
}
#formulaire .form .challenge:has(input:focus)::after {
	opacity: 1;
}

/* ---------- Section opt-in + toggles ---------- */
.form__optin {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.form__optin-title {
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: #3c3c3c;
	margin: 0;
	padding: 0;
	line-height: 1.2;
	width: auto;
	max-width: none;
}
.form__optin-title::after,
.form__optin-title::before { display: none !important; }
.form__optin-desc {
	font-family: "Outfit", sans-serif;
	font-weight: 400;
	font-size: 14px;
	color: #3c3c3c;
	margin: 0;
	line-height: 1.4;
}
.form__toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 4px 0;
}
.form__toggle-label {
	font-family: "Outfit", sans-serif;
	font-weight: 400;
	font-size: 16px;
	color: #3c3c3c;
}
.toggle {
	position: relative;
	display: inline-block;
	cursor: pointer;
	margin: 0;
	width: 56px;
	height: 30px;
	flex-shrink: 0;
}
.toggle__input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	margin: 0;
	cursor: pointer;
	z-index: 2;
}
.toggle__track {
	position: absolute;
	inset: 0;
	background: #7c7c7c;
	border-radius: 999px;
	transition: background 0.2s;
}
/* Thumb blanc avec icône centrée (SVG en background).
   Off = minus grey. On = check rouge. La couleur du halo change via box-shadow. */
.toggle__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	background:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><line x1='7' y1='12' x2='17' y2='12' stroke='%233c3c3c' stroke-width='2.4' stroke-linecap='round'/></svg>") center/14px 14px no-repeat,
		#fff;
	border-radius: 999px;
	transition: transform 0.2s, background-image 0.15s, box-shadow 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle__input:checked ~ .toggle__track { background: #ec0900; }
.toggle__input:checked ~ .toggle__track .toggle__thumb {
	transform: translateX(26px);
	background:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M5 12L10 17L19 8' stroke='%23ec0900' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/14px 14px no-repeat,
		#fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
/* Ring bleu au focus (pseudo-element, même pattern que .form__field) */
.toggle::after {
	content: "";
	position: absolute;
	inset: -6px;
	border: 2px solid #0015ff;
	border-radius: 999px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
	z-index: 1;
}
.toggle:has(input:focus)::after {
	opacity: 1;
}

/* Séparateur orange fin */
.form__separator {
	height: 1px;
	background: #fa2d0a;
	opacity: 0.4;
	margin: 8px 0;
	border: 0;
}

/* ---------- Mention CNIL ---------- */
.form__mention-cnil {
	font-family: "Outfit", sans-serif;
	font-size: 13px;
	color: #3c3c3c;
	margin: 0;
	line-height: 1.5;
}
.form__mention-cnil a { color: #fa2d0a; text-decoration: underline; }

/* ---------- CTA envoyer ---------- */
.form__submit-wrap {
	position: sticky;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(180deg, transparent 0%, #fff 30%);
	padding: 16px 0 20px;
	margin: 8px -20px -120px;
	padding-left: 20px;
	padding-right: 20px;
	z-index: 5;
}
.btn-envoyer {
	display: block;
	width: 100%;
	background: linear-gradient(90deg, #fa2d0a 0%, #ff6a1f 50%, #ff8a3d 100%);
	color: #fff;
	border: 0;
	padding: 16px 24px;
	border-radius: 999px;
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	transition: box-shadow 0.2s, transform 0.2s, filter 0.2s;
	text-align: center;
	line-height: 1.2;
}
.btn-envoyer:hover:not(:disabled) {
	box-shadow: 0 6px 20px rgba(250, 45, 10, 0.35);
	transform: translateY(-1px);
	filter: brightness(1.03);
}
.btn-envoyer:disabled { opacity: 0.7; cursor: wait; }

/* États UI */
.form__state {
	margin-top: 12px;
	padding: 8px 12px;
	border-radius: 12px;
	text-align: center;
	font-size: 13px;
	font-family: "Outfit", sans-serif;
}
.form__state--error { background: #fdecea; color: #b3261e; }

/* Quand la confirmation est visible : le wrapper devient transparent
   pour laisser voir l'overlay grisé derrière la modale centrée. */
.modal-formulaire:has(#formulaire_content_valide:not(.hidden)) .modal-formulaire__wrapper {
	background: transparent;
	box-shadow: none;
	overflow: visible;
}
.modal-formulaire:has(#formulaire_content_valide:not(.hidden)) #formulaire_content {
	display: none;
}

/* ---------- Modale de confirmation ---------- */
.confirm {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 20px;
	padding: 40px 32px 32px;
	max-width: 360px;
	width: calc(100% - 40px);
	text-align: center;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
	z-index: 10;
	overflow: hidden;
	font-family: "Outfit", sans-serif;
}
.confirm.hidden { display: none !important; }
/* Habillage SVG unique exporté depuis Figma (2 rubans TL orange + BR rose).
   Insets calqués sur Figma (node 9206-4570) pour que les rubans peekent aux 2 coins
   opposés, clippés naturellement par le border-radius + overflow:hidden de la modale. */
.confirm__habillage {
	position: absolute;
	top: -32.44%;
	left: -44.65%;
	width: 192.04%;   /* 100% + 44.65% + 47.39% */
	height: 143.76%;  /* 100% + 32.44% + 11.32% */
	max-width: none;
	pointer-events: none;
	z-index: 0;
	display: block;
}
.confirm__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	background: #ececec;
	border: 0;
	border-radius: 999px;
	color: #3c3c3c;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	z-index: 2;
	transition: background 0.15s;
}
.confirm__close:hover { background: #d5d5d5; color: #3c3c3c; }
.confirm__check {
	display: block;
	margin: 8px auto 20px;
	width: 56px;
	height: 56px;
}
.confirm__check svg { display: block; }
#formulaire .modal-formulaire__wrapper .confirm__title,
.confirm__title {
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	font-size: 22px;
	line-height: 1.25;
	color: #3c3c3c;
	margin: 0 0 12px;
	padding: 0;
	width: auto;
	max-width: none;
	text-transform: none !important; /* neutralise le uppercase global h2 */
	letter-spacing: normal;
	text-shadow: none;
	background: transparent;
}
.confirm__title::after,
.confirm__title::before { display: none !important; content: none !important; }
.confirm__text {
	font-family: "Outfit", sans-serif;
	font-size: 15px;
	color: #3c3c3c;
	line-height: 1.5;
	margin: 0;
}

/* ---------- Desktop (≥ 768px) : modale centrée au lieu de fullscreen ---------- */
@media (min-width: 768px) {
	.modal-formulaire {
		display: none;
	}
	.modal-formulaire.is-open {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		overflow-y: auto;
		padding: 32px 16px;
	}
	.modal-formulaire__wrapper {
		width: 100%;
		max-width: 560px;
		height: auto;
		max-height: none;
		border-radius: 20px;
		overflow: hidden;
		padding: 0;
		background: radial-gradient(83% 20.41% at 50% 0%, rgba(255, 216, 176, 0.30) 1.56%, rgba(255, 216, 176, 0.00) 100%), #FFF;
		box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
	}
	.modal-formulaire__topbar {
		background: transparent;
		padding: 20px 32px 12px 32px; /* place au X en absolute */
		position: static;
	}
	.modal-formulaire__back { display: none; }
	.modal-formulaire__close { display: inline-flex; }
	.form {
		padding: 4px 32px 24px;
		gap: 12px;
	}
	.form__submit-wrap {
		position: static;
		background: transparent;
		padding: 0;
		margin: 8px 0 0;
	}
	.form__optin-title { font-size: 18px; }
	.challenges { gap: 16px; }
	.confirm {
		max-width: 400px;
		padding: 48px 36px 36px;
	}
	.confirm__title { font-size: 24px; }
}

/* Très petit (< 380px) : reduce padding challenge min-height */
@media (max-width: 380px) {
	.challenges { gap: 10px; }
	#formulaire .form .challenge { min-height: 118px; padding: 16px 8px 12px; }
	.challenge__ico { width: 30px; height: 30px; }
	#formulaire .form .challenge .challenge__cat { font-size: 14px; }
}
