/* ============================================================
   METHODIA : feuille de style
   Sous-domaine de solicare.fr, conforme au REFERENTIEL-SOLICARE
   (palette, Hanken Grotesk auto-hebergee, echelle 4/8, grille 12).
   Aucune ressource externe. Aucun tiret cadratin dans le contenu.
   Principe visuel : la sequence. Le numero d'etape est le seul
   repere graphique, il n'y a aucune icone decorative.
   ============================================================ */

/* --- Polices auto-hebergees (RGPD : aucun CDN) --- */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-700.woff2") format("woff2");
}

/* ============================================================
   1. Tokens
   ============================================================ */

:root {
  /* Couleurs, referentiel Solicare section 2 */
  --bg:           #F2F3F5;
  --surface:      #FFFFFF;
  --surface-alt:  #F7F8FA;
  --ink:          #191D24;
  --ink-muted:    #575E68;
  --ink-invert:   #F4F6F9;
  --accent:       #2A4C7D;
  --accent-hover: #1F3A61;
  --accent-soft:  #E6EBF3;
  --success:      #3A6B4E;
  --success-soft: #E5EEE9;
  --warning:      #8A6212;
  --warning-soft: #F2ECDC;
  --risk:         #9B3232;
  --risk-soft:    #F2E4E2;
  --line:         #DFE1E6;
  --line-strong:  #C6CAD2;
  --line-faint:   #EAECF0;

  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Espacement 4 / 8 */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 6rem;
  --s10: 8rem;

  /* Largeurs : en px pour rester previsibles malgre la typo fluide */
  --wrap: 1200px;
  --wrap-wide: 1440px;
  --wrap-narrow: 820px;
  --measure: 68ch;
  --gutter: 24px;

  --radius-s: 4px;
  --radius-m: 8px;

  --shadow-raise: 0 1px 2px rgba(21, 25, 32, 0.05);
  --shadow-pop: 0 4px 16px rgba(21, 25, 32, 0.08);

  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
  --fast: 120ms;
  --base: 200ms;

  --header-h: 72px;
}

/* ============================================================
   2. Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  /* 16 px a 390 px de large, 19 px a 2560 px */
  font-size: clamp(1rem, 0.966rem + 0.138vw, 1.1875rem);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3, h4 { font-weight: 600; line-height: 1.3; }
h2 { line-height: 1.3; }

p, ul, ol, dl { margin: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s7) 0;
}

/* ============================================================
   3. Structure
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s5);
}
.wrap--wide { max-width: var(--wrap-wide); }
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--s8); }
.section--tight { padding-block: var(--s7); }
.section--loose { padding-block: var(--s9); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.section--alt { background: var(--surface-alt); border-block: 1px solid var(--line-faint); }
.section--ink { background: var(--ink); color: var(--ink-invert); }
.section--ink h2, .section--ink h3 { color: var(--ink-invert); }
.section--ink .lede, .section--ink .muted { color: #B7BDC6; }

@media (min-width: 48em) {
  .section { padding-block: var(--s9); }
  .section--tight { padding-block: var(--s8); }
  .section--loose { padding-block: var(--s10); }
}

.measure { max-width: var(--measure); }

/* Grille 12 colonnes, gouttiere 24 px */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

/* ============================================================
   4. Typographie utilitaire
   ============================================================ */

.hero-title { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4rem); }
.h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.h2 { font-size: clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem); }
.h3 { font-size: clamp(1.3125rem, 1.2rem + 0.5vw, 1.75rem); font-weight: 600; }
.h4 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  color: var(--ink-muted);
  line-height: 1.6;
}
.muted { color: var(--ink-muted); }
.small { font-size: 0.875rem; line-height: 1.5; }
.micro { font-size: 0.75rem; font-weight: 500; line-height: 1.5; }

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Le seul marqueur de rubrique : un mot sur une ligne, pas de capitale interlettree */
.rubric {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: var(--s3);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}

.stack > * + * { margin-top: var(--s4); }
.stack-s > * + * { margin-top: var(--s2); }
.stack-l > * + * { margin-top: var(--s6); }
.stack-xl > * + * { margin-top: var(--s7); }

