/* =====================================================================
   Adhérents : formulaire d'adhésion, « Mon adhésion » (site public) et écrans d'administration.
   Public : préfixe adh-   ·   Administration : préfixe adm-m- (et quelques compléments adm-)
   ===================================================================== */

/* ---------- Site public ------------------------------------------------- */
.adh { max-width: 920px; margin-left: auto; margin-right: auto; }
.adh-intro { margin: 0 0 22px; font-size: 15px; line-height: 1.65; }
.adh-intro p { margin: 0 0 10px; }
.adh-intro__links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }

.adh-form { display: grid; gap: 22px; }
.adh-form--compact { gap: 14px; }
.adh-step { background: #fff; border: 1px solid #e3e7ee; border-radius: 6px; box-shadow: var(--cerm-shadow); padding: 20px 22px 22px; min-width: 0; }
.adh-step__title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 19px; font-weight: 600; color: var(--cerm-primary); }
.adh-step__n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cerm-primary); color: #fff; font-size: 15px; font-weight: 700; }
.adh-note { margin: -6px 0 14px; }
.adh-step .req { color: var(--cerm-danger); }
.adh-sub { margin: 4px 0 -4px; font-weight: 600; color: var(--cerm-dark); }
.adh-alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 6px; border-left: 5px solid var(--cerm-danger); background: #fdecee; color: #7a0016; font-weight: 600; }

