/* Sogni Sign — la page du client, dans le système du site sognidigitali.com :
   noir, LiquidGlass, Inter + Space Grotesk, cyan #00E5FF et or #E9C349.
   Une exception voulue : la zone de lecture du PDF reste blanche — un contrat se lit sur une feuille. */
:root {
  --bg: #000000; --surface: #0a0a0a; --ink: #E8EEF4; --muted: #A9B6C4; --faint: #6B7A8A; --line: rgba(255,255,255,.10); --line-strong: rgba(255,255,255,.18);
  --accent: #00E5FF; --accent-ink: #0f172a; --accent-soft: rgba(0,229,255,.10); --gold: #E9C349; --gold-soft: rgba(233,195,73,.12);
  --ok: #34D399; --ok-soft: rgba(52,211,153,.12); --warn: #E9C349; --warn-soft: rgba(233,195,73,.12); --crit: #F43F5E; --crit-soft: rgba(244,63,94,.12);
  --paper: #FFFFFF; --dark: #000000; --cyan: #00E5FF;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
}
/* Le mode clair du site (html.light-mode) : fond #f8fafc, encre brun profond, accent orange — le cyan reste au logo. */
html.light-mode {
  --bg: #f8fafc; --surface: #ffffff; --ink: #431407; --muted: #7c2d12; --faint: #9a6b52; --line: rgba(67,20,7,.12); --line-strong: rgba(67,20,7,.22);
  --accent: #ea580c; --accent-ink: #ffffff; --accent-soft: rgba(234,88,12,.10); --gold: #b45309; --gold-soft: rgba(180,83,9,.10);
  --ok: #15803d; --ok-soft: rgba(21,128,61,.10); --warn: #b45309; --warn-soft: rgba(180,83,9,.10); --crit: #b91c1c; --crit-soft: rgba(185,28,28,.10);
  --dark: #ffffff; --cyan: #ea580c;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; color-scheme: dark; }
html.light-mode { color-scheme: light; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px);
  background-image: radial-gradient(900px 500px at 15% -10%, rgba(0,229,255,.10), transparent 60%), radial-gradient(700px 400px at 100% 0%, rgba(233,195,73,.07), transparent 60%); background-attachment: fixed; }