/* ============================================================
   5. En-tete
   ============================================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 243, 245, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--base) var(--ease), background var(--base) var(--ease);
}
.header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(242, 243, 245, 0.97);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.25rem;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 20px; height: 20px; align-self: center; flex: none; }
.brand__sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.nav { display: none; align-items: center; gap: var(--s5); }
/* :not(.btn) : sans cela, .nav a l'emporterait sur .btn--primary
   et le bouton de la barre perdrait sa couleur de texte. */
.nav a:not(.btn) {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding-block: var(--s2);
  border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a:not(.btn)[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Bascule de langue */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  white-space: nowrap;
}
.lang:hover { color: var(--ink); border-color: var(--ink-muted); }
.nav .lang { margin-left: calc(-1 * var(--s2)); }
.nav-panel .lang { display: inline-flex; margin-top: var(--s3); border-bottom: 1px solid var(--line-strong); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--ink-muted); }

.nav-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: var(--s4);
}
.nav-panel.is-open { display: block; }
.nav-panel a {
  display: block;
  padding: var(--s3) 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--line-faint);
}
.nav-panel a:last-child { border-bottom: 0; }

@media (min-width: 60em) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .nav-panel { display: none !important; }
}

/* ============================================================
   6. Boutons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn--primary { background: var(--accent); color: #FFFFFF; }
.btn--primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink-muted); color: var(--ink); }
.btn--invert { background: var(--ink-invert); color: var(--ink); }
.btn--invert:hover { background: #FFFFFF; color: var(--ink); }
.btn--outline-invert { background: transparent; color: var(--ink-invert); border-color: #4A515C; }
.btn--outline-invert:hover { border-color: var(--ink-invert); color: var(--ink-invert); }
.btn--small { padding: 0.45rem 0.8rem; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

/* Chevron typographique, pas de fleche SVG */
.btn .chev { font-weight: 400; }

/* ============================================================
   7. Hero
   ============================================================ */

.hero { padding-top: var(--s8); padding-bottom: var(--s8); }
@media (min-width: 48em) {
  .hero { padding-top: var(--s9); padding-bottom: var(--s9); }
}
.hero__kicker {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--s4);
}
.hero__title { max-width: 20ch; }
.hero__lede { max-width: 60ch; margin-top: var(--s5); font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); }
.hero__actions { margin-top: var(--s6); }
.hero__note { margin-top: var(--s5); }

/* ============================================================
   8. La sequence : rail des cinq etapes
   ============================================================ */

.steps { counter-reset: step; }

.step {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: var(--s4);
  position: relative;
  padding-bottom: var(--s6);
}
.step:last-child { padding-bottom: 0; }

.step__num {
  grid-column: 1;
  position: relative;
  display: flex;
  justify-content: center;
}
.step__num span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.9375rem;
  font-weight: 700;
  flex: none;
}
/* Le trait de sequence */
.step:not(:last-child) .step__num::after {
  content: "";
  position: absolute;
  top: 2.25rem;
  bottom: calc(-1 * var(--s6));
  left: 50%;
  width: 1px;
  background: var(--line-strong);
  transform: translateX(-0.5px);
}
.step__body { grid-column: 2; padding-top: 0.15rem; }
.step__title { margin-bottom: var(--s2); }
.step__text { color: var(--ink-muted); max-width: var(--measure); }

@media (min-width: 48em) {
  .step { grid-template-columns: 3.5rem minmax(0, 1fr); gap: var(--s5); padding-bottom: var(--s7); }
  .step:not(:last-child) .step__num::after { bottom: calc(-1 * var(--s7)); }
}

/* Bandeau de phase */
.phase {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s3) var(--s4);
  padding-bottom: var(--s4);
  margin-bottom: var(--s6);
  border-bottom: 2px solid var(--ink);
}
.phase__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--ink-invert);
  font-size: 0.75rem;
  font-weight: 700;
  align-self: center;
}
.phase__t { font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.phase__q { color: var(--ink-muted); font-size: 0.9375rem; width: 100%; max-width: var(--measure); }

/* Jalon entre deux phases */
.gate {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
  padding: var(--s5) 0;
  margin: var(--s6) 0;
  border-block: 1px solid var(--line);
  background: var(--accent-soft);
  border-radius: var(--radius-s);
  padding-inline: var(--s5);
}
.gate__mark {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.gate__t { font-weight: 600; margin-bottom: var(--s2); }
.gate__d { font-size: 0.9375rem; color: var(--ink-muted); }
@media (max-width: 40em) {
  .gate { grid-template-columns: 1fr; gap: var(--s2); }
}

/* Variante detaillee, page methode */
.step-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s5);
  box-shadow: var(--shadow-raise);
}
@media (min-width: 48em) {
  .step-detail { padding: var(--s6); }
}
.step-detail__head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding-bottom: var(--s4);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.step-detail__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.0625rem;
  flex: none;
}

