/* ==========================================================================
   NovaBus — système de design du site public.

   Source unique. Ce fichier habille :
     · les pages de web/ (copiées telles quelles dans dist/ par
       scripts/postbuild-pwa.js pour la PWA) ;
     · le site publié sur GitHub Pages (scripts/build-public-site.js), qui
       réécrit simplement le chemin de la feuille de style en relatif.

   Ne jamais dupliquer ces règles dans une page : modifier ici uniquement.

   Après modification :
     · republier le site avec ./scripts/publish-public-site.sh ;
     · incrémenter CACHE_VERSION dans web/service-worker.js — la stratégie
       « cache first » y sert les .css/.js depuis le cache versionné, donc sans
       ce changement les visiteurs déjà installés gardent l'ancien habillage.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons
   -------------------------------------------------------------------------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, 'Noto Sans', sans-serif;

  /* Marque — alignée sur COLORS.primary (#007AFF) et COLORS.secondary (#5856D6)
     de src/utils/constants.ts ; #0A63E4 est le fond de l'icône adaptative. */
  --brand:        #0A63E4;
  --brand-strong: #084BB0;
  --brand-light:  #1B7BFF;
  --indigo:       #5856D6;
  --grad:         linear-gradient(135deg, #0A63E4 0%, #2E6FE8 45%, #5856D6 100%);

  --bg:         #F5F8FD;
  --surface:    #FFFFFF;
  --surface-2:  #F1F5FB;
  --surface-3:  #E6EDF8;
  --border:     #E3EAF4;
  --border-2:   #CEDAEB;

  --ink:    #0B1523;
  --ink-2:  #35435A;
  --ink-3:  #63748C;
  --ink-4:  #93A2B6;

  --link:       #0A5BD3;
  --brand-soft: #E9F1FE;
  --warn:       #B54708;
  --warn-soft:  #FEF4E6;
  --warn-line:  #F0C48A;
  --ok:         #06744A;
  --ok-soft:    #E8F6EF;

  --scroll-shade: rgba(11, 21, 35, .13);
  --shadow-sm: 0 1px 2px rgba(11, 21, 35, .05);
  --shadow-md: 0 12px 28px -14px rgba(11, 21, 35, .22), 0 2px 6px rgba(11, 21, 35, .04);
  --shadow-lg: 0 32px 64px -32px rgba(11, 21, 35, .38), 0 4px 12px rgba(11, 21, 35, .05);
  --shadow-brand: 0 14px 30px -14px rgba(10, 99, 228, .75);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Échelle de points de rupture, employée telle quelle dans tout le fichier :
       < 768 px   téléphone — navigation repliée dans un panneau
       ≥ 768 px   tablette portrait — barre de navigation complète
       ≥ 1024 px  tablette paysage et desktop — sommaire collant en colonne
       ≥ 1180 px  desktop large — largeur de page atteinte, grilles à 4 colonnes
     --header-h doit rester la hauteur réelle de la barre collante (60 px sous 768 px,
     68 px au-dessus) : les ancres se calent dessus via --header-total, sinon un titre
     visé par un lien interne se retrouve masqué sous la barre. */
  --wrap: 1180px;
  --prose: 760px;
  --header-h: 68px;
  /* Hauteur occupée à l'écran par l'en-tête, zone sûre comprise : en PWA installée
     la page passe sous la barre d'état, et une ancre calée sur --header-h seul
     arriverait trop haut. */
  --header-total: calc(var(--header-h) + env(safe-area-inset-top));
  --gutter: clamp(18px, 4vw, 40px);

  --header-bg: rgba(255, 255, 255, .78);
  --hero-tint: linear-gradient(180deg, #EDF3FE 0%, var(--bg) 100%);
  --code-bg: var(--surface-2);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #060A11;
    --surface:   #0E1622;
    --surface-2: #141E2C;
    --surface-3: #1B2739;
    --border:    #1F2B3D;
    --border-2:  #2C3B52;

    --ink:   #ECF2FA;
    --ink-2: #B7C4D6;
    --ink-3: #8698AF;
    --ink-4: #63748C;

    --link:       #6FAEFF;
    --brand-soft: #10233E;
    --warn:       #F5B871;
    --warn-soft:  #2A1D0C;
    --warn-line:  #6A4715;
    --ok:         #5FD6A4;
    --ok-soft:    #0C241A;

    --scroll-shade: rgba(0, 0, 0, .6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 14px 30px -16px rgba(0, 0, 0, .8);
    --shadow-lg: 0 34px 66px -34px rgba(0, 0, 0, .9);
    --shadow-brand: 0 14px 32px -16px rgba(10, 99, 228, .9);

    --header-bg: rgba(9, 15, 25, .74);
    --hero-tint: linear-gradient(180deg, #0C1725 0%, var(--bg) 100%);
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-total) + 24px);
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.72;
  background: var(--bg);
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

strong, b { color: var(--ink); font-weight: 650; }

:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(10, 99, 228, .18); color: var(--ink); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  /* max() avec la zone sûre : un iPhone tourné en paysage mord de plusieurs dizaines
     de pixels sur le bord gauche ou droit avec son encoche. */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  font-weight: 600;
}
.skip:focus { left: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. En-tête
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* En PWA installée, la page passe sous la barre d'état (viewport-fit=cover) :
     l'en-tête doit s'en écarter. En navigateur l'inset vaut zéro. */
  padding-top: env(safe-area-inset-top);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 20px -8px rgba(11, 21, 35, .25);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  flex: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-brand);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-size: 17px; font-weight: 750;
  letter-spacing: -.02em; color: var(--ink);
}
.brand-text small {
  font-size: 11px; font-weight: 500;
  color: var(--ink-4); letter-spacing: .04em; text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-inline: -8px;
  padding-inline: 8px;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-3);
  padding: 8px 13px;
  border-radius: 999px;
  transition: color .18s ease, background .18s ease;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--brand); background: var(--brand-soft); }

