/* Page d'adhésion — même style que l'agenda, le bureau et l'APE */
.adh-bte {
  --bte-noir: #1f1d24;
  --bte-texte: #4a4752;
  --bte-ligne: #ece7df;
  --bte-orange: #f29400;
  --bte-vert: #2fa84f;
  --bte-violet: #8e3c9e;
  --bte-rouge: #e9573f;
  --manuscrite: 'Gochi Hand', 'Comic Sans MS', cursive;

  max-width: 760px;
  margin-inline: auto;
  color: var(--bte-texte);
  line-height: 1.6;
}
.adh-bte *, .adh-bte *::before, .adh-bte *::after { box-sizing: border-box; }

/* ---------- Intro ---------- */
.adh-intro {
  position: relative;
  margin-bottom: 2rem;
  padding: 2rem 1.8rem 1.6rem;
  text-align: center;
  background: linear-gradient(135deg, #fff3e0, #f4e9f6 55%, #e7f6eb);
  border-radius: 24px;
}
.adh-prix {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 0.1rem 1.2rem;
  border-radius: 999px;
  background: var(--bte-orange);
  color: #fff;
  font-family: var(--manuscrite);
  font-size: 2.6rem;
  line-height: 1.3;
  box-shadow: 0 5px 0 #b86f00;
  transform: rotate(-3deg);
}
.adh-prix small { font-size: 1.2rem; }
.adh-bte .adh-intro__titre {
  margin: 1rem 0 0.4rem;
  font-family: var(--manuscrite);
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--bte-noir);
}
.adh-intro p { margin: 0 auto 1rem; max-width: 560px; }
.adh-intro strong { color: var(--bte-noir); }
.adh-atouts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.adh-atouts li {
  padding: 0.35rem 0.9rem;
  background: #fff;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bte-noir);
}

/* ---------- Alertes ---------- */
.adh-alerte {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border-left: 5px solid var(--bte-rouge);
  border-radius: 12px;
  background: #fdecea;
  color: #8a2a1a;
  font-weight: 600;
}

/* ---------- Blocs du formulaire ---------- */
.adh-form { display: grid; gap: 1.5rem; }

.adh-bloc {
  --accent: var(--bte-orange);
  --accent-doux: #fff3e0;
  min-width: 0;
  margin: 0;
  padding: 1.4rem 1.5rem 1.5rem;
  background: #fff;
  border: 1px solid var(--bte-ligne);
  border-top: 6px solid var(--accent);
  border-radius: 20px;
  box-shadow: 0 10px 30px -18px rgba(31, 29, 36, 0.35);
}
.adh-bloc--violet { --accent: var(--bte-violet); --accent-doux: #f4e9f6; }
.adh-bloc--vert   { --accent: var(--bte-vert);   --accent-doux: #e7f6eb; }

.adh-bloc legend {
  float: left; /* place la légende dans le bloc, pas sur la bordure */
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  font-family: var(--manuscrite);
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--bte-noir);
}
.adh-bloc legend + * { clear: both; }
.adh-num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 65%, #000);
}

/* ---------- Champs ---------- */
.adh-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.adh-champ { margin: 0; }
.adh-champ--large { grid-column: 1 / -1; }
.adh-champ label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--bte-noir);
}
.adh-bte abbr[title] {
  text-decoration: none;
  color: var(--bte-rouge);
  cursor: help;
}
.adh-champ input,
.adh-champ select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--bte-ligne);
  border-radius: 12px;
  background: #fffdfa;
  font: inherit;
  font-size: 1rem;
  color: var(--bte-noir);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.adh-champ select {
  appearance: none;
  padding-right: 2.4rem;
  background: #fffdfa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234a4752' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.9rem center;
}
.adh-champ input::placeholder { color: #aaa4ad; }
.adh-champ input:focus,
.adh-champ select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--accent-doux);
}
/* Erreur affichée seulement après que l'utilisateur a quitté le champ */
.adh-champ input:user-invalid,
.adh-champ select:user-invalid {
  border-color: var(--bte-rouge);
  box-shadow: 0 0 0 4px #fdecea;
}