.facts {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid var(--line-faint);
}
@media (min-width: 48em) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
}
.fact__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: var(--s2);
}
.fact__value { font-size: 0.9375rem; line-height: 1.5; }

.pitfall {
  margin-top: var(--s5);
  padding: var(--s4);
  background: var(--warning-soft);
  border-radius: var(--radius-s);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.pitfall strong { color: var(--warning); }

/* ============================================================
   9. Cartes et listes
   ============================================================ */

.cards {
  display: grid;
  gap: var(--s5);
}
@media (min-width: 40em) { .cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56em) { .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 40em) { .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s5);
  box-shadow: var(--shadow-raise);
}
.card--plain { background: transparent; border: 0; box-shadow: none; padding: 0; }
.card--alt { background: var(--surface-alt); }
.card__title { margin-bottom: var(--s3); }
.card__text { color: var(--ink-muted); font-size: 0.9375rem; line-height: 1.6; }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--base) var(--ease), box-shadow var(--base) var(--ease), transform var(--base) var(--ease);
}
.card-link:hover {
  color: inherit;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-pop);
}
.card-link .card__more { color: var(--accent); font-weight: 600; font-size: 0.9375rem; }

/* Liste a filet, sans puce ronde */
.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li {
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
}
.rule-list li:last-child { border-bottom: 1px solid var(--line); }
.rule-list--tight li { padding: var(--s3) 0; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--s3);
  line-height: 1.55;
}
.check-list li::before {
  content: "\203A";
  position: absolute;
  left: 0;
  top: -0.05em;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1.4;
}
.check-list--no li::before { content: "\2212"; color: var(--ink-muted); font-size: 1rem; }

/* Chiffres de terrain */
.figures {
  display: grid;
  gap: var(--s5);
}
@media (min-width: 40em) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.figure__n {
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.figure__t { color: var(--ink-muted); font-size: 0.9375rem; margin-top: var(--s2); line-height: 1.5; }
.section--ink .figure__t { color: #B7BDC6; }

/* Bloc de citation sobre */
.pull {
  border-left: 0;
  padding: var(--s5) 0;
  margin: 0;
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 32ch;
}

/* Deux colonnes texte + aparte */
.split { display: grid; gap: var(--s6); }
@media (min-width: 56em) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s8); align-items: start; }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--sticky > :last-child { position: sticky; top: calc(var(--header-h) + var(--s5)); }
}

.aside-box {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s5);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Sommaire de page */
.toc { list-style: none; padding: 0; margin: 0; }
.toc li { border-top: 1px solid var(--line); }
.toc li:last-child { border-bottom: 1px solid var(--line); }
.toc a {
  display: flex;
  gap: var(--s4);
  padding: var(--s3) 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
}
.toc a:hover { color: var(--accent); }
.toc .toc__n { color: var(--accent); font-weight: 700; min-width: 1.1rem; }

/* ============================================================
   10. Tableau
   ============================================================ */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
  min-width: 34rem;
}
table.data th, table.data td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
   11. Constructeur de grille
   ============================================================ */

.builder {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-raise);
  overflow: hidden;
}
.builder__head {
  padding: var(--s5);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}
.builder__body { padding: var(--s5); }
.builder__foot {
  padding: var(--s5);
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 48em) {
  .builder__head, .builder__body, .builder__foot { padding: var(--s6); }
}

.field { margin-bottom: var(--s5); }
.field > label,
.fieldset > legend {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--s2);
  padding: 0;
}
.field__hint { font-size: 0.8125rem; color: var(--ink-muted); margin-bottom: var(--s3); }

input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 0.55rem 0.7rem;
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { min-height: 6.5rem; resize: vertical; line-height: 1.5; }

.fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); }

