/* =========================================================================
   Formulaires CTEA — libellés au-dessus, champs pleins, choix dessinés,
   étapes avec barre de progression, envoi sans recharger.
   Rythme de 4/8 px, cibles de 44 px au moins, aucune ombre portée.
   ========================================================================= */

.ctea-f {
	--f-encre: #0F0F0F;
	--f-terre: #B33F19;
	--f-creme: #F4F1EA;
	--f-fond: #F6F3EE;
	--f-carte: #FFFFFF;
	--f-filet: rgba(15, 15, 15, .12);
	--f-filet-fort: rgba(15, 15, 15, .22);
	--f-doux: rgba(15, 15, 15, .62);
	--f-rouge: #B3261E;
	--f-titre: "General Sans", system-ui, sans-serif;
	position: relative;
	color: var(--f-encre);
	font-family: var(--f-titre);
	font-size: 16px;
	line-height: 1.5;
}
.ctea-f *, .ctea-f *::before, .ctea-f *::after { box-sizing: border-box; }
.ctea-f__piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ctea-f__cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ctea-f__ico { width: 16px; height: 16px; flex: none; }

/* ---------- Grille : 12 colonnes, une seule sur téléphone ---------- */
.ctea-f__grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 28px 16px; }
.ctea-f__champ, .ctea-f__texte { grid-column: span var(--cols, 12); min-width: 0; margin: 0; padding: 0; border: 0; }
@media (max-width: 767px) {
	.ctea-f__grille { gap: 24px 12px; }
	.ctea-f__champ, .ctea-f__texte { grid-column: 1 / -1; }
}
.ctea-f__texte { font-size: 14px; line-height: 1.55; color: var(--f-doux); }
.ctea-f__texte hr { display: none; }
.ctea-f__texte .reg-step { margin: 0 !important; color: var(--f-encre); }

/* ---------- Libellés ---------- */
.ctea-f__label { display: block; float: none; width: 100%; margin: 0 0 10px; padding: 0; font: 500 14px/1.3 var(--f-titre); letter-spacing: 0; text-transform: none; color: var(--f-encre); }
.ctea-f__facultatif { margin-left: 4px; font-weight: 400; color: var(--f-doux); }

