/* DTCLIENT — espace client DTDATA.
   Ardoise et sarcelle, une seule pièce forte : le rail d'avancement des demandes. */
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("/static/fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("/static/fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("/static/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("/static/fonts/figtree-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #f3f6f5;
  --surface: #ffffff;
  --ink: #1c2b30;
  --ink-2: #55666b;
  --line: #d3dcd9;
  --teal: #0b6e6b;
  --teal-deep: #08504e;
  --teal-wash: #e2f0ee;
  --amber: #9a5a00;
  --amber-wash: #fbf0dc;
  --red: #b4232c;
  --red-wash: #fbe9ea;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --wrap: 1040px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ── Barre ─────────────────────────────────────────────── */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar-in { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, var(--teal) 0 50%, var(--ink) 50% 100%); flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand-sub { font-size: 14px; color: var(--ink-2); padding-left: 10px; border-left: 1px solid var(--line); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--paper); }
.nav a.on { color: var(--teal-deep); background: var(--teal-wash); font-weight: 600; }
.bar-cta { margin-left: auto; }
.bar-cta.is-here { visibility: hidden; }

.main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 36px 20px 64px; }
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.foot form { margin: 0; }

/* ── Boutons, liens ────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font); padding: 12px 18px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.back { display: inline-block; font-size: 14px; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.back::before { content: "‹ "; }
.back:hover { color: var(--ink); }
.more { font-size: 14px; font-weight: 600; text-decoration: none; }
.more:hover, a.inline:hover { text-decoration: underline; }

/* ── Titres et textes ──────────────────────────────────── */
.h1 { font-size: 30px; line-height: 1.2; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.h2 { font-size: 19px; line-height: 1.3; font-weight: 700; margin: 0; }
.h3 { font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.ref { margin: 0 0 2px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.muted { color: var(--ink-2); margin: 0; }
.prose { margin: 0; white-space: pre-line; max-width: 68ch; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.block { margin-top: 36px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.block-head .h2 { margin-bottom: 0; }
.narrow { max-width: 520px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md); padding: 22px; color: var(--ink-2); margin: 0; }

/* ── Messages ──────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--r-sm); margin: 0 0 20px; font-weight: 500; }
.alert-ok { background: var(--teal-wash); color: var(--teal-deep); }
.alert-err { background: var(--red-wash); color: var(--red); }

/* ── Connexion ─────────────────────────────────────────── */
.page-gate { background: var(--ink); }
.page-gate .main { display: grid; place-items: center; padding: 40px 16px; }
.gate { width: 100%; max-width: 420px; background: var(--surface); border-radius: 14px; padding: 36px 32px 28px; box-shadow: 0 24px 60px rgba(4, 18, 20, .35); }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.gate-title { font-size: 28px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
.gate-lead { color: var(--ink-2); margin: 0 0 24px; }
.gate-note { margin: 22px 0 0; font-size: 14px; color: var(--ink-2); }

/* ── Champs ────────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--ink-2); font-size: 13px; }
.opt { font-style: normal; font-weight: 400; color: var(--ink-2); }
input, textarea, select { font: 400 16px/1.4 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
textarea { resize: vertical; }

/* ── Accueil ───────────────────────────────────────────── */
.hello { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--teal); border-radius: var(--r-md); padding: 30px 32px; }
.hello-title { font-size: 28px; line-height: 1.25; font-weight: 700; margin: 0 0 8px; max-width: 30ch; letter-spacing: -.01em; }
.hello-lead { color: var(--ink-2); margin: 0 0 22px; }

/* ── Liste des demandes ────────────────────────────────── */
.reqs { display: grid; gap: 10px; }
.req { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: center; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; text-decoration: none; color: var(--ink); }
.req:hover { border-color: var(--teal); }
.req-main { display: grid; gap: 2px; min-width: 0; }
.req-ref { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.req-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-meta { font-size: 14px; color: var(--ink-2); }
.req-next { color: var(--teal-deep); font-weight: 600; }

/* ── Rail d'avancement (pièce maîtresse) ───────────────── */
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.rail li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.rail li::before { content: ""; position: absolute; top: 7px; right: 50%; width: 100%; height: 3px; background: var(--line); }
.rail li:first-child::before { display: none; }
.rail li.done::before, .rail li.now::before { background: var(--teal); }
.rail-dot { position: relative; z-index: 1; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.rail li.done .rail-dot { background: var(--teal); border-color: var(--teal); }
.rail li.now .rail-dot { background: var(--surface); border-color: var(--teal); box-shadow: 0 0 0 5px var(--teal-wash); }
.rail li.now { color: var(--teal-deep); font-weight: 700; }
.rail li.done { color: var(--ink); }
.rail-compact li { font-size: 12px; gap: 6px; }
.rail-compact .rail-dot { width: 13px; height: 13px; border-width: 2px; }
.rail-compact li::before { top: 5px; height: 2px; }
.rail-compact li.now .rail-dot { box-shadow: 0 0 0 4px var(--teal-wash); }
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px 24px 20px; }
.status-card .rail li { font-size: 14px; }
.status-card .rail-dot { width: 22px; height: 22px; }
.status-card .rail li::before { top: 10px; height: 4px; }
.status-now { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 600; }

/* ── Détail d'une demande ──────────────────────────────── */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.detail-side { margin-top: 36px; position: sticky; top: 88px; }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; display: grid; gap: 4px; }
.facts dt { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts-wide { margin: 22px 0 12px; }
.itv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 12px; display: grid; gap: 8px; }
.itv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.itv-type { font-weight: 700; }
.itv-sub { margin: 0; color: var(--ink-2); }
.itv-when { margin: 0; font-weight: 500; }
.tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.tag-ouverte { background: var(--amber-wash); color: var(--amber); }
.tag-cloturee { background: var(--teal-wash); color: var(--teal-deep); }
.cr { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.cr-section { font-size: 14px; font-weight: 700; margin: 12px 0 2px; }
.cr-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; padding: 5px 0; font-size: 15px; }
.cr-row-wide { grid-template-columns: 1fr; }
.cr-k { color: var(--ink-2); }
.cr-v { white-space: pre-line; }
.cr-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.cr-table-wrap { overflow-x: auto; }
.cr-table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.cr-table th, .cr-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.cr-table th { color: var(--ink-2); font-weight: 600; }
.sig { display: grid; gap: 4px; }
.sig img { max-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); }
.stars { margin: 0; font-size: 20px; letter-spacing: 2px; color: var(--line); }
.stars .on { color: #c98a00; }

/* ── Formulaire de demande ─────────────────────────────── */
.req-form { display: grid; gap: 18px; max-width: 760px; }
.fs { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 22px 24px 24px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.fs-title { font-weight: 700; font-size: 17px; padding: 0 6px; margin-left: -6px; }
.fs-help { margin: -6px 0 0; color: var(--ink-2); font-size: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.choices-1 { grid-template-columns: 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body { display: grid; gap: 3px; align-content: start; height: 100%; padding: 13px 15px 13px 42px; border: 1px solid var(--line); border-radius: var(--r-sm); position: relative; }
.choice-body::before { content: ""; position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.choice-title { font-weight: 600; }
.choice-desc { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.choice:hover .choice-body { border-color: var(--ink-2); }
.choice input:checked + .choice-body { border-color: var(--teal); background: var(--teal-wash); box-shadow: inset 0 0 0 1px var(--teal); }
.choice input:checked + .choice-body::before { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 3px var(--surface); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--teal); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt span { display: block; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 500; }
.seg-opt input:checked + span { border-color: var(--teal); background: var(--teal); color: #fff; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.billing-hint { margin: 0; font-size: 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink-2); }
.billing-hint:empty { display: none; }
.billing-hint.is-ok { background: var(--teal-wash); color: var(--teal-deep); }
.billing-hint.is-warn { background: var(--amber-wash); color: var(--amber); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-end { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form-note { color: var(--ink-2); font-size: 14px; }

/* ── Contrats ──────────────────────────────────────────── */
.contracts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contract { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; display: grid; gap: 4px; }
.contract-name { font-weight: 700; }
.contract-ref { font-size: 14px; color: var(--ink-2); }
.points { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.points-num { font-size: 32px; font-weight: 700; line-height: 1; color: var(--teal-deep); font-variant-numeric: tabular-nums; }
.points-lbl { color: var(--ink-2); font-size: 14px; }
.points-low .points-num { color: var(--amber); }
.points-big .points-num { font-size: 44px; }
.contract-full { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; }
.contract-full:first-of-type { margin-top: 0; }
.incl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; }
.incl li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.incl li.no { color: var(--ink-2); }
.incl-v { font-weight: 600; white-space: nowrap; }
.incl li.no .incl-v { font-weight: 400; font-style: italic; }
.moves { width: 100%; border-collapse: collapse; font-size: 14px; }
.moves th, .moves td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.moves th { color: var(--ink-2); font-weight: 600; }
.moves .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.moves .pos { color: var(--teal-deep); font-weight: 600; }
.moves .neg { color: var(--ink); font-weight: 600; }

/* ── Divers ────────────────────────────────────────────── */
.switch { display: flex; gap: 6px; margin-bottom: 16px; }
.switch a { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
.switch a.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.row-actions form { margin: 0; }

/* ── Petits écrans ─────────────────────────────────────── */
@media (max-width: 900px) {
  .bar-in { flex-wrap: wrap; height: auto; padding: 12px 16px 0; gap: 10px 16px; }
  .brand-sub { display: none; }
  .bar-cta { padding: 10px 14px; font-size: 14px; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 12px 8px; overflow-x: auto; }
  .req { grid-template-columns: 1fr; gap: 14px; }
  .detail { grid-template-columns: 1fr; gap: 0; }
  .detail-side { position: static; }
}
@media (max-width: 600px) {
  .main { padding: 24px 16px 48px; }
  .h1 { font-size: 25px; }
  .hello { padding: 22px 20px; }
  .hello-title { font-size: 23px; }
  .hello .btn { width: 100%; }
  .gate { padding: 28px 22px 22px; }
  .fs { padding: 18px 16px 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .cr-row { grid-template-columns: 1fr; gap: 2px; }
  .page-head, .block-head { flex-wrap: wrap; }
  .rail li { font-size: 11.5px; }
  .form-end .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.block > .h2 { margin-bottom: 12px; }