.crit-list { list-style: none; padding: 0; margin: 0; }
.crit-head {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  padding: var(--s5) 0 var(--s2);
  border-top: 1px solid var(--line);
  margin-top: var(--s3);
}
.crit-head:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.crit-head + .crit { border-top: 0; }
.crit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s3) var(--s3);
  align-items: start;
  padding: var(--s4) 0;
  border-top: 1px solid var(--line-faint);
}
.crit:first-child { border-top: 0; }
.crit__check { padding-top: 0.15rem; }
.crit__check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }
.crit__main { min-width: 0; }
.crit__name { font-weight: 600; font-size: 0.9375rem; }
.crit__desc { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.5; margin-top: 0.15rem; }
.crit__weight {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s2);
}
.crit__weight input[type="range"] { flex: 1; max-width: 15rem; accent-color: var(--accent); }
.crit__weight output {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 2.5rem;
}
.crit.is-off { opacity: 0.45; }
.crit.is-off .crit__weight { pointer-events: none; }

.custom-row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.custom-row input[type="text"] { flex: 1; min-width: 12rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.35rem 0.25rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.chip button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  opacity: 0.7;
}
.chip button:hover { opacity: 1; }

.status { font-size: 0.875rem; color: var(--ink-muted); }
.status.is-ok { color: var(--success); font-weight: 600; }
.status.is-warn { color: var(--warning); font-weight: 600; }

.preview-box {
  margin-top: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-alt);
  padding: var(--s4);
  font-size: 0.8125rem;
  overflow-x: auto;
}
.preview-box pre { margin: 0; white-space: pre; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; line-height: 1.6; }

/* ============================================================
   12. Schema de la sequence (SVG inline)
   ============================================================ */

.schema {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s5);
  box-shadow: var(--shadow-raise);
}
.schema svg { width: 100%; height: auto; }
.schema__cap { font-size: 0.8125rem; color: var(--ink-muted); margin-top: var(--s4); }

/* Le schéma horizontal devient illisible en dessous de 1024 px :
   on lui substitue une version compacte en texte. */
.schema__svg { display: none; }
@media (min-width: 64em) {
  .schema__svg { display: block; }
  .schema-lite { display: none; }
}

.schema-lite__seq {
  list-style: none;
  counter-reset: lite;
  padding: 0;
  margin: 0;
}
.schema-lite__seq li {
  counter-increment: lite;
  position: relative;
  padding: var(--s2) 0 var(--s2) 2.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
}
.schema-lite__seq li::before {
  content: counter(lite);
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.schema-lite__seq li span {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.schema-lite__loop {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--accent-soft);
  border-radius: var(--radius-s);
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
}
.schema-lite__out {
  list-style: none;
  padding: 0;
  margin: var(--s3) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.schema-lite__out li {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================================
   13. Appel a l'action
   ============================================================ */

.cta {
  background: var(--ink);
  color: var(--ink-invert);
  border-radius: var(--radius-m);
  padding: var(--s6);
}
@media (min-width: 48em) { .cta { padding: var(--s8); } }
.cta h2 { color: var(--ink-invert); max-width: 22ch; }
.cta p { color: #B7BDC6; max-width: 56ch; }

/* ============================================================
   14. Pied de page
   ============================================================ */

.footer {
  background: var(--ink);
  color: #B7BDC6;
  padding-block: var(--s7);
  font-size: 0.9375rem;
}
.footer a { color: var(--ink-invert); text-decoration: none; }
.footer a:hover { color: #FFFFFF; text-decoration: underline; }
.footer__grid { display: grid; gap: var(--s6); }
@media (min-width: 48em) {
  .footer__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); }
}
.footer__brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-invert); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; text-decoration: none; }
.footer__brand img { width: 18px; height: 18px; }
.footer__title { color: var(--ink-invert); font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--s3); }
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: var(--s2); }
.footer__legal {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid #2E343D;
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  justify-content: space-between;
}

/* ============================================================
   15. Pages de texte legal
   ============================================================ */

.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem); margin-top: var(--s7); margin-bottom: var(--s4); }
.prose h3 { font-size: 1.125rem; margin-top: var(--s5); margin-bottom: var(--s2); }
.prose p, .prose ul { margin-bottom: var(--s4); }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: var(--s2); }
.prose dl { margin-bottom: var(--s4); }
.prose dt { font-weight: 600; margin-top: var(--s3); }
.prose dd { margin: 0; color: var(--ink-muted); }

/* ============================================================
   16. Divers
   ============================================================ */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
}
.pager a { text-decoration: none; font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  color: var(--accent);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .header, .footer, .cta, .nav-panel, .btn { display: none !important; }
  body { background: #FFFFFF; }
  .card, .step-detail, .builder { box-shadow: none; }
}
