/* =========================================================================
   ABO — Feuille de style
   Phase 1, lot 0. Voir 06-Plan-Phase1-Prototype.md

   VERSION 2 — passage d'un rendu « prototype » à un rendu production.
   Ce qui a changé, et pourquoi :

   · TYPOGRAPHIE. Le prototype fourni utilisait la police système — le
     marqueur numéro un d'une maquette.
     On RESPECTE la typo de marque : Futura et Gotham. Mais les fichiers
     présents dans le dépôt (WanV2/wwwroot/fonts) ne contiennent que deux
     graisses par famille — light et bold, rien entre les deux — ce qui ne
     suffit pas à hiérarchiser une interface.
     Décision : substituts libres, pour avoir toute la gamme sans licence.
       — Jost pour l'interface et les titres. Géométrique dessinée d'après
         Futura, gratuite, graisses 100 à 900. À l'œil, la marque est tenue.
       — IBM Plex Serif pour les passages qu'on lit vraiment. Déjà dans la
         charte, déjà libre : rien à arbitrer.
     Playfair Display et Darker Grotesque sont abandonnées : cinq familles,
     ce n'est pas une charte, c'est de la sédimentation.

   · NEUTRES. Les gris du prototype étaient parfaitement neutres, ce qui
     jure avec un orange chaud. Toute la gamme est réchauffée.

   · ÉLÉVATION. Le prototype n'avait aucune ombre : tout reposait sur des
     bordures, ce qui est le marqueur le plus net d'une maquette. On
     introduit trois niveaux, discrets et teintés chaud — jamais du noir pur.

   · MOUVEMENT. Transitions sur tout ce qui est interactif, et respect de
     prefers-reduced-motion.

   · ORANGE. #F97316 est la cible validée par le plan d'action. Le site en
     production utilise aujourd'hui #EB780B — l'écart est volontaire.

   · CONTRASTE. Toute la palette est passée au crible. Le bouton principal
     porte du texte NOIR et non blanc : 6,24:1 au lieu de 2,80:1, seuil AA
     à 4,5. Le défaut était préexistant — les trois oranges en circulation
     (#F97316, #EF7E24, #EB780B) échouent tous avec du texte blanc.
     Quatre autres corrections : les deux niveaux de texte secondaire
     assombris, le glyphe des alertes jaune et verte, la pastille résiliée.
     Le bouton destructif garde son texte blanc : sur le rouge il donne
     5,32:1, il n'a pas de problème.

   RÈGLE INCHANGÉE : aucun écran ne redéclare une couleur, une taille ou un
   rayon. Tout passe par les tokens ci-dessous.
   ========================================================================= */

/* =========================================================================
   1. TOKENS
   ========================================================================= */