.site-nav .nav-cta {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
  margin-left: 6px;
}
.site-nav .nav-cta:hover { color: #fff; filter: brightness(1.06); }

/* Bouton de menu : n'existe que sous 768 px, où les quatre entrées ne tiennent
   plus sur une ligne à côté de la marque. */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.nav-toggle:hover { color: var(--brand); border-color: var(--brand); }
.nav-toggle svg { width: 21px; height: 21px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] { color: var(--brand); border-color: var(--brand); }
.nav-toggle[aria-expanded='true'] .icon-open { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }

@media (max-width: 767.98px) {
  /* L'en-tête reste sur une seule ligne : sa hauteur demeure prévisible, donc les
     ancres continuent d'arriver au bon endroit. */
  :root { --header-h: 60px; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: max(var(--gutter), env(safe-area-inset-left));
    right: max(var(--gutter), env(safe-area-inset-right));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-total) - 24px);
    max-height: calc(100dvh - var(--header-total) - 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
  }
  /* Sans script, le panneau reste fermé : les mêmes liens sont repris en pied de
     page, la navigation n'est donc jamais perdue. */
  .site-nav.is-open { display: flex; }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: 15.5px;
    white-space: normal;
  }
  .site-nav .nav-cta { margin-left: 0; margin-top: 4px; justify-content: center; }
}

/* --------------------------------------------------------------------------
   4. Héros
   -------------------------------------------------------------------------- */

/* 4a. Héros d'accueil — pleine couleur */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: #07306E;
  padding: clamp(56px, 8vw, 104px) 0 clamp(52px, 7vw, 92px);
}
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(90% 120% at 12% 0%, #1B7BFF 0%, transparent 58%),
    radial-gradient(80% 110% at 92% 8%, #5856D6 0%, transparent 55%),
    linear-gradient(160deg, #0A63E4 0%, #072C63 100%);
}
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 100%);
}

/* Imbriqué dans .wrap, jamais fusionné avec lui : porter le plafond de 820 px sur
   l'élément .wrap lui-même le recentrerait dans la fenêtre, et le héros ne serait
   plus aligné sur la marque, les titres de section ni le pied de page. */