/* ---------- Champs ---------- */
.ctea-f .ctea-f__saisie {
	display: block; width: 100%; min-height: 52px; margin: 0; padding: 14px 16px;
	border: 1px solid transparent; border-radius: 12px; background: var(--f-fond);
	color: var(--f-encre); font: 400 16px/1.4 inherit; font-family: inherit;
	box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.ctea-f .ctea-f__saisie::placeholder { color: rgba(15, 15, 15, .4); opacity: 1; }
.ctea-f .ctea-f__saisie:hover { border-color: var(--f-filet-fort); }
.ctea-f .ctea-f__saisie:focus, .ctea-f .ctea-f__saisie:focus-visible, .ctea-f .ctea-f__declencheur[aria-expanded="true"] {
	border-color: var(--f-terre); background: var(--f-carte); box-shadow: inset 0 0 0 1px var(--f-terre);
}
.ctea-f textarea.ctea-f__saisie { min-height: 148px; resize: vertical; }

/* ---------- Liste dessinée (remplace la liste du navigateur) ---------- */
.ctea-f__liste { position: relative; }
.ctea-f .ctea-f__declencheur { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.ctea-f__valeur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctea-f__declencheur:not(.est-rempli) .ctea-f__valeur { color: rgba(15, 15, 15, .4); }
.ctea-f__declencheur .ctea-f__ico { transition: transform .2s ease; color: var(--f-doux); }
.ctea-f__declencheur[aria-expanded="true"] .ctea-f__ico { transform: rotate(180deg); }
.ctea-f__menu {
	position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
	max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
	border: 1px solid var(--f-filet); border-radius: 14px; background: var(--f-carte);
	animation: ctea-f-ouvre .16s ease;
}
.ctea-f__menu[hidden] { display: none; }
.ctea-f__menu li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.ctea-f__menu li .ctea-f__ico { opacity: 0; color: var(--f-terre); }
.ctea-f__menu li.est-survol { background: var(--f-fond); }
.ctea-f__menu li[aria-selected="true"] { font-weight: 500; }
.ctea-f__menu li[aria-selected="true"] .ctea-f__ico { opacity: 1; }
@keyframes ctea-f-ouvre { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Choix : commun ---------- */
.ctea-f__option { position: relative; display: block; margin: 0; cursor: pointer; }
.ctea-f__coche-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ctea-f__pastille { display: flex; align-items: center; gap: 8px; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.ctea-f__coche-input:focus-visible + .ctea-f__pastille, .ctea-f__coche-input:focus-visible + .ctea-f__case { outline: 2px solid var(--f-terre); outline-offset: 2px; }

/* Pastilles : choix courts et nombreux, sur plusieurs lignes */
.ctea-f__choix--puces { display: flex; flex-wrap: wrap; gap: 8px; }
.ctea-f__choix--puces .ctea-f__pastille { min-height: 44px; padding: 0 18px; border: 1px solid var(--f-filet-fort); border-radius: 999px; background: var(--f-carte); font-size: 15px; font-weight: 500; line-height: 1.2; }
.ctea-f__choix--puces .ctea-f__ico { width: 0; margin-right: -8px; opacity: 0; transition: width .18s ease, margin .18s ease, opacity .18s ease; }
.ctea-f__choix--puces .ctea-f__option:hover .ctea-f__pastille { border-color: var(--f-encre); }
.ctea-f__choix--puces .ctea-f__coche-input:checked + .ctea-f__pastille { border-color: var(--f-encre); background: var(--f-encre); color: var(--f-creme); }
.ctea-f__choix--puces .ctea-f__coche-input:checked + .ctea-f__pastille .ctea-f__ico { width: 16px; margin-right: 0; opacity: 1; }

/* Moyens de paiement : vrai logo de l'opérateur à gauche */
.ctea-f__choix--puces .ctea-f__pastille.a-logo { gap: 10px; padding-left: 8px; }
.ctea-f__logo { display: block; flex: none; width: 28px; height: 28px; border-radius: 50%; }
.ctea-f__logo--trait { display: grid; place-items: center; background: var(--f-fond); color: var(--f-encre); transition: background-color .18s ease, color .18s ease; }
.ctea-f__logo--trait svg { width: 16px; height: 16px; }
.ctea-f__choix--puces .ctea-f__coche-input:checked + .a-logo .ctea-f__logo--trait { background: rgba(244, 241, 234, .14); color: var(--f-creme); }

/* Barre à segments : deux ou trois mots courts */
.ctea-f__choix--segments { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 999px; background: var(--f-fond); }
.ctea-f__choix--segments .ctea-f__pastille { justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--f-doux); }
.ctea-f__choix--segments .ctea-f__ico { display: none; }
.ctea-f__choix--segments .ctea-f__option:hover .ctea-f__pastille { color: var(--f-encre); }
.ctea-f__choix--segments .ctea-f__coche-input:checked + .ctea-f__pastille { background: var(--f-encre); color: var(--f-creme); }

/* Cartes : montants, cycles, formules avec un détail */
.ctea-f__choix--cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ctea-f__choix--cartes .ctea-f__pastille {
	position: relative; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
	height: 100%; min-height: 76px; padding: 18px 20px; border: 1px solid var(--f-filet-fort); border-radius: 16px; background: var(--f-carte);
}
.ctea-f__choix--cartes .ctea-f__ico {
	position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; padding: 4px;
	border: 1.5px solid var(--f-filet-fort); border-radius: 50%; color: transparent; stroke-width: 2;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.ctea-f__choix--cartes .ctea-f__option-titre { font: 500 19px/1.2 var(--f-titre); letter-spacing: -.01em; padding-right: 28px; }
.ctea-f__option-detail { font-size: 14px; line-height: 1.35; color: var(--f-doux); }
.ctea-f__option--monnaie .ctea-f__option-titre { white-space: nowrap; font-size: 24px; letter-spacing: -.02em; font-feature-settings: "tnum", "lnum"; }
.ctea-f__option--monnaie .ctea-f__option-detail { order: 2; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ctea-f__choix--cartes .ctea-f__option:hover .ctea-f__pastille { border-color: var(--f-encre); }
.ctea-f__choix--cartes .ctea-f__coche-input:checked + .ctea-f__pastille { border-color: var(--f-encre); box-shadow: inset 0 0 0 1px var(--f-encre); background: var(--f-fond); }
.ctea-f__choix--cartes .ctea-f__coche-input:checked + .ctea-f__pastille .ctea-f__ico { border-color: var(--f-terre); background: var(--f-terre); color: #fff; }
@media (max-width: 480px) {
	.ctea-f__choix--cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.ctea-f__choix--cartes .ctea-f__pastille { min-height: 72px; padding: 14px 16px; }
	.ctea-f__choix--cartes .ctea-f__option-titre { font-size: 17px; }
	.ctea-f__option--monnaie .ctea-f__option-titre { font-size: 18px; padding-right: 0; }
	.ctea-f__choix--cartes:not([style*="--n:4"]) { grid-template-columns: 1fr; }
}

/* ---------- Accord (case à cocher) ---------- */
.ctea-f__accord { display: flex; align-items: flex-start; gap: 14px; margin: 0; padding: 4px 0; cursor: pointer; }
.ctea-f__case { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: 1px; border: 1.5px solid var(--f-filet-fort); border-radius: 7px; background: var(--f-carte); color: transparent; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.ctea-f__case .ctea-f__ico { width: 14px; height: 14px; stroke-width: 2.2; }
.ctea-f__accord:hover .ctea-f__case { border-color: var(--f-encre); }
.ctea-f__coche-input:checked + .ctea-f__case { border-color: var(--f-encre); background: var(--f-encre); color: var(--f-creme); }
.ctea-f__accord-texte { font-size: 15px; line-height: 1.55; color: rgba(15, 15, 15, .85); }
.ctea-f__champ--acceptance + .ctea-f__champ--acceptance { margin-top: -12px; }

/* ---------- Erreurs ---------- */
.ctea-f__erreur { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--f-rouge); }
.ctea-f__erreur::before { content: "!"; display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--f-rouge); color: #fff; font-size: 11px; font-weight: 700; }
.ctea-f__erreur[hidden] { display: none; }
.ctea-f__champ.a-erreur .ctea-f__saisie { border-color: var(--f-rouge); background: #FDF6F4; }
.ctea-f__champ.a-erreur .ctea-f__case { border-color: var(--f-rouge); }

/* ---------- Pied : mention, retour, envoi ---------- */
.ctea-f__pied, .ctea-f__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--f-filet); }
.ctea-f__nav { justify-content: flex-end; }
.ctea-f__nav .ctea-f__retour { margin-right: auto; }
.ctea-f__mention { flex: 1 1 260px; max-width: 46ch; margin: 0; font-size: 13px; line-height: 1.55; color: var(--f-doux); }
.ctea-f__mention p { margin: 0; }
.ctea-f__pied .ctea-f__envoyer { margin-left: auto; }
.ctea-f__bouton {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
	min-height: 52px; margin: 0; padding: 0 24px 0 28px; border: 0; border-radius: 999px;
	background: var(--f-encre); color: var(--f-creme); font: 500 15px/1.2 var(--f-titre); letter-spacing: 0; text-transform: none;
	cursor: pointer; transition: background-color .25s ease, color .25s ease;
}
.ctea-f__bouton:hover, .ctea-f__bouton:focus-visible { background: var(--f-terre); color: #fff; }
.ctea-f__bouton:focus-visible { outline: 2px solid var(--f-terre); outline-offset: 3px; }
.ctea-f__bouton .ctea-f__ico { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.ctea-f__bouton:hover .ctea-f__ico--fleche { transform: translateX(4px); }
.ctea-f__retour { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 4px; border: 0; background: none; color: var(--f-doux); font: 500 15px/1.2 var(--f-titre); cursor: pointer; transition: color .2s ease; }
.ctea-f__retour:hover, .ctea-f__retour:focus-visible { color: var(--f-encre); background: none; }
.ctea-f__retour:hover .ctea-f__ico { transform: translateX(-3px); }
.ctea-f__retour .ctea-f__ico { transition: transform .3s ease; }
.ctea-f__alerte { flex-basis: 100%; margin: 0; padding: 12px 16px; border-radius: 12px; background: #FBEDE8; color: #8A2A12; font-size: 14px; line-height: 1.45; }
.ctea-f__alerte[hidden] { display: none; }
@media (max-width: 767px) {
	.ctea-f__pied .ctea-f__envoyer, .ctea-f__nav .ctea-f__bouton { flex: 1 1 100%; margin-left: 0; }
	.ctea-f__pied .ctea-f__retour { order: 3; }
	.ctea-f__nav .ctea-f__retour { order: 2; flex: 1 1 100%; justify-content: center; margin: 0; }
	.ctea-f__mention { flex-basis: 100%; max-width: none; }
}

/* Envoi en cours */
.ctea-f__attente { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ctea-f-tourne .7s linear infinite; }
.ctea-f.est-envoi .ctea-f__envoyer { pointer-events: none; opacity: .85; }
.ctea-f.est-envoi .ctea-f__envoyer .ctea-f__ico { display: none; }
.ctea-f.est-envoi .ctea-f__attente { display: block; }
@keyframes ctea-f-tourne { to { transform: rotate(360deg); } }

/* ---------- Étapes ---------- */
.ctea-f__progres { margin: 0 0 40px; }
.ctea-f__compteur { display: none; justify-content: space-between; gap: 12px; margin: 0 0 12px; font: 600 12px/1.2 var(--f-titre); letter-spacing: .04em; text-transform: uppercase; color: var(--f-terre); }
.ctea-f__compteur-titre { display: none; }
.ctea-f__segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.ctea-f__segments li { margin: 0; padding: 0; counter-increment: etape; }
.ctea-f__segments li::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--f-filet); transition: background-color .3s ease; }
.ctea-f__segments li.est-fait::before, .ctea-f__segments li.est-actif::before { background: var(--f-terre); }
.ctea-f__segment-titre { display: block; margin-top: 12px; font: 500 13px/1.3 var(--f-titre); color: var(--f-doux); }
.ctea-f__segment-titre::before { content: counter(etape, decimal-leading-zero) " "; font-feature-settings: "tnum"; color: inherit; opacity: .7; }
.ctea-f__segments li.est-actif .ctea-f__segment-titre { color: var(--f-encre); }
.ctea-f__segments li.est-actif .ctea-f__segment-titre::before { color: var(--f-terre); opacity: 1; }
@media (max-width: 767px) {
	.ctea-f__compteur { display: flex; }
	.ctea-f__segment-titre { display: none; }
	.ctea-f__progres { margin-bottom: 32px; }
}
.ctea-f__etape[hidden] { display: none; }
.ctea-f--js .ctea-f__etape:not([hidden]) { animation: ctea-f-etape .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes ctea-f-etape { from { opacity: 0; transform: translateX(12px); } }
/* Sans JavaScript : toutes les étapes visibles, un seul envoi. */
.ctea-f:not(.ctea-f--js) .ctea-f__etape[hidden] { display: block; margin-top: 40px; }
.ctea-f:not(.ctea-f--js) .ctea-f__nav, .ctea-f:not(.ctea-f--js) .ctea-f__progres, .ctea-f:not(.ctea-f--js) .ctea-f__retour { display: none; }

/* ---------- Merci ---------- */
.ctea-f__merci { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0; outline: none; animation: ctea-f-etape .45s cubic-bezier(.2, .7, .2, 1); }
.ctea-f__merci[hidden] { display: none; }
.ctea-f__merci-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: var(--f-terre); color: #fff; }
.ctea-f__merci-ico .ctea-f__ico { width: 26px; height: 26px; stroke-width: 2; }
.ctea-f__merci-titre { margin: 0; font: 500 30px/1.1 var(--f-titre); letter-spacing: -.02em; }
.ctea-f__merci-texte { max-width: 52ch; margin: 0; font-size: 16px; line-height: 1.6; color: var(--f-doux); }
.ctea-f__lien { margin: 8px 0 0; padding: 0; border: 0; background: none; color: var(--f-encre); font: 500 15px/1.4 var(--f-titre); text-decoration: underline; text-decoration-color: rgba(15, 15, 15, .3); text-underline-offset: 4px; cursor: pointer; }
.ctea-f__lien:hover, .ctea-f__lien:focus-visible { color: var(--f-terre); background: none; text-decoration-color: currentColor; }
.ctea-f.est-envoye .ctea-f__corps, .ctea-f.est-envoye .ctea-f__progres { display: none; }

/* ---------- Lettre d'information : une ligne ---------- */
.ctea-f--ligne .ctea-f__corps { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 22px; border: 1px solid rgba(15, 15, 15, .08); border-radius: 999px; background: var(--f-carte); transition: border-color .2s ease; }
.ctea-f--ligne .ctea-f__corps:focus-within { border-color: var(--f-terre); }
.ctea-f--ligne .ctea-f__grille { display: block; flex: 1 1 auto; min-width: 0; }
.ctea-f--ligne .ctea-f__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.ctea-f--ligne .ctea-f__saisie, .ctea-f--ligne .ctea-f__saisie:hover, .ctea-f--ligne .ctea-f__saisie:focus { min-height: 48px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.ctea-f--ligne .ctea-f__pied { flex: none; flex-wrap: nowrap; margin: 0; padding: 0; border: 0; }
.ctea-f--ligne .ctea-f__bouton { min-height: 48px; padding: 0 18px 0 22px; white-space: nowrap; }
.ctea-f--ligne .ctea-f__erreur, .ctea-f--ligne .ctea-f__alerte { position: absolute; top: calc(100% + 10px); left: 22px; right: 0; padding: 0; background: none; }
.ctea-f--ligne .ctea-f__alerte { color: var(--f-rouge); font-size: 13px; }
.ctea-f--ligne .ctea-f__merci { flex-direction: row; align-items: center; gap: 14px; padding: 6px 0; }
.ctea-f--ligne .ctea-f__merci-ico { width: 40px; height: 40px; margin: 0; }
.ctea-f--ligne .ctea-f__merci-ico .ctea-f__ico { width: 20px; height: 20px; }
.ctea-f--ligne .ctea-f__merci-titre { display: none; }
.ctea-f--ligne .ctea-f__merci-texte { font-size: 14px; }
@media (max-width: 400px) {
	.ctea-f--ligne .ctea-f__corps { padding-left: 18px; }
	.ctea-f--ligne .ctea-f__bouton { padding: 0 16px; }
	.ctea-f--ligne .ctea-f__bouton .ctea-f__ico--fleche { display: none; }
}

/* ---------- Sur fond sombre ---------- */
.ctea-f--sombre { --f-encre: #F4F1EA; --f-fond: rgba(244, 241, 234, .07); --f-carte: rgba(244, 241, 234, .04); --f-filet: rgba(244, 241, 234, .14); --f-filet-fort: rgba(244, 241, 234, .26); --f-doux: rgba(244, 241, 234, .66); --f-creme: #0F0F0F; }
.ctea-f--sombre .ctea-f__saisie::placeholder { color: rgba(244, 241, 234, .45); }
.ctea-f--sombre .ctea-f__bouton { background: var(--f-terre); color: #fff; }
.ctea-f--sombre .ctea-f__bouton:hover { background: #F4F1EA; color: #0F0F0F; }
.ctea-f--sombre.ctea-f--ligne .ctea-f__corps { background: rgba(244, 241, 234, .06); border-color: rgba(244, 241, 234, .16); }

@media (prefers-reduced-motion: reduce) {
	.ctea-f *, .ctea-f { animation: none !important; transition: none !important; }
}

/* Contrôle anti-robots (Cloudflare Turnstile) : invisible, sauf quand Cloudflare demande un geste. */
.ctea-robot { display: none; }
.ctea-robot.ctea-robot--visible { display: block; margin: 4px 0 0; }