:root {
  /* --- Marque ---------------------------------------------------------- */
  --brand:            #F97316;
  --brand-hover:      #EA6C0A;
  --brand-active:     #D9600A;
  --brand-dark:       #A34A0A;   /* texte de marque — 5,0:1 sur le tint, 6,2:1 sur blanc */
  --brand-soft:       #FFE9D6;   /* tint des états sélectionnés — assez dense pour se voir */
  --brand-softer:     #FFF4EA;   /* tint très pâle, grands aplats seulement */
  --brand-line:       #FCD9B6;

  /* --- Surface sombre ----------------------------------------------------
     La seconde « couleur » du système n'est pas une teinte, c'est une
     valeur. Un bloc sombre crée le contraste qui manquait sans faire entrer
     de couleur concurrente — et l'orange ressort plus fort sur du sombre
     que sur du blanc. Réservé à ce qu'on veut détacher : l'offre mise en
     avant. Cohabite aussi mieux avec de la photo qu'une seconde teinte. */
  --ink-surface:      #232020;   /* blanc 16,2:1 · orange vif 5,8:1 */
  --ink-surface-2:    #2E2A27;
  --line-dark:        #3D3835;
  --on-dark:          #F5F3F1;   /* texte principal sur sombre — 14,6:1 */
  --on-dark-2:        #C7C1BC;   /* texte courant sur sombre — 9,1:1 */
  --on-dark-3:        #A8A29E;   /* mentions sur sombre — 6,4:1 */

  /* --- Neutres chauds ---------------------------------------------------
     Gamme biaisée vers le chaud pour tenir avec l'orange. Un gris neutre
     à côté d'un orange saturé donne toujours l'impression d'un défaut. */
  --ink:              #1C1917;
  --ink-2:            #44403C;
  --ink-3:            #5F5854;   /* libellés, texte secondaire — 6,6:1 */
  --ink-4:            #6F6862;   /* mentions, notes — 5,2:1 */
  --ink-5:            #C7C1BC;   /* texte indicatif et champs inactifs UNIQUEMENT :
                                    exemptés de contraste par WCAG 1.4.3 */

  --line:             #E0DCD8;   /* bordure de champ */
  --line-2:           #EAE7E4;   /* bordure de carte */
  --line-3:           #F2F0EE;   /* séparateur */
  --line-4:           #F7F5F4;   /* séparateur discret */

  --bg:               #FAF9F8;
  --surface:          #FFFFFF;
  --surface-2:        #FBFAF9;
  --surface-3:        #F5F3F1;   /* survol */

  /* --- Couleurs de sens -------------------------------------------------
     La marque étant orange, l'orange ne peut pas signifier « attention ».
     Les états se distinguent d'abord par la FORME (liseré, pastille,
     icône), ensuite par la couleur. */
  --ok:               #15703C;
  --ok-mid:           #17924E;
  --ok-soft:          #E8F6ED;
  --ok-line:          #BFE5CD;

  --warn:             #92580B;
  --warn-mid:         #C1780F;
  --warn-soft:        #FDF4E3;
  --warn-line:        #F0DBAE;

  --danger:           #A31D1D;
  --danger-mid:       #CC2B2B;
  --danger-soft:      #FDEDED;
  --danger-line:      #F5C6C6;

  --info:             #1A5C8A;
  --info-mid:         #2077B2;
  --info-soft:        #EAF4FB;
  --info-line:        #BCDCF0;

  /* --- Typographie ------------------------------------------------------
     Jost = substitut libre de Futura, pour l'interface et les titres.
     IBM Plex Serif = la face éditoriale de la charte, telle quelle.
     Les vraies Futura/Gotham restent en secours si un jour les graisses
     manquantes sont acquises. */
  --font-ui:     'Jost', 'Futura', 'Gotham', 'Century Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:  'IBM Plex Serif', Georgia, 'Times New Roman', serif;

  --fs-display: 3.25rem;   /* prix mis en avant */
  --fs-xxl:     2.25rem;   /* titre de page */
  --fs-xl:      1.625rem;  /* titre de section */
  --fs-lg:      1.25rem;   /* sous-titre, montant */
  --fs-md:      1.0625rem; /* titre de carte */
  --fs-base:    1rem;       /* corps, bouton — remonté : Jost a une hauteur d'x basse */
  --fs-sm:      0.9375rem;  /* champ, description */
  --fs-xs:      0.875rem;   /* mention, onglet */
  --fs-2xs:     0.8125rem;  /* libellé, badge, note */

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;

  --lh-tight: 1.15;
  --lh-snug:  1.35;
  --lh-base:  1.55;
  --lh-loose: 1.7;

  --ls-tight: -0.015em;   /* les géométriques serrent bien en gros corps */
  --ls-wide:   0.06em;    /* libellés en capitales */

  /* --- Espacement -------------------------------------------------------- */
  --sp-1:  0.375rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-7:  2rem;
  --sp-8:  2.5rem;
  --sp-9:  3.5rem;
  --sp-10: 5rem;

  /* --- Rayons ------------------------------------------------------------
     6 = petit élément · 10 = interactif · 16 = conteneur · 20 = bloc majeur */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 999px;

  /* --- Élévation ---------------------------------------------------------
     Ombres teintées chaud, jamais du noir pur. Trois niveaux, pas plus. */
  --e-1: 0 1px 2px rgba(28, 25, 23, 0.04),
         0 1px 3px rgba(28, 25, 23, 0.05);
  --e-2: 0 1px 2px rgba(28, 25, 23, 0.04),
         0 6px 16px -6px rgba(28, 25, 23, 0.10);
  --e-3: 0 2px 4px rgba(28, 25, 23, 0.04),
         0 16px 40px -12px rgba(28, 25, 23, 0.16);
  --e-brand: 0 2px 4px rgba(180, 83, 12, 0.12),
             0 8px 20px -6px rgba(249, 115, 22, 0.35);

  /* --- Largeurs ----------------------------------------------------------- */
  --w-narrow: 26rem;
  --w-read:   46rem;   /* page éditoriale : le texte occupe toute la largeur */
  --w-mid:    44rem;
  --w-wide:   64rem;

  /* --- Divers -------------------------------------------------------------- */
  --focus: 0 0 0 3px rgba(249, 115, 22, 0.28);
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t:      180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   2. BASE
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

/* L'attribut hidden doit l'emporter sur toute règle d'affichage. Sans ça,
   un composant en display:flex ou display:grid reste visible alors qu'il
   se croit masqué — c'est vrai du détail d'adresse, du bloc de facturation
   et des onglets du catalogue. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding-left: 1.15em; }
img { max-width: 100%; display: block; }

a {
  color: var(--brand-dark);
  text-decoration-color: var(--brand-line);
  text-underline-offset: 0.18em;
  transition: color var(--t-fast);
}
a:hover { color: var(--brand); text-decoration-color: currentColor; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}

/* -- Rôles typographiques ------------------------------------------------- */
.h-display {
  font-size: var(--fs-display); font-weight: var(--fw-semi);
  line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.h-page {
  font-size: var(--fs-xxl); font-weight: var(--fw-semi);
  line-height: var(--lh-tight); letter-spacing: var(--ls-tight);
  text-wrap: balance;
}
.h-section {
  font-size: var(--fs-xl); font-weight: var(--fw-semi);
  line-height: var(--lh-snug); letter-spacing: var(--ls-tight);
  text-wrap: balance;
}
.h-block { font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: var(--lh-snug); }

/* Texte de lecture — la face éditoriale de la charte. À réserver aux
   passages qu'on lit vraiment : descriptif d'offre, page éditoriale,
   message de bienvenue. Jamais pour l'interface. */
.prose {
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  max-width: 64ch;
}
.prose p + p { margin-top: var(--sp-4); }
/* Un titre a besoin de respirer au-dessus, sinon il colle au paragraphe
   précédent et la hiérarchie disparaît. Le premier enfant fait exception :
   il ne doit pas creuser un vide en tête de bloc. */
.prose h2, .prose h3 { margin-top: var(--sp-8); margin-bottom: var(--sp-3); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin-top: var(--sp-4); }
.prose li + li { margin-top: var(--sp-2); }

.text-sub   { font-size: var(--fs-sm); color: var(--ink-3); line-height: var(--lh-base); }
.text-note  { font-size: var(--fs-2xs); color: var(--ink-4); }
.text-legal { font-size: var(--fs-xs); color: var(--ink-3); line-height: var(--lh-snug); }
.label {
  font-size: var(--fs-2xs); font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--ink-4);
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* =========================================================================
   3. GABARITS DE PAGE
   ========================================================================= */

.page { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.page__main { flex: 1; width: 100%; }

.container         { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--sp-7); width: 100%; }
.container--mid    { max-width: var(--w-mid); }
.container--narrow { max-width: var(--w-narrow); }
/* Page de lecture : le texte remplit son conteneur au lieu d'être plafonné
   à l'intérieur. Sans cela le bloc se colle à gauche pendant que le reste
   de la page reste centré — l'ensemble paraît décalé. */
.container--read   { max-width: var(--w-read); }
.container--read .prose { max-width: none; }

/* -- En-tête -------------------------------------------------------------- */
.header {
  text-align: center;
  padding: var(--sp-6) var(--sp-7);
  background: var(--surface);
  border-bottom: 1px solid var(--line-3);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(180%) blur(8px);
}
.header__logo {
  font-family: var(--font-ui);
  font-size: var(--fs-lg); font-weight: var(--fw-semi);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.header__logo:hover { color: var(--brand); }
.header--account {
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-5);
}
.header__right { display: flex; align-items: center; gap: var(--sp-5); }
.header__who   { font-size: var(--fs-xs); color: var(--ink-3); }
.header__out   { font-size: var(--fs-xs); color: var(--ink-3); text-decoration: none; }
.header__out:hover { color: var(--brand); text-decoration: underline; }

/* -- Espace abonné : en-tête de page et rubriques ---------------------------- */
.account { display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-8) 0 var(--sp-9); }
.account__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }

/* -- Paire libellé / valeur -------------------------------------------------
   Pour les écrans de consultation : plus lisible qu'un tableau, et se plie
   sur petit écran. */
.dl { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3) var(--sp-6); margin: 0; }
.dl dt { font-size: var(--fs-2xs); color: var(--ink-4); }
.dl dd { margin: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.dl dd strong { font-weight: var(--fw-medium); }

/* -- Moyen de paiement enregistré -------------------------------------------- */
.pm { display: flex; align-items: center; gap: var(--sp-4); }
.pm__marque {
  flex-shrink: 0; width: 2.75rem; height: 1.9rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center;
  font-size: var(--fs-2xs); font-weight: var(--fw-semi); color: var(--ink-2);
}
.pm__txt   { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pm__num   { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pm__meta  { font-size: var(--fs-2xs); color: var(--ink-4); }

/* -- Pied de page ---------------------------------------------------------- */
.footer { border-top: 1px solid var(--line-3); padding: var(--sp-8) var(--sp-7); background: var(--surface); }
.footer__inner {
  max-width: var(--w-wide); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6);
  align-items: center; justify-content: center;
  font-size: var(--fs-xs); color: var(--ink-4);
}
.footer__inner a { color: var(--ink-3); text-decoration: none; }
.footer__inner a:hover { color: var(--brand); }

/* -- Écrans hors connexion -------------------------------------------------- */
.auth { display: flex; justify-content: center; padding: var(--sp-9) var(--sp-7); }
.auth__card {
  width: 100%; max-width: var(--w-narrow);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--e-2);
  padding: var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-6);
}
.auth__head { display: flex; flex-direction: column; gap: var(--sp-2); text-align: center; }