.hero-inner { max-width: 820px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #52E0A8;
  box-shadow: 0 0 0 4px rgba(82, 224, 168, .22);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.1rem, 1.25rem + 3.4vw, 3.65rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 800;
  color: #fff;
}
.hero h1 .accent {
  background: linear-gradient(100deg, #9FD0FF 0%, #C9C6FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  margin-top: 20px;
  font-size: clamp(1.02rem, .96rem + .35vw, 1.2rem);
  line-height: 1.62;
  color: rgba(255, 255, 255, .82);
  max-width: 62ch;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats {
  margin-top: clamp(40px, 6vw, 62px);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr));
}
.hero-stat {
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.hero-stat dt {
  font-size: 12px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: rgba(255, 255, 255, .62);
}
.hero-stat dd {
  margin-top: 5px; font-size: 18px; font-weight: 700;
  color: #fff; letter-spacing: -.01em; line-height: 1.35;
}

/* 4b. Héros de page — sobre, pour les documents légaux */
.page-hero {
  background: var(--hero-tint);
  border-bottom: 1px solid var(--border);
  padding: clamp(32px, 5vw, 60px) 0 clamp(30px, 4.5vw, 52px);
}
.page-hero h1 {
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -.032em;
  font-weight: 800;
  color: var(--ink);
  max-width: 20ch;
}
.page-hero .lede {
  margin-top: 16px;
  font-size: clamp(1rem, .95rem + .28vw, 1.14rem);
  color: var(--ink-3);
  max-width: 66ch;
  line-height: 1.62;
}

.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--ink-4);
  margin-bottom: 18px; flex-wrap: wrap;
}
.crumbs a { color: var(--ink-3); font-weight: 550; }
.crumbs a:hover { color: var(--brand); }
.crumbs svg { width: 14px; height: 14px; opacity: .55; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.meta-row {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; gap: 9px;
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 550;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.pill svg { width: 14px; height: 14px; opacity: .7; flex: none; }
.pill-accent { color: var(--brand); background: var(--brand-soft); border-color: transparent; }

/* --------------------------------------------------------------------------
   5. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  /* line-height supérieur à 1 : un libellé qui passe sur deux lignes sur un petit
     écran reste lisible, et la hauteur atteint les 44 px tactiles. */
  line-height: 1.2;
  max-width: 100%;
  text-align: center;
  padding: 13px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease,
              background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }

.btn-on-dark {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-on-dark:hover { background: rgba(255, 255, 255, .18); color: #fff; transform: translateY(-2px); }

.btn-light { background: #fff; color: #0A3D8F; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .6); }
.btn-light:hover { transform: translateY(-2px); color: #062C6B; }

/* --------------------------------------------------------------------------
   6. Mise en page « document »
   -------------------------------------------------------------------------- */
.doc {
  /* padding-block, jamais le raccourci : .doc partage son élément avec .wrap, et un
     « padding: … 0 … » remettrait les gouttières latérales à zéro — le texte viendrait
     alors coller aux bords de l'écran entre 768 et 1180 px. */
  padding-block: clamp(34px, 5vw, 64px) clamp(56px, 8vw, 96px);
  display: grid;
  gap: clamp(26px, 3vw, 52px);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1024px) {
  .doc { grid-template-columns: 250px minmax(0, 1fr); }
}

/* Sommaire : rangée de puces défilantes en mobile, colonne collante en desktop */
.toc { min-width: 0; }
.toc-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.toc-list {
  list-style: none;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-inline: -4px;
  padding-inline: 4px;
}
.toc-list::-webkit-scrollbar { display: none; }
.toc-list li { scroll-snap-align: start; flex: none; }
.toc-list a {
  display: block;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.toc-list a:hover { color: var(--brand); border-color: var(--border-2); text-decoration: none; }
.toc-list a[aria-current='true'] {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: transparent;
}

@media (min-width: 1024px) {
  .toc {
    position: sticky;
    top: calc(var(--header-total) + 28px);
    max-height: calc(100vh - var(--header-total) - 56px);
    overflow-y: auto;
  }
  .toc-list {
    display: block;
    overflow: visible;
    border-left: 1px solid var(--border);
    padding: 0;
    margin: 0;
  }
  .toc-list li { flex: initial; }
  .toc-list a {
    white-space: normal;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 7px 0 7px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    line-height: 1.4;
  }
  .toc-list a:hover { background: none; color: var(--ink); }
  .toc-list a[aria-current='true'] {
    background: none;
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 650;
  }
}

/* --------------------------------------------------------------------------
   7. Typographie du corps de texte
   -------------------------------------------------------------------------- */
.prose { min-width: 0; max-width: var(--prose); overflow-wrap: break-word; }

.prose section { scroll-margin-top: calc(var(--header-total) + 22px); }
.prose section + section {
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: clamp(30px, 4vw, 46px);
  border-top: 1px solid var(--border);
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 13px;
  font-size: clamp(1.22rem, 1.1rem + .5vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -.022em;
  font-weight: 720;
  color: var(--ink);
  margin-bottom: 16px;
}
.prose h2 .num {
  flex: none;
  align-self: flex-start;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(1px);
}

.prose h3 {
  font-size: 1.03rem;
  font-weight: 680;
  color: var(--ink);
  letter-spacing: -.012em;
  margin-top: 26px;
  margin-bottom: 10px;
}

.prose p { margin-bottom: 14px; }
.prose p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { list-style: none; margin: 16px 0; }
.prose ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: .72em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .55;
}
.prose ul li:last-child, .prose ol li:last-child { margin-bottom: 0; }

/* Liste ordonnée « étapes » avec pastilles et fil conducteur */
.steps { counter-reset: step; margin: 22px 0 !important; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 52px;
  padding-bottom: 20px;
  margin-bottom: 0 !important;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -1px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-brand);
}
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px; top: 39px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--border-2), transparent);
}

.prose a { font-weight: 550; text-decoration: underline; text-underline-offset: 3px;
           text-decoration-thickness: 1px; text-decoration-color: rgba(10, 91, 211, .3); }
.prose a:hover { text-decoration-color: currentColor; }

.updated {
  font-size: 14px;
  color: var(--ink-4);
}

/* --------------------------------------------------------------------------
   8. Tableaux
   -------------------------------------------------------------------------- */
.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
  /* Ombres de défilement : les deux premiers calques suivent le contenu (local) et
     masquent les deux suivants, collés aux bords (scroll). Un tableau plus large que
     l'écran signale ainsi qu'il se fait défiler — sans script, et sans rien ajouter
     au balisage des pages légales. */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 44px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 44px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent) left center / 15px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent) right center / 15px 100% no-repeat scroll,
    var(--surface);
}
.prose table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 15px;
}
.prose th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: var(--surface-2);
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prose td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: var(--surface-2); }
.prose td:first-child { color: var(--ink); font-weight: 550; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-del { background: var(--brand-soft); color: var(--brand); }
.tag-keep { background: var(--warn-soft); color: var(--warn); }

/* --------------------------------------------------------------------------
   9. Encarts
   -------------------------------------------------------------------------- */
.callout {
  display: flex;
  gap: 14px;
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 1px solid transparent;
  border-left: 3px solid var(--brand);
  color: var(--ink-2);
}
.callout > svg {
  width: 20px; height: 20px;
  flex: none;
  margin-top: 2px;
  color: var(--brand);
}
.callout-body { min-width: 0; }
.callout-title {
  font-weight: 680;
  color: var(--ink);
  margin-bottom: 4px !important;
  font-size: 15.5px;
}
.callout p { margin-bottom: 6px; font-size: 15.5px; }
.callout p:last-child { margin-bottom: 0; }

.callout-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}
.callout-warn > svg { color: var(--warn); }