/* Cartes de choix : formule et mode de règlement */
.adh-plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.adh-methods { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.adh-plan, .adh-method { position: relative; display: block; margin: 0; cursor: pointer; }
.adh-choice { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.adh-plan__box, .adh-method__box { position: relative; display: grid; gap: 3px; height: 100%; padding: 18px 20px 16px; border: 2px solid #d5dbe9; border-radius: 8px; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.adh-plan:hover .adh-plan__box, .adh-method:hover .adh-method__box { border-color: var(--cerm-secondary); }
.adh-plan__name { font-size: 13px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: #6b708a; }
.adh-plan__price { font-size: 36px; line-height: 1.1; font-weight: 700; color: var(--cerm-primary); }
.adh-plan__sub { font-size: 13px; color: #7b8190; }
.adh-plan__tick { position: absolute; top: 12px; right: 14px; font-size: 22px; line-height: 1; color: var(--cerm-success); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.adh-choice:checked + .adh-plan__box, .adh-choice:checked + .adh-method__box { border-color: var(--cerm-primary); background: #f3f4ff; box-shadow: 0 0 0 3px rgba(28, 35, 138, .14); }
.adh-choice:checked + .adh-plan__box .adh-plan__tick, .adh-choice:checked + .adh-method__box .adh-plan__tick { opacity: 1; transform: none; }
.adh-choice:focus-visible + .adh-plan__box, .adh-choice:focus-visible + .adh-method__box { outline: 3px solid var(--cerm-secondary); outline-offset: 2px; }
.adh-method__box { display: flex; align-items: flex-start; gap: 14px; padding: 15px 44px 14px 16px; }
.adh-method__icon { flex: none; font-size: 24px; color: var(--cerm-secondary); margin-top: 2px; }
.adh-method__text { display: grid; gap: 2px; min-width: 0; }
.adh-method__text strong { color: var(--cerm-primary); font-size: 16px; }
.adh-method__text small { color: #7b8190; font-size: 13px; line-height: 1.4; }

/* Total et bouton « Adhérer » */
.adh-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-top: 18px; padding: 18px 22px; border-radius: 8px; background: #f3f4ff; border: 1px solid #d9dcf5; }
.adh-summary__total { display: grid; gap: 0; line-height: 1.25; }
.adh-summary__total span { font-size: 13px; text-transform: uppercase; letter-spacing: 1.4px; color: #6b708a; font-weight: 600; }
.adh-summary__total strong { font-size: 32px; color: var(--cerm-primary); }
.adh-summary__total small { color: #7b8190; }
.cerm-btn.adh-submit { min-height: 56px; padding: 15px 38px; font-size: 16px; letter-spacing: 1.2px; }
.cerm-btn.is-busy { opacity: .65; cursor: progress; }
.adh-reveal { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cerm-dark); cursor: pointer; margin-top: 4px; }
.adh-reveal input { width: 18px; height: 18px; }
.cerm-check.has-error { color: var(--cerm-danger); }

/* Remerciements et « Mon adhésion » */
.adh-done { text-align: left; }
.adh-done__icon { font-size: 56px; color: var(--cerm-success); line-height: 1; margin-bottom: 8px; }
.adh-box { margin: 16px 0; padding: 16px 20px; border-left: 5px solid var(--cerm-secondary); background: #f5f9fd; border-radius: 0 6px 6px 0; }
.adh-box h3 { margin: 0 0 8px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.adh-box p { margin: 0 0 8px; }
.adh-box p:last-child { margin-bottom: 0; }
.adh-ref { display: inline-block; padding: 1px 8px; border-radius: 4px; background: #e8e9fa; color: var(--cerm-primary); letter-spacing: 1px; }
.adh-bank, .adh-address { padding: 10px 14px; margin: 8px 0; background: #fff; border: 1px dashed #b5c4dd; border-radius: 4px; overflow-wrap: anywhere; }
.adh-bank > :last-child { margin-bottom: 0; }
.adh-next h2 { font-size: 18px; margin: 22px 0 8px; }
.adh-next ul { margin: 0 0 18px; padding-left: 20px; }
.adh-next li { margin-bottom: 6px; }
.adh-inline { display: inline-block; margin: 6px 8px 6px 0; }
.adh-inline .cerm-btn { min-height: 44px; white-space: nowrap; }
.cerm-table .adh-inline { margin: 0; }
.cerm-table .adh-inline .cerm-btn { min-height: 38px; padding: 7px 16px; font-size: 11px; }
.adh-card { background: #fff; border: 1px solid #e3e7ee; border-radius: 6px; box-shadow: var(--cerm-shadow); padding: 20px 22px; margin: 0 0 22px; }
.adh-card > h2 { margin: 0 0 14px; font-size: 19px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.adh-card--open { border-left: 5px solid var(--cerm-warning); }
.adh-facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0; }
.adh-fact { margin: 0; padding: 12px 14px; background: #f7f9fd; border-radius: 6px; }
.adh-fact dt { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #7b8190; font-weight: 600; }
.adh-fact dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; color: var(--cerm-primary); overflow-wrap: anywhere; }
.adh-fact dd .cerm-muted { font-size: 13px; font-weight: 400; }
.adh-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 12px 16px; border-radius: 6px; border-left: 5px solid var(--cerm-info); background: #eaf8fd; color: #19445a; font-weight: 400; text-decoration: none; }
a.adh-banner:hover { text-decoration: none; filter: brightness(.97); color: inherit; }
.adh-banner i { font-size: 22px; flex: none; }
.adh-banner strong { font-weight: 700; }
.adh-banner--warn { border-color: var(--cerm-warning); background: #fff7e0; color: #5c4200; }
.adh-banner--ko { border-color: var(--cerm-danger); background: #fdecee; color: #7a0016; }
.adh-banner--ok { border-color: var(--cerm-success); background: #e6f6ea; color: #0b4d1c; }
.adh-logged .adh-submit { display: inline-block; }
@media (max-width: 575.98px) {
  .adh-step, .adh-card { padding: 16px 14px 18px; }
  .adh-summary { flex-direction: column; align-items: stretch; text-align: center; padding: 16px 14px; }
  .cerm-btn.adh-submit { width: 100%; padding-left: 16px; padding-right: 16px; }
  .adh-plan__price { font-size: 32px; }
  .adh-inline, .adh-inline .cerm-btn { display: block; width: 100%; }
}

/* ---------- Administration ---------------------------------------------- */
.adm-formbar--inline { position: static; margin: 4px 0 0; padding: 0; background: transparent; border: 0; backdrop-filter: none; justify-content: flex-start; gap: 14px; }
.adm-inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.adm-inline-form select { min-height: 32px; padding: 2px 8px; border: 1px solid #c3cbdc; border-radius: 5px; background: #fff; font: inherit; font-size: 13px; }
.adm-m-split { display: grid; gap: 20px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.adm-m-split > * { min-width: 0; }
.adm-m-split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 991.98px) { .adm-m-split, .adm-m-split--even { grid-template-columns: minmax(0, 1fr); } .adm-m-split--flip > :nth-child(2) { order: -1; } }
.adm-m-facts { display: grid; gap: 10px 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 14px; }
.adm-m-fact { margin: 0; padding: 10px 12px; background: #f5f7fc; border-radius: 6px; }
.adm-m-fact dt { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: #8b92a8; font-weight: 700; }
.adm-m-fact dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; color: var(--cerm-primary); overflow-wrap: anywhere; }
.adm-m-flushhead { padding: 18px 22px 0; }
.adm-m-cell { display: block; min-width: 0; }
.adm-m-sub { display: block; font-size: 12.5px; color: #7b8190; font-weight: 400; }
.adm-m-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-m-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-m-actions form { margin: 0; }
.adm-table .adm-m-actions { justify-content: flex-end; }
.adm-m-block { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e0e5ef; border-radius: 6px; background: #fafbfe; }
.adm-m-block h3 { margin: 0 0 8px; font-size: 15px; }
.adm-m-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.adm-m-total { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: baseline; padding: 14px 18px; background: #f3f4ff; border-bottom: 1px solid #e0e5ef; }
.adm-m-total strong { font-size: 24px; color: var(--cerm-primary); }
.adm-m-total span { color: #6b708a; font-size: 14px; }
.adm-m-history { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.adm-m-history li { padding: 6px 0; border-bottom: 1px solid #edf0f6; }
.adm-m-history li:last-child { border-bottom: 0; }
.adm-m-history time { color: #7b8190; margin-right: 6px; }
@media (max-width: 767.98px) {
  .adm-table--stack td .adm-inline-form { justify-content: flex-end; }
  .adm-m-num { text-align: right; }
  .adm-table--stack td > .adm-m-cell { text-align: right; }
}

.adm-table td[data-label="Date"] { white-space: nowrap; }

/* Tablettes : les tableaux de cette rubrique (nombreuses colonnes et boutons) s'empilent aussi entre 768 et 991 px, sans défilement horizontal. */
@media (min-width: 768px) and (max-width: 991.98px) {
  .adm-table--stack-md thead { display: none; }
  .adm-table--stack-md, .adm-table--stack-md tbody, .adm-table--stack-md tr, .adm-table--stack-md td { display: block; width: 100%; }
  .adm-table--stack-md tr { border-bottom: 8px solid #f3f5fa; padding: 8px 0; }
  .adm-table--stack-md td { border: 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 6px 14px; text-align: right; }
  .adm-table--stack-md td::before { content: attr(data-label); font-weight: 600; color: var(--cerm-primary); text-align: left; flex: none; }
  .adm-table--stack-md td.adm-actions { justify-content: flex-end; flex-wrap: wrap; }
  .adm-table--stack-md td.adm-actions::before { content: none; }
  .adm-table--stack-md td > .adm-m-cell { text-align: right; }
  /* Barre « Trier par » à la place des en-têtes masqués (même présentation que admin.css sur téléphone) */
  .adm-table--stack-md.is-sortable thead { display: block; }
  .adm-table--stack-md.is-sortable thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 8px solid #f3f5fa; }
  .adm-table--stack-md.is-sortable thead tr::before { content: 'Trier par :'; font-weight: 600; color: var(--cerm-primary); margin-right: 2px; }
  .adm-table--stack-md.is-sortable thead th { display: none; }
  .adm-table--stack-md.is-sortable thead th.adm-th-sort { display: block; padding: 0; background: #fff; border: 1px solid #d5dbe9; border-radius: 999px; }
  .adm-table--stack-md.is-sortable thead th.adm-th-sort.is-sorted { background: #e9eef8; border-color: var(--cerm-primary); }
  .adm-table--stack-md.is-sortable .adm-sort { padding: 8px 14px; border-radius: 999px; }
}

/* Écrans moyens (992 à 1279 px) : colonnes secondaires des listes masquées (l'e-mail passe sous le nom), pour éviter le défilement horizontal. */
.adm-m-sub--md { display: none; }
@media (min-width: 992px) and (max-width: 1279.98px) {
  .adm-table .adm-m-col-lg { display: none; }
  .adm-table .adm-m-sub--md { display: block; }
  .adm-table--stack-md th, .adm-table--stack-md td { padding-left: 8px; padding-right: 8px; }
}

/* État comptable Stripe */
.adm-m-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.adm-m-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: #f3f4ff; }
.adm-m-kpi > span { color: #6b708a; font-size: 13px; }
.adm-m-kpi > strong { font-size: 22px; line-height: 1.2; color: var(--cerm-primary); }
.adm-m-kpi > small { color: #6b708a; font-size: 12.5px; }
.adm-m-kpi--main { background: var(--cerm-primary); }
.adm-m-kpi--main > span, .adm-m-kpi--main > small { color: rgba(255, 255, 255, .82); }
.adm-m-kpi--main > strong { color: #fff; }
.adm-m-neg { color: #8a1c1c; }
.adm-m-pos { color: #1c238a; }
.adm-m-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.adm-m-presets .is-current { background: var(--cerm-primary); color: #fff; border-color: var(--cerm-primary); }