/* =========================================================================
   4. COMPOSANTS
   ========================================================================= */

/* -- Bouton ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 100%;
  padding: 0.8rem var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--brand);
  color: var(--ink);          /* noir et non blanc : 6,24:1 contre 2,80:1 */
  font-family: var(--font-ui);
  font-size: var(--fs-base); font-weight: var(--fw-medium);
  line-height: 1.2;
  text-align: center; text-decoration: none;
  cursor: pointer;
  box-shadow: var(--e-brand);
  transition: background var(--t-fast), box-shadow var(--t), transform var(--t-fast);
}
.btn:hover { background: var(--brand-hover); color: var(--ink); transform: translateY(-1px); }
.btn:active { background: var(--brand-active); transform: translateY(0); box-shadow: var(--e-1); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--line-3); color: var(--ink-4);
  box-shadow: none; cursor: not-allowed; transform: none;
}

.btn--outline {
  background: var(--surface); color: var(--brand-dark);
  border-color: var(--brand-line); box-shadow: var(--e-1);
}
.btn--outline:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }

.btn--quiet {
  background: var(--surface); color: var(--ink-2);
  border-color: var(--line); box-shadow: var(--e-1);
}
.btn--quiet:hover { background: var(--surface-3); color: var(--ink); }

.btn--danger { background: var(--danger-mid); color: #fff; box-shadow: 0 6px 16px -6px rgba(204, 43, 43, 0.4); }
.btn--danger:hover { background: var(--danger); color: #fff; }

/* Portefeuille mobile : le noir est imposé par les chartes d'Apple et de
   Google, ce n'est pas un choix de notre part. */
.btn--wallet { background: var(--ink); color: #fff; box-shadow: var(--e-1); font-weight: var(--fw-semi); }
.btn--wallet svg { flex-shrink: 0; }
.btn--wallet:hover { background: #000; color: #fff; }

.btn--lg   { font-size: var(--fs-md); padding: 0.95rem var(--sp-6); border-radius: var(--r-md); }
.btn--auto { width: auto; }

/* -- Carte ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--e-1);
  padding: var(--sp-6);
  display: flex; flex-direction: column;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card--interactive:hover { box-shadow: var(--e-2); transform: translateY(-2px); border-color: var(--line); }
/* La carte mise en avant reste claire : un bloc entièrement sombre écrase
   la rangée au lieu de recommander. Le contraste de valeur est réduit à un
   bandeau en tête de carte — assez pour marquer la hiérarchie, pas assez
   pour dominer. */
.card--featured {
  border-color: var(--brand); border-width: 1.5px;
  box-shadow: var(--e-2);
  position: relative;
}
/* Bandeau sombre en tête de carte, à fleur des bords. */
.card__cap {
  margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) var(--sp-5);
  padding: var(--sp-3) var(--sp-6);
  background: var(--ink-surface);
  color: var(--on-dark);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  font-size: var(--fs-2xs); font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  text-align: center;
}

.card__title { font-size: var(--fs-md); font-weight: var(--fw-medium); letter-spacing: -0.005em; }
.card__sub   { font-size: var(--fs-sm); color: var(--ink-3); }
.card__head  { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }

.cards { display: grid; gap: var(--sp-5); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }

/* -- Badge ------------------------------------------------------------------ */
.badge {
  display: inline-block; width: fit-content;
  background: var(--brand); color: var(--ink);
  border: 1px solid var(--brand);
  font-size: var(--fs-2xs); font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  padding: 0.25rem 0.6rem; border-radius: var(--r-sm);
}

/* -- Champ ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field > label { font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--ink-2); }
.field .req { color: var(--brand); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 2.75rem;                 /* même hauteur pour les trois */
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-ui); font-size: var(--fs-sm);
  line-height: 1.35;
  color: var(--ink); background: var(--surface);
  outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
/* Le menu déroulant natif impose ses propres métriques : on les neutralise
   et on redessine le chevron, sinon il est plus haut que les champs voisins. */
.field select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235F5854' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 8px;
  cursor: pointer;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-5); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: var(--focus);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-5); }
