/* ZéroNC — système visuel.
   Papier, encre, bleu d'action, vermillon réservé aux écarts. Angles nets, filets fins,
   une seule ombre : celle des feuilles posées sur la table. */

:root {
  color-scheme: light;

  /* Couleurs */
  --paper: #f3f2ed;          /* fond de page */
  --paper-2: #e9e7df;        /* sections de travail */
  --sheet: #fcfbf8;          /* feuilles, champs, documents */
  --ink: #15171f;            /* texte, filets forts, sections sombres */
  --ink-2: #474b58;          /* texte secondaire */
  --ink-3: #5f6370;          /* légendes (AA sur --paper) */
  --rule: #cdcac0;           /* filets */
  --rule-2: #dedbd2;         /* filets légers */
  --blue: #23389a;           /* action, insertions 2026 */
  --blue-hover: #1a2b78;
  --blue-soft: #dfe3f1;
  --red: #b5301a;            /* écarts, non-conformités : rien d'autre */
  --red-soft: #f5ddd5;
  --ok: #2c6a45;
  --ok-soft: #dcebe0;
  --warn: #8e5a0e;
  --warn-fill: #d9a43c;
  --warn-soft: #f3e6c9;
  --on-ink: #eceae3;
  --on-ink-2: #a9abb3;

  /* Typographie */
  --f-serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-sc: "Spectral SC", "Spectral", Georgia, serif;
  --f-sans: "Schibsted Grotesk", "Helvetica Neue", "Segoe UI", Arial, sans-serif;

  /* Espacements (base 8) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* Formes */
  --r: 2px;
  --line: 1px solid var(--rule);
  --line-ink: 1px solid var(--ink);
  --sheet-shadow: 0 1px 0 var(--rule), 0 22px 40px -28px rgba(21, 23, 31, .45);

  /* Grille */
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .18s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
sup { line-height: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--blue); }
::selection { background: var(--blue-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Texte ---------- */
.sc { font-family: var(--f-sc); font-weight: 500; letter-spacing: .05em; font-size: 15px; line-height: 1.3; font-variant-numeric: lining-nums; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.serif { font-family: var(--f-serif); }
.muted { color: var(--ink-3); }
.fn { font-family: var(--f-sans); font-size: .62em; font-weight: 600; vertical-align: super; margin-left: 1px; color: var(--ink-3); text-decoration: none; }
.fn:hover { color: var(--blue); }

/* ---------- Marque ---------- */
.brand { display: inline-flex; align-items: baseline; gap: 1px; text-decoration: none; color: var(--ink); line-height: 1; }
.brand:hover { color: var(--ink); }
.brand-z { font-family: var(--f-serif); font-weight: 500; font-size: 25px; letter-spacing: -.01em; }
.brand-nc {
  position: relative; font-family: var(--f-sans); font-weight: 700; font-size: 17px; letter-spacing: .06em;
  margin-left: 3px; padding-inline: 1px;
}
.brand-nc::after {
  content: ""; position: absolute; left: -3px; right: -2px; top: 44%; height: 2.5px;
  background: var(--red); transform: rotate(-14deg);
}
.fn-sep { font-size: .62em; vertical-align: super; color: var(--ink-3); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r); border: 1px solid transparent;
  font-family: var(--f-sans); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn .arr { transition: transform var(--t) var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn:disabled { opacity: .5; cursor: progress; }
.link-arrow { font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .3em; }
.link-arrow:hover { text-decoration-color: currentColor; }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: 15px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 14px; color: var(--ink-3); font-weight: 400; }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r);
  border: 1px solid var(--rule); border-bottom-color: var(--ink-3); background: var(--sheet); color: var(--ink);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
textarea.input { line-height: 1.55; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 16px; line-height: 1.4; min-height: 28px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }

/* ---------- États ---------- */
.st-ok { color: var(--ok); }
.st-renf { color: var(--warn); }
.st-nc { color: var(--red); }

/* ---------- Annotations (signature) ---------- */
mark { background: none; color: inherit; }
.a-ok { background: linear-gradient(transparent 62%, var(--blue-soft) 62%); }
.a-risk { text-decoration: underline 2px var(--red); text-underline-offset: .22em; text-decoration-skip-ink: none; background: none; transition: background-color var(--t); }
.a-risk.is-hl { background: var(--red-soft); }
.a-n, .note-n {
  font-family: var(--f-serif); font-style: italic; font-weight: 500; color: var(--red);
  font-size: .78em; margin-left: 2px;
}
.ins { text-decoration: underline 1.5px var(--blue); text-underline-offset: .22em; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: var(--r); font-size: 15px; z-index: 80;
  max-width: calc(100vw - 32px);
}

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--paper); }