html.light-mode body { background-image: radial-gradient(900px 500px at 15% -10%, rgba(234,88,12,.08), transparent 60%), radial-gradient(700px 400px at 100% 0%, rgba(180,83,9,.06), transparent 60%); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(0,0,0,.72); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--line); color: var(--ink); padding: 10px 16px; display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; }
html.light-mode .top { background: rgba(248,250,252,.82); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 14px; font-family: var(--font-display); }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand .logo-light { display: none; } html.light-mode .brand .logo-dark { display: none; } html.light-mode .brand .logo-light { display: inline-block; }
.brand b { color: var(--cyan); font-weight: 700; }
.theme { font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; justify-self: end; grid-row: 1; grid-column: 2; }
.theme:hover { border-color: var(--accent); color: var(--ink); }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; grid-column: 1 / -1; }
.steps span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 6px 2px; border-radius: 999px; color: var(--faint); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.steps span.on { color: var(--dark); background: linear-gradient(to right, #00E5FF, #00B4D8); border-color: transparent; font-weight: 700; box-shadow: 0 0 18px rgba(0,229,255,.35); }
html.light-mode .steps span.on { background: linear-gradient(to right, #ea580c, #f97316); color: #fff; box-shadow: 0 0 18px rgba(234,88,12,.3); }
.steps span.done { color: var(--ok); border-color: rgba(52,211,153,.35); }
.app { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 16px 44px; display: grid; gap: 14px; align-content: start; grid-template-columns: minmax(0, 1fr); }
/* Mobile : une colonne, les deux « colonnes » disparaissent (display: contents) et chaque carte prend sa place de lecture (.o1…o9) */
.col-side, .col-main { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
.card.head { display: grid; gap: 12px; }
.head-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
/* LiquidGlass — la carte du site, avec le liseré spéculaire cyan → or */
.card { position: relative; min-width: 0; overflow-wrap: anywhere; border-radius: 18px; padding: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.06)); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.10); box-shadow: inset 0 1px 0 0 rgba(255,255,255,.08), inset 0 0 24px rgba(255,255,255,.02), 0 16px 40px -16px rgba(0,0,0,.65); }
html.light-mode .card { background: rgba(255,255,255,.92); border-color: rgba(67,20,7,.10); box-shadow: 0 1px 2px rgba(67,20,7,.05), 0 16px 40px -20px rgba(67,20,7,.25); }
html.light-mode .card::before { background: linear-gradient(160deg, rgba(234,88,12,.35), rgba(255,255,255,.05) 30%, transparent 60%, rgba(180,83,9,.25)); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(160deg, rgba(0,229,255,.35), rgba(255,255,255,.05) 30%, transparent 60%, rgba(233,195,73,.20));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .7; }
.card.center { text-align: center; padding: 40px 18px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; color: #fff; }
h2 { font-size: 18px; margin: 0 0 8px; color: #fff; }
html.light-mode h1, html.light-mode h2, html.light-mode h3 { color: var(--ink); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; border: 1px solid; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(52,211,153,.3); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(233,195,73,.3); }
.pill.dim { color: var(--muted); background: rgba(255,255,255,.04); border-color: var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font: inherit; font-weight: 600; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(to right, #00E5FF, #00B4D8); color: var(--accent-ink); cursor: pointer; text-decoration: none; min-height: 48px; box-shadow: 0 0 20px rgba(0,229,255,.35); transition: box-shadow .2s, transform .1s; }
.btn:hover { box-shadow: 0 0 30px rgba(0,229,255,.55); }
html.light-mode .btn { background: linear-gradient(to right, #ea580c, #f97316); color: #fff; box-shadow: 0 0 20px rgba(234,88,12,.3); }
html.light-mode .btn:hover { box-shadow: 0 0 30px rgba(234,88,12,.45); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: rgba(0,229,255,.08); color: var(--cyan); border-color: rgba(0,229,255,.35); box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.03); border-color: var(--line); color: var(--ink); box-shadow: none; }
.btn[disabled] { opacity: .4; cursor: default; box-shadow: none; }
.btn.block { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kv { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 8px 0; }
.kv div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 600; }
.docs { display: grid; gap: 8px; }
.doc { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; min-width: 0; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.25); cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: border-color .2s, background .2s; }
.doc:hover { border-color: rgba(0,229,255,.35); background: rgba(0,229,255,.05); }
.doc.on { border-color: rgba(0,229,255,.5); background: rgba(0,229,255,.08); }
.doc .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; font-family: var(--font-display); background: rgba(255,255,255,.06); color: var(--muted); }
.doc.read .n { background: var(--ok); color: #041a12; }
.doc .t { font-size: 14px; }
.doc .m { font-size: 11px; color: var(--faint); }
html.light-mode .doc, html.light-mode .clause, html.light-mode .chip, html.light-mode .prom-msg.a { background: rgba(255,255,255,.7); }
html.light-mode .doc.on { background: var(--accent-soft); }
html.light-mode .doc.read .n { background: var(--ok); color: #fff; }
label.doc input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
label.doc:has(input:checked) { border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.06); }
/* La feuille : le PDF se lit en blanc */
.viewer { background: #E9EDF2; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.viewer .bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; background: rgba(0,0,0,.85); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 13px; font-family: var(--font-display); }
html.light-mode .viewer .bar { background: #fff; }
html.light-mode .viewer { background: #E9EDF2; }
html.light-mode .doc .n { background: rgba(67,20,7,.06); }
.viewer .pages { max-height: 72vh; overflow: auto; padding: 12px; display: grid; gap: 12px; justify-items: center; background: #DDE2E8; }
.viewer canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.progress { height: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(to right, #00E5FF, #E9C349); width: 0; transition: width .2s; }
html.light-mode .progress i { background: linear-gradient(to right, #ea580c, #b45309); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 0; color: var(--ink); }
label.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
input[type=text], input[type=tel] { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(0,0,0,.35); color: #fff; }
html.light-mode input[type=text], html.light-mode input[type=tel] { background: #fff; color: var(--ink); }
input::placeholder { color: var(--faint); }
input.code { font-family: "Courier New", Consolas, Menlo, monospace; font-size: 28px; letter-spacing: .35em; text-align: center; color: var(--cyan); }
input:focus-visible, .btn:focus-visible, .doc:focus-visible, .chip:focus-visible { outline: 2px solid rgba(0,229,255,.6); outline-offset: 2px; border-color: var(--accent); }
.note { padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid transparent; }
.note.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(52,211,153,.25); }
.note.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(233,195,73,.25); }
.note.crit { background: var(--crit-soft); color: #FDA4AF; border-color: rgba(244,63,94,.3); }
.note.info { background: var(--accent-soft); color: var(--cyan); border-color: rgba(0,229,255,.25); }
.clauses { display: grid; gap: 8px; margin: 10px 0; }
.clause { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; background: rgba(0,0,0,.25); }
.clause b { display: block; margin-bottom: 2px; color: var(--gold); font-family: var(--font-display); font-weight: 600; }
.hash { font-family: "Courier New", Consolas, Menlo, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 11px; color: var(--faint); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
/* Prometheus, côté client */
.prom { border-color: rgba(0,229,255,.25); }
.prom > .row { flex-wrap: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { font: inherit; font-size: 12px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--ink); cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.chip:hover { border-color: rgba(0,229,255,.4); background: rgba(0,229,255,.08); color: #fff; }
.prom-log { display: grid; gap: 8px; max-height: 320px; overflow: auto; margin-bottom: 10px; }
.prom-msg { padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.prom-msg.q { background: rgba(0,229,255,.10); border: 1px solid rgba(0,229,255,.2); color: #fff; justify-self: end; max-width: 90%; }
html.light-mode .prom-msg.q { background: var(--accent-soft); border-color: rgba(234,88,12,.25); color: var(--ink); }
.prom-msg.a { background: rgba(0,0,0,.3); border: 1px solid var(--line); max-width: 96%; }
.prom-msg b { color: var(--gold); }
@media (min-width: 720px) { .top { grid-template-columns: auto 1fr auto; align-items: center; } .steps { grid-column: 2; } .theme { grid-column: 3; } .steps { max-width: 520px; justify-self: end; } .kv { grid-template-columns: 1fr 1fr; } .col-side .kv, .kv.one { grid-template-columns: 1fr; } h1 { font-size: 28px; } .card.head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } .head-meta { flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; } }
/* Desktop : le document à droite, sous les yeux ; la liste, les actions et Prometheus à gauche */
@media (min-width: 960px) {
  .app { grid-template-columns: 400px minmax(0, 1fr); padding: 22px 24px 60px; gap: 18px; align-items: start; }
  .full { grid-column: 1 / -1; order: -1; }
  .col-side { display: grid; gap: 18px; grid-column: 1; align-content: start; order: 1; }
  .col-main { display: grid; gap: 18px; grid-column: 2; position: sticky; top: 74px; order: 1; }
  .viewer .pages { max-height: calc(100vh - 190px); }
  .card { padding: 22px 24px; }
  h1 { font-size: 30px; }
}
@media (min-width: 1200px) { .app { grid-template-columns: 440px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .progress i { transition: none; } .card { backdrop-filter: none; -webkit-backdrop-filter: none; } }
.two { display: grid; grid-template-columns: 1fr; gap: 10px; } @media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