.field input:disabled, .field select:disabled { background: var(--surface-2); color: var(--ink-4); cursor: not-allowed; }

.field-group { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.field-group--full { grid-template-columns: 1fr; }

.field.is-error > label { color: var(--danger); }
.field.is-error input, .field.is-error select, .field.is-error textarea { border-color: var(--danger-mid); }
.field.is-error input:focus { box-shadow: 0 0 0 3px rgba(204, 43, 43, 0.2); }
.field__error {
  display: flex; align-items: flex-start; gap: var(--sp-1);
  font-size: var(--fs-2xs); color: var(--danger); line-height: var(--lh-snug);
}
/* Texte d'aide : explique ce qu'on attend AVANT que l'erreur ne survienne. */
.field__hint { font-size: var(--fs-2xs); color: var(--ink-4); line-height: var(--lh-snug); }

.field__error::before {
  content: "!";
  flex-shrink: 0;
  width: 14px; height: 14px; margin-top: 1px;
  border-radius: var(--r-full); background: var(--danger-mid); color: #fff;
  font-size: 10px; font-weight: var(--fw-semi);
  display: flex; align-items: center; justify-content: center;
}

/* -- Case à cocher ------------------------------------------------------------ */
/* Les cases à cocher se suivent : c'est le groupe qui règle leur écart,
   pas chaque ligne. Sans ça l'espacement du conteneur parent s'ajoute au
   leur et elles se retrouvent très loin les unes des autres. */
.check-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.check-row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 0;
}
.check-row input[type="checkbox"], .check-row input[type="radio"] {
  accent-color: var(--brand);
  width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; cursor: pointer;
}
.check-row label { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-snug); cursor: pointer; }

/* -- Onglets -------------------------------------------------------------------- */
.tabs {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--e-1);
  padding: var(--sp-1);
  gap: var(--sp-1);
}
.tabs--2 { grid-template-columns: repeat(2, 1fr); }
.tabs--4 { grid-template-columns: repeat(4, 1fr); }
.tab {
  display: flex; align-items: center; justify-content: center;
  min-height: 3rem;
  padding: var(--sp-3) var(--sp-2);
  border: none; border-radius: var(--r-sm);
  background: transparent;
  font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--ink-3);
  text-align: center; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.tab:hover:not(.is-active) { background: var(--surface-3); color: var(--ink); }
.tab.is-active {
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: var(--fw-semi);
  box-shadow: inset 0 -2px 0 var(--brand);
}

/* -- Bandeau de progression ------------------------------------------------------ */
.steps { display: flex; align-items: flex-start; padding: var(--sp-7) var(--sp-7) 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }
.step__circle {
  width: 2rem; height: 2rem; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  border: 1.5px solid var(--line); color: var(--ink-4); background: var(--surface);
  position: relative; z-index: 2;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.step__label { font-size: var(--fs-2xs); color: var(--ink-4); text-align: center; line-height: var(--lh-snug); }
.step.is-done .step__circle { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.is-active .step__circle {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand-dark); font-weight: var(--fw-semi);
}
.step.is-done .step__label, .step.is-active .step__label { color: var(--ink); font-weight: var(--fw-medium); }
.step-line { flex: 1; height: 2px; border-radius: var(--r-full); background: var(--line-2); margin-top: 15px; z-index: 1; }
.step-line.is-done { background: var(--brand); }

/* -- Récapitulatif ---------------------------------------------------------------- */
.recap { display: flex; flex-direction: column; }
.recap__row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-5); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-3);
}
.recap__row:last-of-type { border-bottom: none; }
/* La dernière ligne avant le total perdait son trait fin : sinon deux
   filets se superposent, un fin et un fort. */
.recap__row:has(+ .recap__total) { border-bottom: none; }
.recap__name { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.recap__note { font-size: var(--fs-2xs); color: var(--ink-4); margin-top: 2px; }
.recap__val  { font-size: var(--fs-md); font-weight: var(--fw-medium); white-space: nowrap; font-variant-numeric: tabular-nums; }
.recap__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-5);
  padding-top: var(--sp-4); margin-top: var(--sp-3);
  border-top: 1.5px solid var(--line);
}
.recap__total .recap__name { font-size: var(--fs-md); font-weight: var(--fw-semi); }
.recap__total .recap__val  { font-size: var(--fs-xl); font-weight: var(--fw-semi); color: var(--brand-dark); letter-spacing: var(--ls-tight); }

