/* Adhésion payante : le formulaire (même apparence que le formulaire Qomon de la page « Adhérer »)
   et la fenêtre de paiement. Tout est rangé sous #lfh-adhesion et .adh-fenetre : rien ne déborde sur le site. */

#lfh-adhesion, .adh-fenetre {
  --adh-noir: #000;
  --adh-blanc: #fff;
  --adh-bleu: #A9CAD2;
  --adh-jaune: #FCD227;
  --adh-rouge: #B00020;
  font-family: Poppins, system-ui, sans-serif;
  color: var(--adh-noir);
}
#lfh-adhesion *, .adh-fenetre * { box-sizing: border-box; }

/* ---------- Formulaire ---------- */
/* Même retrait que l'ancien formulaire Qomon : 32 px en haut et sur les côtés (moins sur un petit écran). */
.adh-form { width: 100%; margin: 0; padding: 32px clamp(0px, 4vw, 32px) 0; }
.adh-champ { display: flex; flex-direction: column; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.adh-rang { display: grid; grid-template-columns: minmax(96px, 1fr) 3fr; gap: 0 14px; }
.adh-rang--fin { grid-template-columns: 3fr minmax(96px, 1fr); }

.adh-champ > label, .adh-option span, .adh-legal span { font-size: 11px; font-weight: 700; line-height: 1.1; }
.adh-champ > label { margin: 0 0 6px; }
.adh-champ legend { padding: 0; margin: 0 0 4px; font-size: 14px; font-weight: 400; line-height: 20px; }
.adh-desc { margin: 0 0 8px; font-size: 13px; font-weight: 400; line-height: 1.5; }

.adh-champ input[type="text"], .adh-champ input[type="email"], .adh-champ input[type="tel"], .adh-champ select {
  width: 100%; min-height: 44px; margin: 4px 0 0; padding: 4px 8px;
  background: var(--adh-blanc); color: var(--adh-noir); -webkit-text-fill-color: var(--adh-noir);
  border: 2px solid var(--adh-noir); border-radius: 0; box-shadow: none;
  font: 500 14px/21px Poppins, system-ui, sans-serif;
}
@media (min-width: 1024px) {
  .adh-champ input[type="text"], .adh-champ input[type="email"], .adh-champ input[type="tel"], .adh-champ select { min-height: 42px; }
}
.adh-champ input::placeholder { color: rgba(0, 0, 0, .48); -webkit-text-fill-color: rgba(0, 0, 0, .48); opacity: 1; }
.adh-champ input:focus, .adh-champ select:focus { outline: 3px solid var(--adh-noir); outline-offset: 2px; }
.adh-champ [aria-invalid="true"] { border-color: var(--adh-rouge); }
.adh-message { margin: 6px 0 0; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--adh-rouge); }

/* Genre, élu : options en ligne. Compétences : une option par ligne. */
.adh-options { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 0; }
.adh-options--colonne { flex-direction: column; gap: 8px; }
.adh-option, .adh-legal label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.adh-options--colonne .adh-option span { font-size: 16px; font-weight: 400; line-height: 24px; }

.adh-option input, .adh-legal input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 16px; height: 16px; margin: 0; padding: 0;
  display: inline-grid; place-content: center; background: var(--adh-blanc); border: 1.5px solid var(--adh-noir); border-radius: 0; cursor: pointer;
}
.adh-option input[type="radio"] { border-radius: 50%; }
.adh-option input[type="radio"]:checked::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--adh-noir); }
.adh-option input[type="checkbox"]:checked, .adh-legal input:checked { background: var(--adh-noir); }
.adh-option input[type="checkbox"]:checked::before, .adh-legal input:checked::before {
  content: ""; width: 5px; height: 10px; border: solid var(--adh-blanc); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px);
}
.adh-option input:focus-visible, .adh-legal input:focus-visible { outline: 3px solid var(--adh-noir); outline-offset: 2px; }

