/* =====================================================================
   Keyflow — charte « Landing C » : clair, SaaS, accent bleu.

   Base fournie par la maquette, avec trois interventions :

   * `@import` vers fonts.googleapis.com retire. La CSP interdit tout
     hote tiers (`default-src 'none'`), et un @font-face distant ferait
     fuiter l'adresse IP de chaque visiteur vers Google. Les polices sont
     servies depuis /static/fonts/.
   * `--soft` assombri : #7b869c donnait 3,44:1 sur le fond de panneau,
     sous le seuil AA. C'est la couleur des petits textes.
   * Les regles absentes de la maquette sont ajoutees en fin de fichier :
     elle ne couvrait que les pages de la console, pas le site public.

   Toute couleur ajoutee doit passer scripts/check_contraste.py.
   ===================================================================== */

/* ------------------------------------------------------------- polices

   Quatre fichiers, 112 Ko. Space Grotesk et DM Sans sont des polices
   VARIABLES : un seul fichier couvre toutes leurs graisses — Google en
   sert quatre et deux URL distinctes, mais ce sont les memes octets,
   verifie par empreinte.

   Seul le sous-ensemble latin est embarque.
   -------------------------------------------------------------------- */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/space-grotesk-var.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/static/fonts/dm-sans-var.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/dm-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/dm-mono-500.woff2") format("woff2");
}

/* Keyflow — charte « Landing C » : clair, SaaS, accent bleu.
   Remplacement direct de static/app.css — aucun changement de markup. */