/* -- Périodicité -------------------------------------------------------------------- */
.price-opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.price-opt {
  position: relative;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3); text-align: center; cursor: pointer;
  background: var(--surface);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t);
}
.price-opt:hover { border-color: var(--ink-5); }
.price-opt.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--e-1); }
.price-opt__label { font-size: var(--fs-2xs); color: var(--ink-4); letter-spacing: var(--ls-wide); text-transform: uppercase; }
.price-opt__val {
  font-size: var(--fs-xl); font-weight: var(--fw-semi);
  letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.price-opt.is-selected .price-opt__val { color: var(--brand-dark); }
.price-opt__note { font-size: var(--fs-2xs); color: var(--ok); margin-top: 2px; font-weight: var(--fw-medium); }

/* -- Pastille d'état ------------------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: var(--fs-2xs); font-weight: var(--fw-medium);
  letter-spacing: 0.01em; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; flex-shrink: 0; }
.pill--actif    { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok-line); }
.pill--paye     { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok-line); }
.pill--essai    { background: var(--info-soft);   color: var(--info);   border-color: var(--info-line); }
.pill--resilie  { background: var(--line-4);      color: var(--ink-2);  border-color: var(--line-2); }
.pill--suspendu { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.pill--impaye   { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }

/* -- Bandeau d'alerte -------------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line-2); border-left: 3px solid var(--ink-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--e-1);
}
.alert__icon {
  flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-2xs); font-weight: var(--fw-semi); color: #fff;
  background: var(--ink-4);
}
.alert__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert__title { font-size: var(--fs-sm); font-weight: var(--fw-semi); }
.alert__text  { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-snug); }
.alert__action { flex-shrink: 0; align-self: center; }
.alert__action .btn { width: auto; padding: 0.6rem var(--sp-5); font-size: var(--fs-xs); }

.alert--danger { border-color: var(--danger-line); border-left-color: var(--danger-mid); background: var(--danger-soft); }
.alert--danger .alert__icon { background: var(--danger-mid); }
.alert--danger .alert__title { color: var(--danger); }
.alert--warn   { border-color: var(--warn-line);   border-left-color: var(--warn-mid);   background: var(--warn-soft); }
.alert--warn   .alert__icon { background: var(--warn); }      /* 5,80:1 */
.alert--warn   .alert__title { color: var(--warn); }
.alert--ok     { border-color: var(--ok-line);     border-left-color: var(--ok-mid);     background: var(--ok-soft); }
.alert--ok     .alert__icon { background: var(--ok); }        /* 6,15:1 */
.alert--ok     .alert__title { color: var(--ok); }
.alert--info   { border-color: var(--info-line);   border-left-color: var(--info-mid);   background: var(--info-soft); }
.alert--info   .alert__icon { background: var(--info-mid); }
.alert--info   .alert__title { color: var(--info); }

/* -- État vide ------------------------------------------------------------------------------ */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  padding: var(--sp-9) var(--sp-7);
  border: 1px dashed var(--line); border-radius: var(--r-lg);
  background: var(--surface-2);
  text-align: center;
}
.empty__title { font-size: var(--fs-md); font-weight: var(--fw-medium); }
.empty__text  { font-size: var(--fs-sm); color: var(--ink-3); max-width: 44ch; }
.empty .btn   { width: auto; }

