/* ==============================================
   NTF WALLONIE - Calculateur de cotisation 2026
   Scoped under .aff-* / .aff-page
   Tokens & resets are inherited from theme.css
   ============================================== */

/* ── PAGE ─────────────────────────────────────── */
.aff-page {
  background: var(--surface);
  color: var(--on-surface);
  padding: calc(65px + 1rem) var(--container-gutter) 3.5rem;
}

.aff-page__inner {
  max-width: 1220px;
  margin: 0 auto;
}

@media (min-width: 960px) {
  .aff-page {
    padding-top: calc(137px + 1.25rem);
  }
}

@media (max-width: 700px) {
  .aff-page {
    padding: calc(65px + 1rem) var(--container-gutter) 3rem;
  }
}

/* ENG-284 - page précédée du hero standard .qsn-hero.
   Le hero dégage lui-même la navbar (margin-top: --hero-nav-clear) : garder en
   plus le padding-top de .aff-page ouvrirait un trou de la hauteur de la
   navbar entre la bande verte et le contenu. Déclaré APRÈS les media queries
   ci-dessus, sinon celle de 960px le remettrait. */
.aff-page--sous-hero { padding-top: 2.5rem; }

@media (max-width: 700px) {
  .aff-page--sous-hero { padding-top: 2rem; }
}

/* ── HERO ─────────────────────────────────────── */
.aff-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.aff-hero__copy { max-width: 820px; }

/* CTA aligné à droite du titre (bulletin) - renvoie au formulaire */
.aff-hero__cta { flex-shrink: 0; white-space: nowrap; }

/* Groupe de CTA : sans ce conteneur, `space-between` du héros écarte les deux
   boutons aux extrémités au lieu de les garder ensemble (ENG-321). */
.aff-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.aff-hero .eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.aff-hero h1 {
  color: var(--primary);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 0.6rem;
}

/* Titre du tableau de calcul (déplacé du héro - Feedback 9) : un cran sous le h1. */
.aff-hero h2 {
  color: var(--primary);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  margin-bottom: 0.6rem;
}
.aff-hero--calc { margin-top: 2.5rem; }

/* Mobile : aligne la taille du titre sur les autres pages (plancher 2rem). */
@media (max-width: 768px) {
  .aff-hero h1 { font-size: var(--page-title-size-mobile); }
}

.aff-hero p:not(.eyebrow) {
  max-width: 65ch;
  color: var(--on-surface-muted);
  font-size: 0.95rem;
}

/* ── WORKSPACE ────────────────────────────────── */
.aff-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 1.5rem;
  align-items: start;
}

.aff-form-panel,
.aff-result-panel {
  border-radius: 0.75rem;
  background: var(--surface-lowest);
  box-shadow: 0 18px 42px var(--outline-ghost);
}

.aff-form-panel { padding: 1.35rem; }

.aff-result-panel {
  overflow: hidden;
  position: sticky;
  top: 1rem;
}

/* ── PANEL HEADING ────────────────────────────── */
.aff-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.aff-panel-heading h2 {
  color: var(--primary);
  font-size: 1.3rem;
}

/* ── SECTIONS ─────────────────────────────────── */
.aff-section { margin-bottom: 1.2rem; }
.aff-section:last-child { margin-bottom: 0; }

.aff-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin-bottom: 0.55rem;
}

.aff-section__title .material-symbols-outlined {
  font-size: 16px;
  color: var(--secondary);
}

/* ── RADIO CARDS (profil) ─────────────────────── */
.aff-radios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.aff-radio {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.7rem;
  background: var(--surface-low);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  box-shadow: inset 0 0 0 1px var(--surface-high);
}

.aff-radio:hover { background: var(--surface-high); }

.aff-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aff-radio .material-symbols-outlined {
  font-size: 19px;
  color: var(--secondary);
}

.aff-radio__title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.25;
}

.aff-radio__hint {
  font-size: 0.72rem;
  color: var(--on-surface-muted);
  line-height: 1.35;
}