/* --------------------------------------------------------------------------
   10. Sections & cartes
   -------------------------------------------------------------------------- */
.band { padding: clamp(48px, 7vw, 88px) 0; }
.band-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 42px); }
.section-head h2 {
  font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.15rem);
  line-height: 1.16;
  letter-spacing: -.03em;
  font-weight: 780;
  color: var(--ink);
}
.section-head p { margin-top: 12px; color: var(--ink-3); font-size: 1.03rem; }

.kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.card { color: inherit; }
a.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 16px;
}
.card-icon svg { width: 21px; height: 21px; }

.card h3 {
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -.015em;
  color: var(--ink);
  margin-bottom: 7px;
}
.card p { font-size: 15px; color: var(--ink-3); line-height: 1.6; }

.card-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--brand);
}
.card-link svg { width: 15px; height: 15px; transition: transform .2s ease; }
a.card:hover .card-link svg { transform: translateX(3px); }

/* Cartes de contact */
.contact-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
}
.contact-item {
  padding: 20px 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.contact-item dt {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 8px;
}
.contact-item dd {
  font-size: 15.5px; color: var(--ink); line-height: 1.55;
  /* Une adresse e-mail ne se coupe pas toute seule : sur une colonne étroite elle
     déborderait de la carte. */
  overflow-wrap: break-word;
}
.contact-item dd + dd { margin-top: 3px; }
.contact-item .hint { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; display: block; }

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: 12px; max-width: 860px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.faq-item[open] { border-color: var(--border-2); box-shadow: var(--shadow-md); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 19px 58px 19px 22px;
  font-size: 16px;
  font-weight: 640;
  color: var(--ink);
  letter-spacing: -.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--brand); }