/* ---------- Enfants ---------- */
.adh-enfants { display: grid; gap: 0.8rem; }
.adh-enfant {
  display: grid;
  grid-template-columns: auto 1fr 170px auto;
  align-items: end;
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: var(--accent-doux);
}
.adh-enfant.is-nouveau { animation: adh-arrivee 0.4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes adh-arrivee {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.adh-enfant .adh-champ--large { grid-column: auto; }
.adh-enfant__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 48px;
  font-family: var(--manuscrite);
  font-size: 1.6rem;
  color: var(--accent);
}
.adh-retirer {
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--bte-texte);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.adh-retirer:hover, .adh-retirer:focus-visible { color: var(--bte-rouge); border-color: var(--bte-rouge); outline: none; }
.adh-retirer[hidden] { display: grid; visibility: hidden; }

.adh-ajouter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.6rem 1.1rem;
  border: 2px dashed var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.adh-ajouter span { font-size: 1.3rem; line-height: 1; }
.adh-ajouter:hover, .adh-ajouter:focus-visible { background: var(--accent-doux); transform: translateY(-2px); outline: none; }
.adh-ajouter[hidden] { display: none; }

/* ---------- Interrupteur bénévole ---------- */
.adh-interrupteur {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--bte-ligne);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.adh-interrupteur input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.adh-interrupteur__piste {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 30px;
  margin-top: 2px;
  border-radius: 999px;
  background: #d9d4cc;
  transition: background 0.25s ease;
}
.adh-interrupteur__piste::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1);
}
.adh-interrupteur input:checked + .adh-interrupteur__piste { background: var(--accent); }
.adh-interrupteur input:checked + .adh-interrupteur__piste::after { transform: translateX(24px); }
.adh-interrupteur:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); }
.adh-interrupteur input:focus-visible + .adh-interrupteur__piste { box-shadow: 0 0 0 4px var(--accent-doux), 0 0 0 6px var(--accent); }
.adh-interrupteur__texte strong { display: block; color: var(--bte-noir); font-size: 1.05rem; }
.adh-interrupteur__texte small { display: block; font-size: 0.9rem; }

/* ---------- Paiement ---------- */
.adh-paiement {
  padding: 1.5rem;
  background: #fff;
  border: 2px solid var(--bte-noir);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--bte-noir);
}
.adh-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px dashed var(--bte-ligne);
  font-weight: 700;
  color: var(--bte-noir);
}
.adh-total strong {
  font-family: var(--manuscrite);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1;
  color: var(--bte-orange);
}
.adh-case {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.adh-case input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--bte-vert);
  cursor: pointer;
}
.adh-bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--bte-rouge);
  color: #fff !important;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 5px 0 #b33d29;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.adh-bouton:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #b33d29; }