.aff-radio.is-active {
  background: rgba(152, 194, 123, 0.18);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.aff-radio.is-active .material-symbols-outlined { color: var(--primary); }

.aff-radio:focus-within {
  outline: 3px solid var(--primary-pale);
  outline-offset: 2px;
}

/* ── SEGMENTED CONTROLS ───────────────────────── */
.aff-segmented {
  display: inline-flex;
  background: var(--surface-low);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: inset 0 0 0 1px var(--surface-high);
  width: 100%;
}

.aff-segmented__btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--on-surface-muted);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}

.aff-segmented__btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(23, 57, 1, 0.25);
}

.aff-segmented__btn:focus-visible {
  outline: 2px solid var(--primary-pale);
  outline-offset: 2px;
}

.aff-segmented__btn small {
  opacity: 0.7;
  font-weight: 600;
}

.aff-segmented--block {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
}

/* ── PARCELLES (multi-row properties) ──────────── */
.aff-parcelle + .aff-parcelle {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
/* ENG-293 : titres « Propriete N » retires. Le head ne porte plus que la croix
   de suppression, alignee a droite. Une seule parcelle : la croix est masquee,
   le head se replie a ~0 (le bouton en display:none ne prend pas de hauteur). */
.aff-parcelle__head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}
.aff-parcelle__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-muted);
}
.aff-parcelle__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--on-surface-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.aff-parcelle__remove .material-symbols-outlined { font-size: 16px; }
.aff-parcelle__remove:hover {
  background: var(--danger, #c0392b);
  color: #fff;
}
.aff-add-parcelle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.65rem;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.aff-add-parcelle .material-symbols-outlined { font-size: 18px; }
/* Même raison que .aff-commune-remove[hidden] : le display de la règle
   ci-dessus battrait celui du navigateur, et le bouton resterait visible une
   fois le plafond de bénéficiaires atteint (ENG-312). */
.aff-add-parcelle[hidden] { display: none; }
.aff-add-parcelle:hover {
  background: var(--primary-pale);
  border-color: var(--primary);
}

/* ── FIELDS / INPUTS ──────────────────────────── */
.aff-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ENG-293 : Civilite devant Nom/Prenom, et adresse = code postal court +
   localite + pays. La 1re colonne (civilite ou code postal) est volontairement
   etroite. Repli en une colonne sous 760px (voir plus bas). */
.aff-field-row--civ { grid-template-columns: minmax(5rem, 0.5fr) 1fr 1fr; }
.aff-field-row--adr { grid-template-columns: minmax(5rem, 0.5fr) 1.4fr 1fr; }
.aff-input-wrap select {
  border: 0;
  background: transparent;
  color: var(--on-surface);
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  appearance: none;
}
.aff-input-wrap select:focus { outline: none; }

.aff-field { display: grid; gap: 0.4rem; }

.aff-field label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.aff-field label .material-symbols-outlined {
  font-size: 16px;
  color: var(--secondary);
}

.aff-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--surface-high);
  border-radius: 0.65rem;
  padding-right: 0.75rem;
}

.aff-input-wrap input {
  border: 0;
  background: transparent;
  color: var(--on-surface);
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
  width: 100%;
  min-width: 0;
}

.aff-input-wrap input:focus { outline: none; }

.aff-input-wrap:focus-within {
  background: var(--surface-low);
  outline: 3px solid var(--primary-pale);
}

.aff-input-wrap span {
  color: var(--on-surface-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── TOGGLE (New Gen) ─────────────────────────── */
.aff-toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0.95rem;
  border-radius: 0.7rem;
  background: var(--surface-low);
  transition: background 0.2s;
  cursor: pointer;
}

.aff-toggle-row.is-on { background: rgba(152, 194, 123, 0.15); }

.aff-toggle-row__copy strong {
  font-size: 0.86rem;
  color: var(--on-surface);
  display: block;
  margin-bottom: 0.1rem;
}

.aff-toggle-row__copy span {
  font-size: 0.74rem;
  color: var(--on-surface-muted);
}

.aff-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.aff-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.aff-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--surface-highest);
  border-radius: 999px;
  transition: background 0.2s;
}