/* -- Liste de données ------------------------------------------------------------------------ */
.datalist {
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--e-1);
  overflow: hidden;
}
.datalist__head, .datalist__row {
  display: grid;
  /* Une colonne par nature d'information, de largeur fixe sauf la première.
     Le montant et la pastille partageaient une cellule : sa largeur changeait
     avec « Payée » ou « Impayée », et tout se décalait d'une ligne à l'autre. */
  grid-template-columns: 1fr 7.5rem 8rem;   /* intitulé · statut · action */
  gap: var(--sp-5); align-items: center;
  padding: var(--sp-4) var(--sp-5);
}
/* Variante avec montant : une colonne de plus. */
.datalist--amounts .datalist__head,
.datalist--amounts .datalist__row {
  grid-template-columns: 1fr 6rem 7.5rem 8rem;   /* + montant */
}
.datalist__head {
  background: var(--surface-2); border-bottom: 1px solid var(--line-2);
  font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--ink-4);
  text-transform: uppercase; letter-spacing: var(--ls-wide);
}
.datalist--amounts .datalist__head > :nth-child(2) { text-align: right; }
.datalist__row { border-bottom: 1px solid var(--line-3); transition: background var(--t-fast); }
.datalist__row:last-child { border-bottom: none; }
.datalist__row:hover { background: var(--surface-2); }
.datalist__main  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.datalist__title { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.datalist__meta  { font-size: var(--fs-2xs); color: var(--ink-4); }
/* Le montant s'aligne à DROITE : des chiffres se lisent par la droite, et
   les décimales se superposent d'une ligne à l'autre. Tout le reste
   s'aligne à gauche, pour que les pastilles et les actions démarrent au
   même endroit quelle que soit la longueur du mot. */
.datalist__val    { font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.datalist__status { text-align: left; }
.datalist__act    { text-align: left; }
.datalist__act a { font-size: var(--fs-xs); font-weight: var(--fw-medium); text-decoration: none; white-space: nowrap; }
.datalist__act a:hover { text-decoration: underline; }

/* -- Choix exclusif (bouton radio en ligne cliquable) ------------------------
   Le sélecteur de moyen de paiement du tunnel, et partout où l'on choisit
   une option parmi plusieurs avec un descriptif. */
.choice-group { display: flex; flex-direction: column; gap: var(--sp-3); }

/* Variante avec formulaire : le choix devient l'en-tête d'un bloc, et ce
   qu'il demande s'ouvre juste dessous. Le formulaire ne peut pas vivre dans
   le <label>, sinon cliquer un champ rebasculerait le choix. */
.choice-block {
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--t-fast);
}
.choice-block:hover { border-color: var(--ink-5); }
.choice-block.is-selected { border-color: var(--brand); }
.choice-block .choice { border: 0; border-radius: 0; background: transparent; }
.choice-block.is-selected .choice { background: var(--brand-soft); }
.choice__form {
  padding: var(--sp-5);
  border-top: 1px solid var(--line-3);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.wallets { display: flex; flex-direction: column; gap: var(--sp-3); }
.choice {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.choice:hover { border-color: var(--ink-5); }
.choice.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.choice input[type="radio"] {
  accent-color: var(--brand);
  width: 17px; height: 17px; flex-shrink: 0; margin: 2px 0 0; cursor: pointer;
}
.choice__body  { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.choice__title { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.choice__sub   { font-size: var(--fs-2xs); color: var(--ink-4); line-height: var(--lh-snug); }
.choice__aside { margin-left: auto; align-self: center; font-size: var(--fs-2xs); color: var(--ink-4); }

/* -- Recherche prédictive ----------------------------------------------------
   Indispensable pour la saisie d'adresse : sans suggestion, personne ne
   saisit une adresse correctement. Le champ reste un .field ordinaire, la
   liste se superpose. */
.combo { position: relative; }
.combo__list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: var(--sp-1); list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: var(--e-3);
  max-height: 22rem; overflow-y: auto;   /* 4 suggestions + le pied, sans coupe */
}
.combo__opt {
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); cursor: pointer;
}
.combo__opt:hover, .combo__opt.is-active { background: var(--brand-soft); }
.combo__opt strong { font-size: var(--fs-sm); font-weight: var(--fw-normal); }
.combo__opt strong mark { background: none; color: var(--brand-dark); font-weight: var(--fw-semi); }
.combo__opt span { font-size: var(--fs-2xs); color: var(--ink-4); }
.combo__foot {
  padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-1);
  border-top: 1px solid var(--line-3);
  font-size: var(--fs-2xs); color: var(--ink-4);
}
.combo__foot a { font-weight: var(--fw-medium); }

/* -- Liste d'avantages -------------------------------------------------------
   Un avantage grisé n'est pas absent : il est inclus dans une offre
   supérieure. C'est une demande explicite du plan d'action, et c'est le
   moteur de la montée en gamme — encore faut-il que le lecteur comprenne
   qu'il lui manque quelque chose. */
.feats { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.feat  {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--ink-2);
}
.feat::before {
  content: "✓"; flex-shrink: 0; width: 1rem;
  color: var(--ok-mid); font-weight: var(--fw-semi);
}
.feat--off { color: var(--ink-4); }
.feat--off::before { color: var(--ink-5); }
.feat--gift { color: var(--ink); font-weight: var(--fw-medium); }
.feat--gift::before { content: "★"; color: var(--brand); }

/* -- Encart cadeau partenaire ------------------------------------------------- */
.gift {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--line-3); border-radius: var(--r-md);
}
.gift__img {
  width: 3.25rem; height: 3.25rem; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--line-4); border: 1px dashed var(--line); border-radius: var(--r-sm);
}
.gift__txt        { font-size: var(--fs-2xs); color: var(--ink-4); line-height: var(--lh-snug); }
.gift__txt strong { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: var(--fw-medium); }