.adh-legal { display: flex; flex-direction: column; margin: 36px 0 0; }
.adh-legal label { margin: 0 8px 10px; }
.adh-legal input { width: 15px; height: 15px; }
.adh-legal input:checked::before { width: 4px; height: 8px; }

.adh-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.adh-alerte { margin: 20px 0 0; padding: 12px 14px; background: var(--adh-blanc); border: 2px solid var(--adh-rouge); font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--adh-rouge); }
.adh-alerte[hidden] { display: none; }

.adh-envoi { display: flex; justify-content: center; margin: 28px 0 0; padding: 0 0 28px; border-bottom: 1px solid rgba(0, 0, 0, .28); }
.adh-bouton {
  background: var(--adh-noir); color: var(--adh-blanc); -webkit-text-fill-color: var(--adh-blanc);
  border: 2px solid var(--adh-noir); border-radius: 0; padding: 14px 24px; cursor: pointer;
  font: 800 14px/21px Poppins, system-ui, sans-serif; text-transform: uppercase;
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.adh-bouton:hover { background: var(--adh-blanc); color: var(--adh-noir); -webkit-text-fill-color: var(--adh-noir); transform: translate(-2px, -2px); }
.adh-bouton:focus-visible { outline: 3px solid var(--adh-noir); outline-offset: 3px; }
.adh-bouton[disabled] { opacity: .5; cursor: progress; transform: none; }

/* ---------- Fenêtre de paiement ---------- */
.adh-fenetre { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.adh-fenetre[hidden] { display: none; }
.adh-fenetre__fond { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.adh-fenetre__panneau {
  position: relative; width: min(860px, 100%); max-height: 100%; overflow-y: auto; padding: 28px 20px 20px;
  background: var(--adh-blanc); color: var(--adh-noir); box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
@media (min-width: 640px) { .adh-fenetre__panneau { padding: 40px 40px 28px; } }
body.adh-ouvert { overflow: hidden; }

.adh-fermer {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  background: var(--adh-blanc); color: var(--adh-noir); border: 1px solid var(--adh-noir); border-radius: 50%; cursor: pointer;
}
.adh-fermer:hover { background: var(--adh-noir); color: var(--adh-blanc); }
.adh-fermer:focus-visible, .adh-lien:focus-visible { outline: 3px solid var(--adh-noir); outline-offset: 2px; }

.adh-sur { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(0, 0, 0, .55); }
.adh-titre { margin: 12px 0 0; padding-right: 48px; font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; line-height: .95; letter-spacing: -.045em; }
.adh-texte { margin: 16px 0 0; max-width: 600px; font-size: 14px; font-weight: 600; line-height: 1.45; letter-spacing: -.015em; }
.adh-etape[hidden], .adh-etat[hidden], .adh-recap[hidden] { display: none; }
.adh-etat { margin: 20px 0 0; font-size: 14px; font-weight: 600; }
.adh-etat[data-erreur] { color: var(--adh-rouge); }
.adh-recap { margin: 20px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 15px; font-weight: 600; }
.adh-lien { padding: 0; background: none; border: 0; color: inherit; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.adh-stripe { margin-top: 16px; }

/* Choix du montant */
.adh-montant { margin-top: 28px; }
.adh-montant__chiffre { margin: 0; font-size: clamp(3.4rem, 10vw, 5.5rem); font-weight: 800; line-height: .85; letter-spacing: -.06em; font-variant-numeric: tabular-nums; transform-origin: left bottom; }
.adh-curseur { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; margin: 30px 0 0; border-radius: 999px; cursor: pointer; background: linear-gradient(to right, var(--adh-noir) var(--p, 0%), #dcdcdc var(--p, 0%)); }
.adh-curseur:focus-visible { outline: 2px solid var(--adh-noir); outline-offset: 8px; }
.adh-curseur::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 38px; border-radius: 50%; background: var(--adh-jaune); border: 3px solid var(--adh-noir); cursor: grab; transition: transform .12s; }
.adh-curseur::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.12); }
.adh-curseur::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: var(--adh-jaune); border: 3px solid var(--adh-noir); cursor: grab; }
.adh-echelle { position: relative; display: flex; justify-content: space-between; margin: 8px 0 0; font-size: 12px; font-weight: 600; color: rgba(0, 0, 0, .6); }
.adh-echelle--conseil { padding-bottom: 22px; }
/* Repère gris « don moyen conseillé » : un trait sous la piste, à la position du montant, et son texte.
   Le curseur passe par-dessus (z-index), le repère reste visible de part et d'autre. */
.adh-curseur { position: relative; z-index: 1; }
.adh-conseil { position: absolute; top: -8px; left: calc(19px + (100% - 38px) * var(--r, 0)); display: flex; flex-direction: column; align-items: flex-start; padding: 0; background: none; border: 0; font: inherit; color: rgba(0, 0, 0, .45); white-space: nowrap; cursor: pointer; transform: translateX(-1px); }
/* Le trait descend jusque sous la ligne « 20 € … 7 500 € » : le texte du repère ne touche jamais les bornes. */
.adh-conseil::before { content: ""; width: 2px; height: 24px; margin-bottom: 3px; background: currentColor; }
.adh-conseil:hover, .adh-conseil--choisi { color: rgba(0, 0, 0, .75); }
.adh-conseil:focus-visible { outline: 2px solid var(--adh-noir); outline-offset: 3px; }
.adh-conseil[hidden] { display: none; }
/* Ce que la cotisation permet de financer : c'est ce qui change quand on déplace le curseur. */
.adh-exemple { margin: 22px 0 0; padding: 18px 20px; background: var(--adh-bleu); }
.adh-exemple[hidden] { display: none; }
.adh-exemple__titre { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.adh-exemple__texte { margin: 6px 0 0; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; transform-origin: left center; }
.adh-exemple__texte::first-letter { text-transform: uppercase; }
.adh-infos { margin: 22px 0 0; display: grid; gap: 6px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.adh-infos p { margin: 0; }
.adh-infos p[hidden] { display: none; }
.adh-infos strong { font-weight: 700; }
.adh-infos small { font-size: 12px; opacity: .65; }
.adh-autre { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; font-weight: 600; }
.adh-autre input { width: 120px; min-height: 40px; padding: 4px 8px; border: 2px solid var(--adh-noir); border-radius: 0; font: 600 15px/1 Poppins, system-ui, sans-serif; }
.adh-autre[hidden] { display: none; }

/* Tarif réduit : même présentation que l'attestation, séparée du montant par un filet */
.adh-reduit { margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(0, 0, 0, .2); }
.adh-reduit .adh-attestation { margin: 0; }
.adh-reduit strong { display: block; font-weight: 700; }
.adh-reduit__detail { display: block; margin-top: 2px; font-weight: 500; }
.adh-attestation { margin: 24px 0 0; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 600; line-height: 1.45; cursor: pointer; }
.adh-attestation input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; display: inline-grid; place-content: center; background: var(--adh-blanc); border: 2px solid var(--adh-noir); cursor: pointer; }
.adh-attestation input:checked { background: var(--adh-noir); }
.adh-attestation input:checked::before { content: ""; width: 5px; height: 10px; border: solid var(--adh-blanc); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.adh-attestation input:focus-visible { outline: 3px solid var(--adh-noir); outline-offset: 2px; }
.adh-payer, .adh-asso__fini, .adh-agir { margin-top: 20px; width: 100%; padding: 16px 24px; background: var(--adh-noir); color: var(--adh-blanc); border: 1px solid var(--adh-noir); border-radius: 999px; font: 600 15px/1.2 Poppins, system-ui, sans-serif; text-transform: uppercase; cursor: pointer; transition: transform .15s, background .15s; }
.adh-payer:hover, .adh-asso__fini:hover, .adh-agir:hover { background: #0F1822; transform: translateY(-1px); }
.adh-payer:focus-visible, .adh-asso__fini:focus-visible, .adh-agir:focus-visible { outline: 3px solid var(--adh-noir); outline-offset: 3px; }

/* Accueil après le paiement : une fenêtre à part entière, « Bienvenue à La France Humaniste ! » en grand. */
.adh-fenetre--merci .adh-fenetre__panneau { width: min(560px, 100%); }
.adh-fenetre--merci :is(.adh-sur, .adh-titre, .adh-essai) { display: none; }
.adh-merci { padding: 12px 0 4px; text-align: center; }
.adh-merci__titre { margin: 0 auto; max-width: 440px; font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 700; line-height: 1; letter-spacing: -.045em; text-wrap: balance; }
.adh-merci__texte { margin: 16px 0 0; font-size: 16px; font-weight: 500; line-height: 1.45; color: rgba(0, 0, 0, .7); }
.adh-agir { display: block; margin-top: 28px; text-align: center; text-decoration: none; }
.adh-agir[hidden] { display: none; }
.adh-merci { animation: adh-arrivee .35s ease-out; }
@keyframes adh-arrivee { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .adh-merci { animation: none; } }

/* ---------- Plan B : formulaire AssoConnect dans la fenêtre ---------- */
.adh-asso { margin-top: 16px; }
.adh-asso[hidden] { display: none; }
.adh-asso__texte { margin: 0 0 12px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.adh-asso__cadre { display: block; width: 100%; min-height: 480px; border: 0; }

/* ---------- Thème Agir (même formulaire, DA d'Agir) ----------
   Couleurs de la charte d'Agir (lfh-action, src/index.css) : vert #1c7768, bleu électrique #3c3cef pour le focus,
   angles sobres (8 à 10 px), ombres douces. Seule la présentation change : le fonctionnement est identique. */
#lfh-adhesion.adh--agir, .adh-fenetre.adh--agir {
  --adh-bleu: #fdf4df;
  --adh-vert: #1c7768;
  --adh-focus: #3c3cef;
}
.adh--agir .adh-champ input[type="text"], .adh--agir .adh-champ input[type="email"], .adh--agir .adh-champ input[type="tel"], .adh--agir .adh-champ select {
  border-width: 1px; border-color: rgba(0, 0, 0, .35); border-radius: 8px;
}
.adh--agir .adh-champ input:focus, .adh--agir .adh-champ select:focus { outline: 2px solid var(--adh-focus); outline-offset: 1px; border-color: var(--adh-focus); }
.adh--agir .adh-bouton { background: var(--adh-vert); border-color: var(--adh-vert); border-radius: 10px; }
.adh--agir .adh-bouton:hover { background: var(--adh-blanc); color: var(--adh-vert); -webkit-text-fill-color: var(--adh-vert); transform: none; }
.adh-fenetre.adh--agir .adh-fenetre__panneau { border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.adh-fenetre.adh--agir :is(.adh-payer, .adh-asso__fini, .adh-agir) { background: var(--adh-vert); border-color: var(--adh-vert); border-radius: 10px; }
.adh-fenetre.adh--agir :is(.adh-payer, .adh-asso__fini, .adh-agir):hover { background: #145a4f; }
.adh-fenetre.adh--agir .adh-curseur { background: linear-gradient(to right, var(--adh-vert) var(--p, 0%), #dcdcdc var(--p, 0%)); }
.adh-fenetre.adh--agir .adh-exemple, .adh-fenetre.adh--agir .adh-merci { border-radius: 10px; }
.adh-fenetre.adh--agir .adh-attestation input:checked, .adh--agir .adh-option input[type="checkbox"]:checked, .adh--agir .adh-legal input:checked { background: var(--adh-vert); border-color: var(--adh-vert); }

.adh-essai { margin: 0 0 12px; padding: 6px 10px; display: inline-block; background: var(--adh-jaune); border: 2px solid var(--adh-noir); font-size: 12px; font-weight: 700; }

.adh-pop { animation: adh-pop .28s ease-out; }
@keyframes adh-pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .adh-pop { animation: none; }
  .adh-bouton, .adh-payer, .adh-curseur::-webkit-slider-thumb { transition: none; }
}