.adh-bouton:active { transform: translateY(3px); box-shadow: 0 2px 0 #b33d29; }
.adh-bouton:focus-visible { outline: 3px solid var(--bte-violet); outline-offset: 3px; }
.adh-bouton.is-chargement { background: #b9aeb0; box-shadow: 0 5px 0 #8d8385; cursor: wait; }
.adh-bouton--secondaire { width: auto; display: inline-flex; background: var(--bte-violet); box-shadow: 0 5px 0 #612869; }
.adh-bouton--secondaire:hover { box-shadow: 0 7px 0 #612869; }

.adh-securite {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

/* Piège à robots */
.adh-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pages de retour ---------- */
.adh-merci {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1.8rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--bte-ligne);
  border-top: 6px solid var(--bte-vert);
  border-radius: 24px;
  box-shadow: 0 10px 30px -18px rgba(31, 29, 36, 0.35);
}
.adh-merci--attente { border-top-color: var(--bte-orange); }
.adh-merci--echec   { border-top-color: var(--bte-rouge); }
.adh-merci__icone { display: block; font-size: 3.5rem; line-height: 1; animation: adh-rebond 1.2s ease infinite; }
@keyframes adh-rebond { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.adh-bte .adh-merci h2 {
  margin: 0.8rem 0 0.6rem;
  font-family: var(--manuscrite);
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--bte-noir);
}
.adh-merci p { max-width: 520px; margin: 0 auto 0.8rem; }
.adh-merci .adh-bouton { margin-top: 0.8rem; }
.adh-merci form .adh-bouton { max-width: 340px; margin-inline: auto; }
.adh-merci__enfants strong { color: var(--bte-violet); }

/* Confettis */
.adh-confettis i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  animation: adh-confetti 2.6s ease-in forwards;
}
.adh-confettis i:nth-child(3n)   { background: var(--bte-orange); }
.adh-confettis i:nth-child(3n+1) { background: var(--bte-vert); }
.adh-confettis i:nth-child(3n+2) { background: var(--bte-violet); }
.adh-confettis i:nth-child(1)  { left: 5%;  animation-delay: 0.0s; }
.adh-confettis i:nth-child(2)  { left: 11%; animation-delay: 0.3s; }
.adh-confettis i:nth-child(3)  { left: 17%; animation-delay: 0.1s; }
.adh-confettis i:nth-child(4)  { left: 23%; animation-delay: 0.5s; }
.adh-confettis i:nth-child(5)  { left: 29%; animation-delay: 0.2s; }
.adh-confettis i:nth-child(6)  { left: 35%; animation-delay: 0.6s; }
.adh-confettis i:nth-child(7)  { left: 41%; animation-delay: 0.15s; }
.adh-confettis i:nth-child(8)  { left: 47%; animation-delay: 0.45s; }
.adh-confettis i:nth-child(9)  { left: 53%; animation-delay: 0.05s; }
.adh-confettis i:nth-child(10) { left: 59%; animation-delay: 0.35s; }
.adh-confettis i:nth-child(11) { left: 65%; animation-delay: 0.25s; }
.adh-confettis i:nth-child(12) { left: 71%; animation-delay: 0.55s; }
.adh-confettis i:nth-child(13) { left: 77%; animation-delay: 0.1s; }
.adh-confettis i:nth-child(14) { left: 83%; animation-delay: 0.4s; }
.adh-confettis i:nth-child(15) { left: 89%; animation-delay: 0.2s; }
.adh-confettis i:nth-child(16) { left: 95%; animation-delay: 0.5s; }
.adh-confettis i:nth-child(17) { left: 14%; animation-delay: 0.7s; }
.adh-confettis i:nth-child(18) { left: 86%; animation-delay: 0.75s; }
@keyframes adh-confetti {
  0%   { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(420px) rotate(540deg); }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .adh-intro { padding: 1.6rem 1.1rem 1.3rem; border-radius: 18px; }
  .adh-bloc { padding: 1.1rem 1rem 1.2rem; border-radius: 16px; }
  .adh-bloc legend { font-size: 1.5rem; }
  .adh-grille { grid-template-columns: 1fr; }
  .adh-enfant {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "num nom retirer" "num classe retirer";
    align-items: center;
  }
  .adh-enfant__num { grid-area: num; align-self: start; }
  .adh-enfant .adh-champ--large { grid-area: nom; }
  .adh-enfant .adh-champ--classe { grid-area: classe; }
  .adh-retirer { grid-area: retirer; align-self: start; width: 36px; }
  .adh-paiement { padding: 1.2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .adh-enfant.is-nouveau, .adh-merci__icone, .adh-confettis i { animation: none; }
  .adh-bouton, .adh-ajouter, .adh-interrupteur__piste::after { transition: none; }
}