.faq-item summary::after {
  content: '';
  position: absolute;
  right: 24px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--ink-4);
  border-bottom: 2px solid var(--ink-4);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .22s ease, border-color .22s ease;
}
.faq-item[open] summary::after {
  transform: translateY(-25%) rotate(225deg);
  border-color: var(--brand);
}
.faq-body {
  padding: 0 22px 21px;
  color: var(--ink-2);
  font-size: 15.5px;
  overflow-wrap: break-word;
}
.faq-body p + p { margin-top: 10px; }

/* --------------------------------------------------------------------------
   12. Bandeau d'appel
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-xl);
  padding: clamp(34px, 5vw, 56px);
  color: #fff;
  background: var(--grad);
  box-shadow: var(--shadow-lg);
}
.cta-band::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(80% 140% at 88% 10%, rgba(255, 255, 255, .22) 0%, transparent 60%);
}
.cta-band h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.95rem);
  font-weight: 780;
  letter-spacing: -.028em;
  line-height: 1.18;
  color: #fff;
  max-width: 20ch;
}
.cta-band p {
  margin-top: 12px;
  color: rgba(255, 255, 255, .84);
  max-width: 56ch;
}
.cta-band .hero-actions { margin-top: 26px; }

/* Un bouton isolé dans un flux de prose respire davantage qu'un paragraphe. */
.prose .btn-row { margin-top: 20px; }
/* Précision rattachée à une cellule de tableau : plus petite que le corps de texte. */
.cell-note { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); }

/* Le bandeau clôt souvent une section : il se détache de ce qui précède sans
   qu'aucune page ait besoin d'un style en ligne. */
.cards + .cta-band,
.contact-grid + .cta-band,
.prose + .cta-band { margin-top: clamp(32px, 4vw, 48px); }

/* --------------------------------------------------------------------------
   13. Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: clamp(44px, 6vw, 68px) 0 32px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 44px; }
}

.footer-about p {
  margin-top: 16px;
  font-size: 14.5px;
  color: var(--ink-3);
  max-width: 42ch;
  line-height: 1.65;
}

.footer-col h2 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: grid; gap: 9px; }
.footer-col a, .footer-col span {
  font-size: 14.5px;
  color: var(--ink-3);
  font-weight: 500;
  overflow-wrap: break-word;
}
.footer-col a:hover { color: var(--brand); text-decoration: none; }

.footer-bottom {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-4);
}
.footer-bottom .loc { display: inline-flex; align-items: center; gap: 7px; }
.footer-bottom svg { width: 14px; height: 14px; opacity: .7; }

/* --------------------------------------------------------------------------
   14. Retour en haut
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: max(clamp(16px, 3vw, 28px), env(safe-area-inset-right));
  bottom: max(clamp(16px, 3vw, 28px), env(safe-area-inset-bottom));
  z-index: 40;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, color .18s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand); }
.to-top svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   15. Structure de page
   -------------------------------------------------------------------------- */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