.aff-toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease-out);
  box-shadow: 0 2px 4px rgba(29, 28, 23, 0.15);
}

.aff-toggle input:checked + .aff-toggle__slider { background: var(--primary); }
.aff-toggle input:checked + .aff-toggle__slider::before { transform: translateX(20px); }

.aff-toggle input:focus-visible + .aff-toggle__slider {
  outline: 2px solid var(--primary-pale);
  outline-offset: 2px;
}

/* ── REVEAL BLOCKS (conditional sections) ─────── */
.aff-reveal {
  display: none;
  margin-top: 1.25rem;
}

.aff-reveal.is-shown { display: block; }

/* ── ASSO PANEL (Sur devis) ───────────────────── */
.aff-asso {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--surface-low);
  margin-top: 1rem;
  text-align: center;
}

.aff-asso .material-symbols-outlined {
  font-size: 36px;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.aff-asso h3 {
  color: var(--primary);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.aff-asso p {
  color: var(--on-surface-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.aff-asso__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  transition: background 0.2s;
}

.aff-asso__cta:hover { background: var(--primary-mid); }

/* ── SRFB / Landelijk Vlaanderen info (permanent) ── */
.aff-srfb-stack {
  display: grid;
  gap: 0.6rem;
  margin: 0.85rem 0 1.25rem;
}

.aff-srfb-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px var(--surface-high);
}

.aff-srfb-info > .material-symbols-outlined {
  font-size: 18px;
  color: var(--secondary);
  margin-top: 0.1rem;
}

.aff-srfb-info__body h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.35rem;
}

.aff-srfb-info__body p {
  font-size: 0.8rem;
  color: var(--on-surface);
  line-height: 1.5;
  margin: 0 0 0.35rem;
}

.aff-srfb-info__body p:last-of-type { margin-bottom: 0.5rem; }

.aff-srfb-info__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aff-srfb-info__link .material-symbols-outlined { font-size: 16px; }
.aff-srfb-info__link:hover { color: var(--primary-mid); }

/* ── RESULT TOTAL ─────────────────────────────── */
.aff-total {
  background: var(--primary);
  color: #fff;
  padding: 1.85rem 1.6rem 1.5rem;
}

.aff-total__label {
  color: var(--tertiary-fixed);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.aff-total__amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.aff-total__amount sup {
  font-size: 1rem;
  font-weight: 600;
  margin-left: 0.4rem;
  opacity: 0.85;
}

.aff-total__suffix {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.86rem;
  margin-top: 0.4rem;
}

.aff-total__capped {
  display: none;
  margin-top: 0.85rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 221, 179, 0.15);
  border-radius: 0.5rem;
  color: var(--tertiary-fixed);
  font-size: 0.78rem;
  font-weight: 600;
}

.aff-total__capped.is-shown {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aff-total__capped .material-symbols-outlined { font-size: 16px; }

/* ── RESULT BREAKDOWN ─────────────────────────── */
.aff-breakdown {
  padding: 1.4rem 1.6rem 1.6rem;
  background: var(--surface-lowest);
}

.aff-breakdown h3 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin-bottom: 0.85rem;
}

.aff-breakdown__list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  padding: 0;
}

.aff-breakdown__list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--surface-high);
  font-size: 0.92rem;
}

.aff-breakdown__list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.aff-breakdown__list li .label {
  color: var(--on-surface);
  display: flex;
  flex-direction: column;
}

.aff-breakdown__list li .label small {
  color: var(--on-surface-muted);
  font-size: 0.74rem;
  margin-top: 0.1rem;
}