/* ---------- Fiche et scanner (accueil et outil) ---------- */
.bench-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-tabs { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r); }
.seg-tabs button { min-height: 40px; padding: 0 16px; border: 0; background: transparent; font-weight: 600; font-size: 15px; cursor: pointer; }
.seg-tabs button + button { border-left: 1px solid var(--ink); }
.seg-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.bench-words { font-size: 14px; }
.bench-sheet { position: relative; padding: 28px 28px 28px 64px; }
.bench-sheet::before { content: ""; position: absolute; left: 44px; top: 0; bottom: 0; width: 1px; background: var(--red); opacity: .55; }
.doc-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.8; }
.doc-text:focus-visible { outline-offset: 8px; }
.doc-text .a-n { font-size: 15px; }
.doc-input { width: 100%; min-height: 420px; border: 0; background: transparent; resize: vertical; font-size: 16px; line-height: 1.8; padding: 0; }
.doc-input:focus { outline: none; }
.bench-sheet:focus-within { border-color: var(--blue); }
.bench-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule-2); }
.bench-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.bench-legend mark { color: var(--ink); }
/* ---------- Relevé du scanner ---------- */
.sc-score { display: flex; align-items: flex-end; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--ink); }
.sc-big { font-family: var(--f-serif); font-weight: 300; font-size: 88px; line-height: .8; letter-spacing: -.03em; white-space: nowrap; }
.sc-big small { font-size: 30px; color: var(--ink-3); letter-spacing: 0; }
.sc-meter-wrap { flex: 1; min-width: 0; }
.sc-cap { font-size: 15px; }
.sc-meter { display: flex; gap: 3px; height: 14px; margin: 10px 0 8px; }
.sc-meter i { flex: 1; background: var(--rule); }
.sc-meter i.on { background: var(--ink); }
.sc-meter i.y26 { background: transparent; box-shadow: inset 0 0 0 1px var(--blue); }
.sc-meter i.y26.on { background: var(--blue); }
.sc-meter i:not(.y26) + i.y26 { margin-left: 8px; }
.sc-sub { font-size: 13.5px; color: var(--ink-3); }
.sc-group { margin-top: 26px; }
.sc-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-sc); font-weight: 500; font-size: 15px; letter-spacing: .04em; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.sc-p .sc-h { color: var(--red); }
.sc-v .sc-h { color: var(--ink-3); }
.sc-count { font-family: var(--f-serif); font-size: 18px; }
.sc-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px 6px 12px 0; border-bottom: 1px solid var(--rule-2); transition: background-color var(--t); }
.sc-list li.is-hl { background: var(--red-soft); }
.sc-n { font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1.1; color: var(--red); text-align: center; }
.sc-n-o::before { content: "·"; color: var(--ink-3); font-style: normal; }
.sc-t { font-size: 16px; font-weight: 600; line-height: 1.35; }
.sc-ind { font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; margin-left: 4px; }
.sc-q { display: block; font-family: var(--f-serif); font-style: italic; font-size: 15.5px; color: var(--ink-2); margin-top: 4px; quotes: "« " " »"; }
.sc-why { font-size: 14.5px; color: var(--ink-2); margin-top: 4px; }
.sc-missing { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.sc-missing li { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border: 1px dashed var(--ink-3); font-size: 15px; }
.sc-missing .sc-ind { margin: 0; font-size: 12.5px; }
.sc-clear { margin-top: 20px; font-size: 15px; color: var(--ok); }
@media (min-width: 901px) { .bench-sheet { min-height: 520px; } }
@media (max-width: 600px) {
  .bench-sheet { padding: 20px 16px 20px 34px; }
  .bench-sheet::before { left: 20px; }
  .doc-text, .doc-input { font-size: 15.5px; line-height: 1.7; }
  .doc-input { min-height: 320px; }
  .seg-tabs button { padding: 0 12px; font-size: 14.5px; }
  .sc-big { font-size: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