:root {
  --ink: #0c1424;
  --ink-2: #1b2436;
  --muted: #4d5872;
  --soft: #656f85;   /* etait #7b869c, a 3,44:1 sur --panel : sous AA */
  --line: #eef1f6;
  --line-2: #dde2eb;
  --panel: #f6f8fb;
  --bg: #ffffff;
  --accent: oklch(0.52 0.17 255);
  --accent-dark: oklch(0.44 0.17 255);
  --accent-soft: oklch(0.96 0.02 255);
  --accent-line: oklch(0.90 0.04 255);
  --ok: oklch(0.45 0.13 155);
  --ok-soft: oklch(0.96 0.03 155);
  --warn: oklch(0.52 0.13 75);
  --warn-soft: oklch(0.97 0.04 75);
  --danger: oklch(0.52 0.18 25);
  --danger-soft: oklch(0.97 0.03 25);
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "DM Mono", ui-monospace, "SF Mono", monospace;
  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 20px 40px -36px rgba(12, 20, 36, 0.35);
  --shadow-lg: 0 40px 80px -60px rgba(12, 20, 36, 0.5);

  /* Aplat inverse : les blocs de code, la carte de cle et l'offre mise en
     avant. Il lui faut sa PROPRE variable, pas `--ink` : en mode sombre
     `--ink` devient clair, et ces quatre surfaces seraient claires sur
     clair -- exactement le defaut de la cle blanche sur blanc, en pire
     puisqu'il toucherait quatre regles a la fois. */
  --inverse: #0c1424;
  --inverse-texte: #ffffff;
  --inverse-doux: #9aa6bd;
  --inverse-ligne: #2a3346;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.grain { display: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

code, pre, .mono { font-family: var(--mono); }

code {
  font-size: 0.88em;
  background: #f2f5f9;
  border-radius: 6px;
  padding: 2px 6px;
}

strong { font-weight: 500; color: var(--ink); }

::selection { background: oklch(0.90 0.06 255); }

/* ---------- en-têtes ---------- */

.masthead,
.publichead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.publichead { justify-content: space-between; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark__mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  flex: none;
}
.wordmark__thin { font-weight: 400; color: var(--muted); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14.5px;
}
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav a.is-current { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }

.masthead__account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.account__mail {
  font-size: 13px;
  color: var(--soft);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- structure ---------- */

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  display: block;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.pagehead--tight { margin-bottom: 20px; }

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pagetitle {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.pagetitle--key {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.04em;
}

.crumb { font-size: 13.5px; color: var(--soft); margin: 0 0 10px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.split--wide { grid-template-columns: 1.4fr 1fr; }
.stack { display: grid; gap: 16px; }

@media (max-width: 900px) {
  .split, .split--wide { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin: 0 0 16px;
}
.panel--acts { background: var(--panel); box-shadow: none; }

.panel__title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.muted { color: var(--muted); }
.hint { font-size: 14px; line-height: 1.65; color: var(--soft); }
.ta-r { text-align: right; }

/* ---------- compteurs ---------- */

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.tally__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.tally__cell--active { background: var(--panel); box-shadow: none; }
.tally__k {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.tally__n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.tally__of { font-size: 20px; color: var(--soft); font-weight: 500; }
.tally__sub { font-size: 13px; color: var(--soft); }

/* ---------- formulaires ---------- */

.sieve {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  margin: 0 0 20px;
}

.form, form.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 7px; }
.field--inline { min-width: 180px; }
.field--grow { flex: 1 1 220px; }

.field__label {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.field__label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.field__input,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  outline: none;
}
.field__input:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------- boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -16px var(--accent); }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }

.btn--ghost { background: var(--bg); border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

.btn--warn { background: var(--warn-soft); border-color: oklch(0.88 0.06 75); color: var(--warn); }
.btn--warn:hover { background: var(--warn); color: #fff; }

.btn--danger { background: var(--danger-soft); border-color: oklch(0.88 0.07 25); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }

.btn--sm { font-size: 13px; padding: 8px 13px; }
.btn--block { width: 100%; }

.rowbtns, .rowgo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rowgo { justify-content: flex-end; }

/* ---------- tableaux ---------- */

.ledger {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 14.5px;
}
.ledger--inner { border-radius: var(--r); box-shadow: none; }

.ledger th {
  text-align: left;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  background: var(--panel);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}
.ledger tbody tr:last-child td { border-bottom: none; }
.ledger tbody tr:hover td { background: #fbfcfe; }

.keylink {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.keylink:hover { color: var(--accent); }

/* ---------- états ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--soft);
  white-space: nowrap;
}
.chip--active { background: var(--ok-soft); border-color: oklch(0.88 0.06 155); color: var(--ok); }
.chip--suspended { background: var(--warn-soft); border-color: oklch(0.88 0.06 75); color: var(--warn); }
.chip--revoked { background: var(--danger-soft); border-color: oklch(0.88 0.07 25); color: var(--danger); }
.chip--expired { background: var(--panel); border-color: var(--line-2); color: var(--soft); }

td .is-on, .facts .is-on, .panel > .is-on { color: var(--ok); }

/* ---------- coffre / clés ---------- */

.vault {
  background: var(--inverse);
  color: var(--inverse-texte);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-lg);
}
.vault--hero { padding: 34px 36px; }

.vault__label {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7b87a3;   /* 5,11:1 sur --ink ; etait #6b7793, a 4,11:1 */
}
.vault__key {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.05em;
  color: #fff;
  word-break: break-all;
}
.vault__key--hero { font-size: 36px; }
.vault__key--token { font-size: 15px; letter-spacing: 0.02em; line-height: 1.6; }

.vault__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.vault__warn {
  flex: 1 1 320px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #94a0ba;
}
.vault__warn strong { color: #fff; }
.vault .btn--primary { box-shadow: none; }
.vault code { background: #1e2a41; color: #d5dbe8; }

/* ---------- créneaux ---------- */

.slots { display: inline-flex; align-items: center; gap: 10px; }
.slots__bar { display: inline-flex; gap: 3px; }
.slots__bar i {
  display: block;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
}
.slots__bar i.is-on { background: var(--accent); }
.slots--full .slots__bar i.is-on { background: var(--danger); }
.slots__count { font-size: 13px; color: var(--soft); font-family: var(--display); font-weight: 500; }

/* ---------- listes de faits ---------- */

.facts { margin: 0; display: grid; grid-template-columns: minmax(140px, 200px) 1fr; }
.facts dt {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.facts dd {
  margin: 0;
  padding: 11px 0;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.facts dt:first-of-type, .facts dd:first-of-type { border-top: none; }

/* ---------- code ---------- */

.snippet {
  margin: 0 0 16px;
  background: var(--inverse);
  color: #d5dbe8;
  border-radius: var(--r);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
}
.snippet code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ---------- référence API ---------- */

.endpoint__list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.endpoint {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}
.endpoint__line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.endpoint__path { font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
.endpoint__label {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.endpoint__summary { font-size: 15px; color: var(--ink); margin: 8px 0 0; }
.endpoint__desc { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.verb {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  flex: none;
}
.verb--get { background: var(--accent-soft); color: var(--accent-dark); }
.verb--post { background: var(--ok-soft); color: var(--ok); }
.verb--patch { background: var(--warn-soft); color: var(--warn); }
.verb--delete { background: var(--danger-soft); color: var(--danger); }

/* ---------- offres ---------- */

.offer {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.offer__name {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 12px;
}
.offer__price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
}
.offer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; color: var(--muted); }
.offer__list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.offer__list li:last-child { border-bottom: none; padding-bottom: 0; }

/* ---------- vide / 404 ---------- */

.void { text-align: center; padding: 96px 24px; }
.void__code {
  font-family: var(--display);
  font-weight: 700;
  font-size: 88px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent);
  margin: 0 0 12px;
}
.void__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.void__body { color: var(--muted); margin: 0 0 24px; }

/* ---------- pied ---------- */

.colophon {
  border-top: 1px solid var(--line);
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--soft);
}
.colophon a { color: var(--soft); }
.colophon a:hover { color: var(--ink); }
.dot { color: var(--soft); }   /* etait --line-2, a 1,30:1 : invisible */


/* =====================================================================
   Ce que la maquette ne couvrait pas
   ---------------------------------------------------------------------
   Le designer a restyle les onze pages de la CONSOLE. Restaient sans
   regles : neuf etats de la console qu'aucune de ces pages ne montrait,
   et l'ensemble du SITE PUBLIC — vitrine, documentation, connexion,
   page de l'acheteur.

   Tout ici emprunte le vocabulaire de la maquette : `var(--display)`
   pour les libelles, `var(--line)` pour les filets, `var(--r)` pour les
   arrondis. Aucune couleur nouvelle n'est introduite.
   ===================================================================== */

/* ------------------------------------------------ etats de la console */

/* Messages apres action. Aucune des pages capturees n'en portait : elles
   ont ete prises apres un GET, jamais apres une redirection. */
.flash {
  margin: 0 0 20px;
  padding: 11px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.flash--ok  { background: var(--ok-soft);     border-color: var(--ok);     color: var(--ok); }
.flash--err { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* Encart d'avertissement, au fil du texte. */
.notice {
  padding: 14px 16px;
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: 14px;
  line-height: 1.65;
}

.paginate {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* Le quota ne se colore qu'en approchant : une carte teintee en
   permanence ne signale plus rien. */
.tally__cell--tight .tally__n { color: var(--warn); }
.tally__cell--full  .tally__n { color: var(--danger); }

.verb--put { background: var(--warn-soft); color: var(--warn); }

/* Machine liberee : le creneau est rendu, la ligne reste consultable. */
.is-released { color: var(--soft); text-decoration: line-through; }

/* ===================================================================== */
/*                            SITE PUBLIC                                */
/* ===================================================================== */

/* ------------------------------------------------------------- heros */

.hero__title {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
/* La seconde ligne s'eclaircit : c'est la respiration de la phrase. */
.hero__title em { font-style: normal; color: var(--soft); }

.hero__lede {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 48ch;
}
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.hero__note { margin-top: 18px; font-size: 13.5px; }

/* ------------------------------------------------------ sections ouvertes */
/* Pas de cadre : la vitrine se lit d'une traite, un empilement de boites
   la hacherait. Un filet fin suffit a separer. */

.bloc {
  border-top: 1px solid var(--line);
  padding: 52px 0 12px;
}
.bloc:first-of-type { border-top: 0; }

.bloc--cote {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  gap: 32px;
  align-items: start;
}

.bloc__titre {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.bloc--cote .bloc__titre { margin-bottom: 0; }

.bloc p { color: var(--muted); max-width: 64ch; }

/* --------------------------------------------------- grille de fonctions */

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  padding: 22px 24px 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-width: 0;
}
.card__name {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.card__body { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.card__body + .card__body { margin-top: 12px; }

/* ------------------------------------------------------------- tarifs */

.prices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.price__unit { font-family: var(--mono); font-size: 12px; color: var(--soft); }
.price__rows { margin: 0; }
.price__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.price__row dt { color: var(--muted); }
.price__row dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* L'offre payante est inversee : c'est le seul aplat sombre de la page,
   et il la designe sans etiquette « recommande ». */
.offer--phare { background: var(--inverse); border-color: var(--ink); color: #fff; }
.offer--phare .offer__name,
.offer--phare .price__row dt,
.offer--phare .price__unit { color: #9aa6bd; }          /* 6,98:1 sur --ink */
.offer--phare .offer__price,
.offer--phare .price__row dd { color: #fff; }
.offer--phare .price__row { border-top-color: #2a3346; }

/* --------------------------------------------------------- etiquettes */

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------ connexion et inscription */

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  max-width: 900px;
  margin: 7vh auto 0;
}
.auth__aside {
  padding: 24px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.gate__brand { text-align: center; margin-bottom: 30px; }
.gate__mark { color: var(--accent); font-size: 12px; display: block; margin-bottom: 12px; }
.gate__name {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.16em;
}
.gate__tag { margin: 0; color: var(--soft); font-size: 13.5px; }
.gate__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 26px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.gate__note { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.gate__plan-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.gate__plan-body { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* Onglets : deux liens, pas de composant a bascule. La page sait deja
   laquelle des deux elle est. */
.tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 16px;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-current { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------------------------- sommaire de documentation */

.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.toc__title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.toc__list { margin: 0; padding: 0; list-style: none; }
.toc__list li { margin-bottom: 9px; }
.toc__list a { color: var(--muted); font-size: 14px; }
.toc__list a:hover { color: var(--accent); }

/* ---------------------------------------------------- etapes numerotees */

.step { display: flex; gap: 20px; margin-bottom: 30px; }
.step__n {
  flex: 0 0 auto;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step__body { min-width: 0; flex: 1 1 auto; }
.step__title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
}

/* --------------------------------------------------- page de l'acheteur */
/* Vue par le CLIENT de notre client, qui n'a pas de compte Keyflow et
   n'en aura jamais. */

.buy { max-width: 660px; margin: 6vh auto 0; }
.buy__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.buy__vendor {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.buy__tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.buy__tip {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.buy__tip-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
}
.buy__tip-body { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.buy__foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--soft);
}

/* --------------------------------------------------- tableaux de la vitrine */

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
  border-bottom: 1px solid var(--line-2);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { white-space: nowrap; width: 1%; padding-right: 20px; }

/* Blocs de code de la vitrine et de la documentation : sombres, pour se
   detacher de la prose. */
pre.code {
  margin: 0 0 16px;
  padding: 18px 20px;
  background: var(--inverse);
  border-radius: var(--r);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e6ebf4;                                        /* 15,3:1 sur --ink */
}
pre.code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Lien au fil d'un paragraphe : il ne doit pas se distinguer par la
   seule couleur. Les boutons et la navigation portent deja leur propre
   signal, les souligner alourdirait. */
.bloc p a, .muted a, .card__body a, .endpoint__list a, .colophon a, .gate__note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bloc p a.btn, .muted a.btn { text-decoration: none; }

/* ------------------------------------------------------------- etroit */

@media (max-width: 900px) {
  .cards, .prices, .buy__tips { grid-template-columns: 1fr; }
  .bloc--cote { grid-template-columns: 1fr; gap: 14px; }
  .bloc--cote .bloc__titre { margin-bottom: 8px; }
  /* Le panneau explicatif passe SOUS le formulaire : sur un telephone,
     c'est le champ de saisie qu'on veut voir en premier. */
  .auth { grid-template-columns: 1fr; gap: 22px; margin-top: 4vh; }
  .auth__aside { order: 2; }
  .toc { position: static; }
  .bloc { padding-top: 36px; }
}

/* La classe .vault__key sert AUSSI hors de la carte sombre : le panneau
   de la page de connexion affiche `kf_live_…` avec elle, sur fond clair.
   Colore en blanc par la regle generale, ce texte tombait a 1,06:1 —
   invisible.

   Exactement le meme defaut qu'avant la refonte, reintroduit par le
   remplacement de la feuille. C'est pourquoi le balayage navigateur
   compte : il mesure chaque texte contre son fond reel, la ou une
   matrice de variables ne voit qu'une palette coherente. */
.auth__aside .vault__key { color: var(--ink); }


/* =====================================================================
   MODE SOMBRE
   ---------------------------------------------------------------------
   Une seule chose bascule : les variables. Aucun composant n'est
   duplique, aucune regle n'est reecrite -- c'est tout l'interet d'avoir
   fait passer les quatre aplats inverses par `--inverse` plutot que par
   `--ink`, qui change de camp d'un theme a l'autre.

   Le theme est porte par `data-theme` sur <html>, pose par
   /static/theme.js AVANT le rendu. Le bloc `prefers-color-scheme`
   couvre le visiteur qui n'a jamais choisi : son systeme decide.

   Toutes les valeurs ci-dessous passent AA sur les DEUX fonds sombres,
   verifie par scripts/check_contraste.py.
   ===================================================================== */

:root[data-theme="dark"] {
  --ink:        #e9edf5;   /* 16,24:1 sur --bg */
  --ink-2:      #cdd5e3;   /* 12,90:1 */
  --muted:      #a3aec2;   /*  8,52:1 */
  --soft:       #8792a6;   /*  6,07:1 */

  --line:       #1e2632;
  --line-2:     #2b3543;
  --panel:      #141a24;
  --bg:         #0c1017;

  /* L'accent s'eclaircit : le bleu de la palette claire, pose sur du
     sombre, tombe a 2,6:1. Une couleur d'accent ne se transpose jamais
     telle quelle d'un theme a l'autre. */
  --accent:      oklch(0.72 0.15 255);   /* 7,67:1 */
  --accent-dark: oklch(0.80 0.12 255);   /* survol : plus CLAIR ici */
  --accent-soft: oklch(0.26 0.05 255);
  --accent-line: oklch(0.38 0.08 255);

  --ok:     oklch(0.74 0.16 155);   /* 8,86:1 */
  --ok-soft:     oklch(0.26 0.05 155);
  --warn:   oklch(0.80 0.13 75);    /* 10,03:1 */
  --warn-soft:   oklch(0.27 0.05 75);
  --danger: oklch(0.70 0.17 25);    /* 6,63:1 */
  --danger-soft: oklch(0.26 0.06 25);

  /* Sur fond sombre, un aplat inverse ne peut pas etre plus sombre : il
     disparaitrait (1,04:1 avec le fond de page). Il est donc SURELEVE,
     avec une bordure pour le detacher. */
  --inverse:       #161d29;
  --inverse-texte: #ffffff;   /* 16,91:1 */
  --inverse-doux:  #9aa6bd;   /*  6,90:1 */
  --inverse-ligne: #2f3a4c;

  --shadow:    0 20px 40px -36px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 80px -60px rgba(0, 0, 0, .9);
}

/* Le visiteur qui n'a jamais touche au bouton suit son systeme. Le
   selecteur exclut `light` : sans cela, un choix explicite pour le clair
   serait ecrase par un systeme regle en sombre. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9edf5;  --ink-2: #cdd5e3;  --muted: #a3aec2;  --soft: #8792a6;
    --line: #1e2632; --line-2: #2b3543; --panel: #141a24;  --bg: #0c1017;
    --accent: oklch(0.72 0.15 255);      --accent-dark: oklch(0.80 0.12 255);
    --accent-soft: oklch(0.26 0.05 255); --accent-line: oklch(0.38 0.08 255);
    --ok: oklch(0.74 0.16 155);     --ok-soft: oklch(0.26 0.05 155);
    --warn: oklch(0.80 0.13 75);    --warn-soft: oklch(0.27 0.05 75);
    --danger: oklch(0.70 0.17 25);  --danger-soft: oklch(0.26 0.06 25);
    --inverse: #161d29;      --inverse-texte: #ffffff;
    --inverse-doux: #9aa6bd; --inverse-ligne: #2f3a4c;
    --shadow: 0 20px 40px -36px rgba(0, 0, 0, .8);
    --shadow-lg: 0 40px 80px -60px rgba(0, 0, 0, .9);
  }
}

/* Quelques valeurs etaient ecrites en dur, pensees pour le fond blanc. */
:root[data-theme="dark"] .masthead,
:root[data-theme="dark"] .publichead {
  background: rgba(12, 16, 23, .88);
}
:root[data-theme="dark"] code { background: #1a212c; }
:root[data-theme="dark"] ::selection { background: oklch(0.40 0.10 255); }
:root[data-theme="dark"] .btn--primary { color: #0c1017; }
:root[data-theme="dark"] .vault { border: 1px solid var(--inverse-ligne); }
:root[data-theme="dark"] pre.code { border: 1px solid var(--inverse-ligne); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .masthead,
  :root:not([data-theme="light"]) .publichead { background: rgba(12, 16, 23, .88); }
  :root:not([data-theme="light"]) code { background: #1a212c; }
  :root:not([data-theme="light"]) ::selection { background: oklch(0.40 0.10 255); }
  :root:not([data-theme="light"]) .btn--primary { color: #0c1017; }
  :root:not([data-theme="light"]) .vault { border: 1px solid var(--inverse-ligne); }
  :root:not([data-theme="light"]) pre.code { border: 1px solid var(--inverse-ligne); }
}

/* ------------------------------------------------------ bouton de theme */

.bascule {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--panel);
}
.bascule__choix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: 0;
  border-radius: 100px;
  background: none;
  color: var(--soft);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.bascule__choix:hover { color: var(--ink); }
.bascule__choix[aria-pressed="true"] {
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
/* Le contour de focus doit rester visible sur les deux themes : c'est le
   seul repere d'un utilisateur au clavier. */
.bascule__choix:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