.aff-breakdown__list li .amount {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aff-breakdown__list li.is-deduction .amount { color: var(--secondary); }
.aff-breakdown__list li.is-empty .amount { color: var(--on-surface-muted); }

/* ── CTAs ─────────────────────────────────────── */
.aff-cta {
  display: grid;
  gap: 0.5rem;
}

.aff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

/* ENG-321 : ces boutons vivaient en pilule (999px) et 22 % plus gros que le
   reste du site. On reprend les valeurs de .btn--nav (theme.css:296-303) pour
   que le parcours d'affiliation ne détonne plus avec le reste de la nav. */
.aff-btn--primary {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Comme .aff-btn--secondary : le survol fonce, alignement sur `.btn--nav`.
   Le fond et le survol etaient intervertis par rapport a la nav (fond
   --primary qui s'eclaircissait en --primary-mid). */
.aff-btn--primary:hover {
  background: #004d21;
  transform: translateY(-1px);
}

.aff-btn--ghost {
  background: transparent;
  color: var(--secondary);
  padding: 0.6rem 1.3rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  box-shadow: inset 0 0 0 1px var(--surface-high);
}

.aff-btn--ghost:hover { background: var(--surface-low); }

/* Bouton plein orange : le lien vers la grille tarifaire PDF (ENG-321).
   En variante fantome il se lisait a peine a cote du bouton vert plein, et
   `space-between` l'envoyait a l'oppose du heros. Il se colle donc au CTA
   principal (voir .aff-hero__actions) et porte un aplat de couleur. */
.aff-btn--secondary {
  background: var(--secondary);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Hover aligné sur le bouton orange de la barre de navigation
   (`.btn--nav-alt`, theme.css) : il fonce, il ne s'éclaircit pas. Les deux
   boutons partagent déjà fond, padding, taille et rayon — seul le sens du
   survol divergeait. */
.aff-btn--secondary:hover {
  background: #6e4229;
  transform: translateY(-1px);
}

/* ── INFO GRID (footer cards) ─────────────────── */
.aff-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.aff-info-card {
  background: var(--surface-lowest);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 12px 30px var(--outline-ghost);
}

.aff-info-card .material-symbols-outlined {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 0.65rem;
}

.aff-info-card h3 {
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.aff-info-card p {
  color: var(--on-surface-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.aff-info-card strong { color: var(--on-surface); }

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 940px) {
  .aff-workspace { grid-template-columns: 1fr; }
  .aff-result-panel {
    position: relative;
    top: auto;
  }
  .aff-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .aff-radios { grid-template-columns: 1fr; }
  .aff-field-row,
  .aff-field-row--civ,
  .aff-field-row--adr { grid-template-columns: 1fr; }
  .aff-segmented--block {
    grid-template-columns: 1fr;
    border-radius: 0.75rem;
    padding: 0.3rem;
    gap: 0.25rem;
  }
  .aff-segmented--block .aff-segmented__btn {
    padding: 0.85rem;
    border-radius: 0.5rem;
  }
}

/* ============================================
   BULLETIN FORM (page-demo_bulletin.php)
   ============================================ */

.aff-bulletin-form {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.aff-bulletin-form .aff-form-panel {
  padding: 1.75rem;
}

.aff-bulletin-form .aff-panel-heading {
  margin-bottom: 1.4rem;
}

.aff-bulletin-form .aff-panel-heading h2 {
  font-size: 1.4rem;
}

.aff-bulletin-form .aff-panel-heading .eyebrow {
  display: block;
  margin-bottom: 0.3rem;
}

.aff-section-intro {
  color: var(--on-surface-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 65ch;
  margin: -0.4rem 0 1.1rem;
}

.aff-section-hint {
  color: var(--on-surface-muted);
  font-size: 0.82rem;
  margin: 0.6rem 0 0;
}

.aff-section-hint strong { color: var(--on-surface); }

.aff-req {
  color: var(--secondary);
  font-weight: 700;
  margin-left: 0.15rem;
}

.aff-prefix {
  color: var(--on-surface-muted);
  font-weight: 700;
  font-size: 0.86rem;
  padding-left: 0.95rem;
  letter-spacing: 0.04em;
}

.aff-bulletin-form .aff-input-wrap input[type="text"],
.aff-bulletin-form .aff-input-wrap input[type="email"],
.aff-bulletin-form .aff-input-wrap input[type="tel"],
.aff-bulletin-form .aff-input-wrap input[type="number"] {
  padding: 0.9rem 0.95rem;
  font-size: 0.95rem;
}

.aff-bulletin-form .aff-input-wrap:has(.aff-prefix) {
  grid-template-columns: auto 1fr;
  padding-right: 0;
}

.aff-bulletin-form .aff-input-wrap:has(.aff-prefix) input {
  padding-left: 0.4rem;
}

/* Radios 2-col (cotisation) */
.aff-radios--two { grid-template-columns: 1fr 1fr; }

/* Communes table */
.aff-communes {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

/* ENG-312 - Beneficiaires New Gen.
   Le bloc reprend l'habillage des lignes de communes (fond, coin arrondi,
   filet interieur) pour que le formulaire garde un seul vocabulaire visuel. */
.aff-newgen-details {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
/* Une regle d'auteur bat celle du navigateur sur [hidden] : sans ce rappel, le
   display:flex ci-dessus laisserait le bloc visible alors que le JS le masque. */
.aff-newgen-details[hidden] { display: none; }
.aff-newgen-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.aff-newgen-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px var(--surface-high);
}
.aff-newgen-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.aff-newgen-row__num {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--on-surface-muted);
}
.aff-newgen-row .aff-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-muted);
}

.aff-commune-row {
  display: grid;
  /* ENG-284 : 4e piste pour le bouton de suppression. auto et non 1fr, pour
     que la ligne garde exactement la même largeur de champs quand le bouton
     est masqué (première ligne, jamais supprimable). */
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: end;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px var(--surface-high);
}

.aff-commune-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.15rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--on-surface-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

/* `display: inline-flex` ci-dessus l'emporte sur le display:none que le
   navigateur applique à [hidden] : sans cette règle, le bouton de la première
   ligne (jamais supprimable) resterait visible malgré son attribut hidden. */
.aff-commune-remove[hidden] { display: none; }

.aff-commune-remove:hover {
  background: var(--danger, #c0392b);
  color: #fff;
}

.aff-commune-row .aff-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-surface-muted);
}

.aff-commune-row .aff-input-wrap {
  background: var(--surface-lowest);
}

.aff-total-ha {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.95rem 1.1rem;
  border-radius: 0.75rem;
  background: rgba(152, 194, 123, 0.18);
  box-shadow: inset 0 0 0 1.5px var(--primary);
  font-size: 0.92rem;
  color: var(--on-surface);
  margin: 0;
}

.aff-total-ha span:first-child {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.aff-total-ha strong {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

/* IBAN display field */
.aff-iban {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  padding: 0.9rem 0.95rem;
  background: var(--surface-low);
  box-shadow: inset 0 0 0 1px var(--surface-high);
  border-radius: 0.75rem;
  color: var(--on-surface);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  min-height: 3rem;
}

/* Checklist (multi-checkbox panel) */
.aff-checks {
  display: grid;
  gap: 0.65rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.aff-checks > .aff-section__title {
  margin-bottom: 0.35rem;
}

/* Centres d'intérêt (ENG-129) : 3 colonnes desktop, 2 tablette, 1 mobile.
   Grille (et non CSS columns) pour garder l'ordre de tabulation naturel. */
.aff-checks--columns {
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1rem;
}
.aff-checks--columns > .aff-section__title,
.aff-checks--columns > .aff-section-intro {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .aff-checks--columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .aff-checks--columns { grid-template-columns: 1fr; }
}

.aff-check {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.95rem 1.1rem;
  border-radius: 0.75rem;
  background: var(--surface-low);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  box-shadow: inset 0 0 0 1px var(--surface-high);
}

.aff-check:hover { background: var(--surface-high); }

.aff-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aff-check__box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-lowest);
  box-shadow: inset 0 0 0 1.5px var(--surface-highest);
  position: relative;
  transition: background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.aff-check input:checked ~ .aff-check__box,
.aff-check input:checked + .aff-check__box,
.aff-consent input:checked ~ .aff-check__box,
.aff-consent input:checked + .aff-check__box {
  background: var(--primary);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.aff-check input:checked ~ .aff-check__box::after,
.aff-check input:checked + .aff-check__box::after,
.aff-consent input:checked ~ .aff-check__box::after,
.aff-consent input:checked + .aff-check__box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 14px no-repeat;
  pointer-events: none;
}

.aff-check:has(input:checked) {
  background: rgba(152, 194, 123, 0.18);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.aff-check:focus-within {
  outline: 3px solid var(--primary-pale);
  outline-offset: 2px;
}

.aff-check__text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.35;
}

.aff-check__text small {
  display: block;
  font-size: 0.78rem;
  color: var(--on-surface-muted);
  margin-top: 0.2rem;
  line-height: 1.45;
}

/* RGPD consent block */
.aff-form-panel--submit {
  background: var(--surface-low);
  padding: 1.5rem 1.75rem;
}

.aff-consent {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.aff-consent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aff-consent__text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--on-surface);
}

.aff-consent__text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aff-consent:focus-within { outline: none; }

/* ENG-321 : le bouton d'envoi était collé au bord droit du panneau, détaché du
   texte d'engagement qu'il valide. Aligné à gauche, il suit la phrase « Par mon
   affiliation… » et se lit comme sa conclusion. */
.aff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-start;
}

/* ENG-321 : sans ça, le bouton d'envoi gardait sa taille XL et ignorait
   l'alignement ci-dessus — c'est cette règle qui le rendait « méga grand ». */
.aff-actions .aff-btn--primary {
  padding: 0.6rem 1.3rem;
  font-size: 0.72rem;
}

/* Honeypot anti-spam - jamais visible, jamais atteint au clavier */
.aff-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Bandeau d'erreur (rendu serveur PRG + retour fetch REST) */
.aff-feedback {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.aff-feedback--error {
  background: rgba(200, 60, 60, 0.1);
  border: 1px solid rgba(200, 60, 60, 0.35);
  color: #a02323;
}

/* Thank you panel */
.aff-thanks {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 3.5rem 2rem 3rem;
  background: radial-gradient(ellipse at top, rgba(152, 194, 123, 0.35), transparent 60%), linear-gradient(160deg, var(--primary), #0e2701);
  color: #fff;
  border-radius: 1rem;
  box-shadow: 0 30px 70px var(--outline-ghost);
  margin: 1.5rem 0 2.5rem;
  overflow: hidden;
  scroll-margin-top: calc(137px + 1.5rem);
}

@media (max-width: 960px) {
  .aff-thanks { scroll-margin-top: calc(65px + 1rem); }
}

.aff-thanks[hidden] { display: none; }

.aff-thanks::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><circle cx='100' cy='100' r='80' fill='none' stroke='white' stroke-width='1' opacity='0.06'/><circle cx='100' cy='100' r='50' fill='none' stroke='white' stroke-width='1' opacity='0.1'/></svg>") center / 70% no-repeat;
  pointer-events: none;
}

.aff-thanks > * { position: relative; }

.aff-thanks__icon {
  font-size: 78px !important;
  color: var(--tertiary-fixed, #ffd9a1) !important;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 4px 12px rgba(255, 217, 161, 0.4));
}

.aff-thanks h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.65rem;
}

.aff-thanks p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  max-width: 55ch;
  margin: 0 auto 0.75rem;
  line-height: 1.6;
}

.aff-thanks__contact a {
  color: var(--tertiary-fixed, #ffd9a1);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.aff-thanks__actions {
  margin-top: 1.4rem;
}

.aff-thanks .aff-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.aff-thanks .aff-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* ── Recap after payment ─────────────────────────────────── */

.aff-thanks__recap {
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

.aff-recap-list {
  display: grid;
  gap: 0.5rem;
}

.aff-recap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.aff-recap-row:last-child { border-bottom: none; }

.aff-recap-row dt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.aff-recap-row dd {
  font-weight: 600;
  text-align: right;
}

.aff-recap-row--total {
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: none;
}

.aff-recap-row--total dd {
  font-size: 1.2rem;
  color: #fff;
}

/* ── Next steps ──────────────────────────────────────────── */

.aff-thanks__steps {
  margin: 1.5rem 0;
  text-align: left;
}

.aff-thanks__steps h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

.aff-thanks__steps ol {
  list-style: none;
  counter-reset: steps;
  display: grid;
  gap: 0.75rem;
  padding: 0;
}

.aff-thanks__steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.aff-thanks__steps li .material-symbols-outlined {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  margin-top: 0.1em;
}

/* Reveal panels visible by default for sections that toggle */
.aff-form-panel.aff-reveal { display: none; }
.aff-form-panel.aff-reveal.is-shown { display: block; }

/* Responsive */
@media (max-width: 700px) {
  .aff-commune-row { grid-template-columns: 1fr; }
  /* Empilé, le bouton de suppression prendrait toute la largeur : on le
     ramène à droite, aligné sur le bord du dernier champ. */
  .aff-commune-remove { justify-self: end; margin-top: 0.25rem; }
  .aff-radios--two { grid-template-columns: 1fr; }
  .aff-bulletin-form .aff-form-panel { padding: 1.25rem; }
  .aff-form-panel--submit { padding: 1.25rem; }
  .aff-actions { justify-content: stretch; }
  .aff-actions .aff-btn--primary { width: 100%; }
}

/* ══════════════════════════════════════════════════════
   AVANTAGES SECTION
══════════════════════════════════════════════════════ */
.aff-avantages {
  padding: 3.5rem 0 2rem;
}
.aff-avantages__head {
  margin-bottom: 2rem;
}
.aff-avantages__head .eyebrow {
  color: var(--secondary);
}
.aff-avantages__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--primary);
  margin: 0.3rem 0 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.aff-avantages__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.aff-avantage-card {
  background: var(--surface-lowest);
  border: 1px solid var(--surface-highest);
  border-radius: 1.4rem;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform .35s ease, box-shadow .35s ease;
}
.aff-avantage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -16px rgba(0,102,44,0.18);
}
.aff-avantage-card__icon {
  font-size: 1.6rem;
  color: var(--primary);
}
.aff-avantage-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}
.aff-avantage-card__body {
  font-size: 0.82rem;
  color: var(--on-surface-muted);
  line-height: 1.6;
  margin: 0;
}
@media (max-width: 900px) {
  .aff-avantages__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .aff-avantages__grid { grid-template-columns: 1fr; }
}
/* 901-1220px : les 6 cartes sur une ligne débordent du conteneur (la
   dernière sortait du contenu jusqu'à ~1220px) - deux lignes de trois. */
@media (min-width: 901px) and (max-width: 1220px) {
  .aff-avantages__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ══════════════════════════════════════════════════════
   FAQ SEO SECTION
══════════════════════════════════════════════════════ */
.aff-faq {
  padding: 3.5rem 0;
  border-top: 1px solid var(--surface-high);
  margin-top: 2rem;
}
.aff-faq__head {
  margin-bottom: 2rem;
}
.aff-faq__head .eyebrow {
  color: var(--secondary);
}
.aff-faq__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 600;
  color: var(--primary);
  margin: 0.3rem 0 0;
  letter-spacing: -0.02em;
}
.aff-faq__list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--surface-high);
}
.aff-faq__item {
  border-bottom: 1px solid var(--surface-high);
}
.aff-faq__q button {
  all: unset;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  line-height: 1.4;
}
.aff-faq__q button:hover { color: var(--primary); }
.aff-faq__chevron {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.2s;
}
.aff-faq__q button[aria-expanded="true"] .aff-faq__chevron {
  transform: rotate(180deg);
}
.aff-faq__a {
  display: none;
  padding: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--on-surface-muted);
  line-height: 1.7;
  margin: 0;
}
.aff-faq__a.is-open { display: block; }