/* -- Bloc adresse progressif --------------------------------------------------
   Un seul champ au départ : on cherche son adresse, on la choisit, et le
   détail s'ouvre pré-rempli. Le formulaire complet ne s'affiche que si on
   le demande. Sert deux fois — livraison et facturation — avec le même
   comportement. */
.addr { display: flex; flex-direction: column; gap: var(--sp-5); }
.addr__search { display: flex; flex-direction: column; gap: var(--sp-2); }
.addr__detail { display: flex; flex-direction: column; gap: var(--sp-5); }
.addr__link {
  align-self: flex-start;
  background: none; border: 0; padding: 0;
  font-family: var(--font-ui); font-size: var(--fs-2xs); font-weight: var(--fw-medium);
  color: var(--brand-dark); cursor: pointer; text-decoration: underline;
  text-underline-offset: 0.18em;
}
.addr__link:hover { color: var(--brand); }

/* -- Mise en page de commande -------------------------------------------------
   Formulaire à gauche, récapitulatif collant à droite. Le montant reste
   sous les yeux pendant toute la saisie — c'est la principale faiblesse de
   l'écran actuel, où il faut redescendre pour savoir ce qu'on paie. */
.checkout { display: grid; grid-template-columns: 1fr 21rem; gap: var(--sp-7); align-items: start; }
.checkout__aside { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: var(--sp-4); }

/* -- Bloc de formulaire -------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--e-1);
  padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-5);
}
.panel__title {
  font-size: var(--fs-md); font-weight: var(--fw-semi);
  display: flex; align-items: center; gap: var(--sp-3);
}

/* -- Champ code promo ------------------------------------------------------------ */
.promo { display: flex; gap: var(--sp-2); }
.promo input {
  /* min-width:0 est indispensable : sans lui un élément flex refuse de
     descendre sous la largeur de son contenu, et le bouton sort de la boîte. */
  flex: 1; min-width: 0;
  min-height: 2.75rem; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--ink);
  background: var(--surface); outline: none;
}
.promo input:focus { border-color: var(--brand); box-shadow: var(--focus); }
.promo input::placeholder { color: var(--ink-5); }
.promo .btn { width: auto; flex-shrink: 0; padding-left: var(--sp-4); padding-right: var(--sp-4); }

/* =========================================================================
   5. UTILITAIRES
   ========================================================================= */

.stack   { display: flex; flex-direction: column; }
.stack-1 { gap: var(--sp-1); } .stack-2 { gap: var(--sp-2); } .stack-3 { gap: var(--sp-3); }
.stack-4 { gap: var(--sp-4); } .stack-5 { gap: var(--sp-5); } .stack-6 { gap: var(--sp-6); }
.stack-7 { gap: var(--sp-7); } .stack-8 { gap: var(--sp-8); } .stack-9 { gap: var(--sp-9); }
.row     { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.pad-block { padding: var(--sp-8) 0 var(--sp-9); }
.sep { height: 1px; background: var(--line-3); border: 0; margin: 0; }

/* =========================================================================
   6. PETIT ÉCRAN
   ========================================================================= */

@media (max-width: 46rem) {
  :root { --fs-display: 2.5rem; --fs-xxl: 1.75rem; --fs-xl: 1.375rem; }
  .container { padding: 0 var(--sp-4); }
  .cards--2, .cards--3 { grid-template-columns: 1fr; }
  .field-group { grid-template-columns: 1fr; }
  .tabs--4 { grid-template-columns: 1fr 1fr; }
  .auth { padding: var(--sp-6) var(--sp-4); }
  .auth__card { padding: var(--sp-6); }
  .alert { flex-wrap: wrap; }
  .alert__action { align-self: stretch; width: 100%; }
  .alert__action .btn { width: 100%; }
  .datalist__head { display: none; }
  .datalist__row { grid-template-columns: 1fr; gap: var(--sp-2); align-items: start; }
  .datalist__val, .datalist__status, .datalist__act { text-align: left; }
  .steps { padding: var(--sp-6) var(--sp-4) 0; }
  .header { position: static; }
  .header--account { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .dl { grid-template-columns: 1fr; gap: var(--sp-1); }
  .dl dd { margin-bottom: var(--sp-3); }
  .checkout { grid-template-columns: 1fr; }
  .checkout__aside { position: static; order: -1; }
}

/* =========================================================================
   7. MOUVEMENT RÉDUIT
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card--interactive:hover { transform: none; }
}