/* --------------------------------------------------------------------------
   16. Adaptation aux écrans

   Les règles précédentes sont écrites pour le cas courant ; celles-ci corrigent
   ce que la mise en page automatique rate à des largeurs précises. Elles restent
   groupées ici pour qu'un changement de gabarit se relise d'un seul tenant.
   -------------------------------------------------------------------------- */

/* 16a. Petits téléphones (< 400 px) — récupérer de la largeur et de la hauteur */
@media (max-width: 399.98px) {
  .brand-text small { display: none; }
  .hero-stat { padding: 15px 17px; }
  .hero-stat dd { font-size: 16.5px; }
  .card { padding: 22px; }
  .contact-item { padding: 18px 19px; }
  .faq-item summary { padding: 17px 50px 17px 18px; font-size: 15.5px; }
  .faq-body { padding: 0 18px 19px; }
  .cta-band { border-radius: var(--r-lg); }
  .prose table { min-width: 380px; }
}

/* 16b. Deux boutons côte à côte deviennent illisibles sous 480 px : ils prennent
   toute la largeur plutôt que de se rétrécir au point de couper leur libellé. */
@media (max-width: 479.98px) {
  .hero-actions { gap: 10px; }
  .hero-actions .btn { width: 100%; }
}

/* 16c. Grilles dont le nombre de cartes est connu.
   `auto-fit` place 3 colonnes entre 1024 et 1180 px : une grille de quatre cartes
   s'y termine alors par une carte orpheline étirée sur toute la largeur. Deux
   colonnes égales se lisent mieux à ces largeurs. Les navigateurs sans `:has()`
   conservent le comportement `auto-fit`, qui reste correct. */
@media (min-width: 768px) and (max-width: 1179.98px) {
  .cards:has(> :nth-child(4):last-child),
  .contact-grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 16d. Tablette portrait — le sommaire est encore une rangée de puces et la
   colonne de texte est seule : centrer les deux évite un large vide à droite. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .doc { justify-items: center; }
  .doc > .toc, .doc > .prose { width: 100%; max-width: var(--prose); }
}

/* 16e. Pointeur tactile — cibles d'au moins 40 px, y compris sur une tablette
   large où la mise en page est celle du desktop. */
@media (pointer: coarse) {
  .toc-list a { padding-block: 11px; }
  .footer-col ul { gap: 2px; }
  .footer-col a { display: inline-flex; align-items: center; min-height: 40px; }
  .card-link { min-height: 40px; }
  .crumbs { gap: 10px; font-size: 14px; }
}

/* 16f. Paysage court — un téléphone tourné n'offre plus que ~360 px de hauteur :
   un en-tête collant et des sections aérées y consomment tout l'écran. */
@media (orientation: landscape) and (max-height: 520px) {
  .site-header { position: relative; }
  .hero { padding-block: 40px 34px; }
  .hero-stats { margin-top: 26px; }
  .page-hero { padding-block: 26px 22px; }
  .band { padding-block: 40px; }
  .doc { padding-block: 26px 40px; }
  .site-nav { max-height: calc(100vh - 84px); }
}

/* 16g. Grands écrans — au-delà de 1500 px, 1180 px de contenu laissent des marges
   démesurées. */
@media (min-width: 1500px) {
  :root { --wrap: 1280px; }
}

/* --------------------------------------------------------------------------
   17. Accessibilité — animations réduites
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:hover, a.card:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   18. Impression — les documents légaux doivent rester lisibles sur papier
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .toc, .to-top, .skip, .nav-toggle,
  .hero-actions, .cta-band, .meta-row .pill-accent { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.55; }
  .page-hero { background: none; border: 0; padding: 0 0 12pt; }
  .doc { display: block; padding: 0; }
  .prose { max-width: none; }
  .wrap { max-width: none; padding: 0; }
  .prose section { break-inside: avoid; }
  .prose h2 { break-after: avoid; }
  .prose h2 .num { background: none; color: #000; border: 1pt solid #000; }
  .prose a { color: #000; text-decoration: underline; }
  .prose a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #444; }
  .table-wrap, .callout, .card { box-shadow: none; }
}
