/* LaunchCheck — design system de l'application (dashboard).
   Concept : « autorisation de décollage ». Cartes sobres sur fond papier chaud,
   structure bleu nuit, une seule action orange par écran. Le PANNEAU DE CLEARANCE
   (verdict + voyant) est la signature. Cohérent avec la landing (mêmes tokens). */

:root {
  --paper: #f4f1ea;      /* fond chaud */
  --card: #ffffff;
  --tint: #fbfaf6;       /* panneau discret */
  --rail: #efeade;       /* rail latéral */
  --ink: #0b1020;        /* bleu nuit — texte + structure */
  --ink-soft: #25303f;
  --muted: #6b6455;
  --line: #e5e0d5;
  --brand: #ff6a2b;      /* orange — action */
  --brand-press: #e85717;
  --brand2: #ffab1f;
  --crit: #b91c1c;   --crit-bg: #fde8e8;
  --warn: #92600a;   --warn-bg: #fdf6dd;
  --go:   #15803d;   --go-bg:   #e7f6ec;
  --info: #475569;   --info-bg: #eef2f7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11,16,32,.04), 0 8px 24px -16px rgba(11,16,32,.25);
  --display: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--body);
  line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.25; margin: 0; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: var(--rail); border-right: 1px solid var(--line); min-width: 0;
  display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); padding: 0 8px 14px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand b { font-family: var(--display); font-weight: 800; font-size: 18px; }
.brand b .c { color: var(--brand); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 600;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.nav-item:hover { background: rgba(11,16,32,.05); }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-item .ic { width: 17px; height: 17px; flex: none; opacity: .9; }
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rail-foot .who { display: block; padding: 0 8px 8px; word-break: break-all; }

.content { min-width: 0; padding: 26px clamp(16px, 4vw, 40px) 64px; }
.wrap { max-width: 860px; margin: 0 auto; }

/* Topbar (dépôt courant + action + quota) */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.topbar .repo { font-size: 13.5px; color: var(--muted); }
.topbar .repo b { color: var(--ink); font-weight: 700; }
.topbar .spacer { flex: 1 1 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: var(--tint); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--go); }

/* ── Cartes & titres ───────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card.tint { background: var(--tint); box-shadow: none; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 6px; }
.section-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.lede { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; }
.h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  --bg: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 1px solid transparent; border-radius: 10px;
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 700; font-size: 14.5px;
  cursor: pointer; text-decoration: none; transition: transform .04s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { --bg: var(--brand); --fg: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-press); }
.btn-secondary { --bg: var(--ink); --fg: #fff; }
.btn-ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: rgba(11,16,32,.04); }
.btn-block { width: 100%; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Champs ────────────────────────────────────────────────────────────── */
.field { margin: 12px 0; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
input, select {
  width: 100%; padding: 11px 12px; border: 1px solid #cfc8b8; border-radius: 10px;
  font: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(255,106,43,.15); }
.pw { position: relative; }
.pw input { padding-right: 42px; }
.pw .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; padding: 6px; color: var(--muted); font-size: 15px; }

/* ── Messages (succès / erreur / info) ─────────────────────────────────── */
.msg { font-size: 14px; padding: 10px 12px; border-radius: 9px; margin: 10px 0 0; }
.msg-err { background: var(--crit-bg); color: var(--crit); }
.msg-ok { background: var(--go-bg); color: var(--go); }
.msg-info { background: var(--info-bg); color: var(--info); }
.err-inline { color: var(--crit); font-size: 13.5px; margin: 8px 0 0; }

/* ── Auth (écran centré, onglets) ──────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: grid; justify-items: center; align-content: start; padding: clamp(26px, 8vh, 84px) 18px 44px; }
.auth { width: 100%; max-width: 460px; }
.auth .brand { justify-content: center; padding: 0 0 6px; }
.auth .brand img { width: 34px; height: 34px; } .auth .brand b { font-size: 20px; }
.auth .pitch { text-align: center; color: var(--ink-soft); font-size: 15.5px; margin: 0 auto 6px; max-width: 380px; }
.auth-reassure { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.auth .card { padding: 22px; }
.auth .pitch b { color: var(--ink); }
.tabs { display: flex; gap: 4px; background: var(--tint); border: 1px solid var(--line); border-radius: 11px; padding: 4px; margin-bottom: 8px; }
.tab { flex: 1; padding: 9px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.gift { display: flex; align-items: center; gap: 8px; background: #fff4ec; border: 1px solid #ffd9c2; color: var(--brand-press); font-size: 13.5px; font-weight: 600; padding: 9px 12px; border-radius: 9px; margin: 12px 0; }
.auth .fine { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.auth .fine a { color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
#forgotLink { font-size: 13px; font-weight: 500; }

/* ── Stats (label + gros nombre) ───────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.stat .n { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ── SIGNATURE : panneau de clearance (verdict + voyant) ───────────────── */
.clearance {
  background: var(--ink); color: #fff; border-radius: 14px; padding: 20px 22px;
  display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.clearance::after { /* fin liseré coloré en pied, comme un tableau de bord */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c, #64748b);
}
.clearance .light { width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--c, #64748b);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, #64748b) 22%, transparent); position: relative; }
.clearance .light::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--c, #64748b); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.clearance .verdict { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .01em; line-height: 1.1; }
.clearance .cl-sub { color: #c8cad4; font-size: 13.5px; margin-top: 3px; }
.clearance.go     { --c: #34d399; }
.clearance.nogo   { --c: #f87171; }
.clearance.reserve{ --c: #fbbf24; }
.clearance.pending{ --c: #94a3b8; }
.clearance.pending .light::before { animation-duration: 1.1s; }

/* Résumé « X signaux → Y actions » */
.signal-line { display: flex; align-items: baseline; gap: 10px; font-size: 15px; margin: 14px 0 2px; }
.signal-line b { font-size: 20px; font-weight: 800; }
.arrow { color: var(--muted); }

/* ── Stepper (onboarding + scan) ───────────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.step .b { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; background: #fff; }
.step.done .b { background: var(--go); border-color: var(--go); color: #fff; }
.step.current { color: var(--ink); }
.step.current .b { border-color: var(--brand); color: var(--brand); }
.step-sep { flex: 1 1 18px; height: 2px; background: var(--line); min-width: 14px; border-radius: 2px; }
.step.done + .step-sep { background: var(--go); }

/* Scan en cours : liste d'états honnête */
.scan-steps { list-style: none; margin: 12px 0; padding: 0; }
.scan-steps li { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 14.5px; color: var(--muted); }
.scan-steps li .mk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.scan-steps li.done { color: var(--ink); } .scan-steps li.done .mk { background: var(--go); border-color: var(--go); }
.scan-steps li.active { color: var(--ink); font-weight: 600; } .scan-steps li.active .mk { border-color: var(--brand); border-right-color: transparent; animation: spin .8s linear infinite; }

/* ── Empty / loading ───────────────────────────────────────────────────── */
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .em { font-size: 30px; margin-bottom: 8px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 8px 0; }
.loading .spin { width: 16px; height: 16px; border: 2px solid var(--line); border-right-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Détail des lignes (rapport) : kv, pills, findings ─────────────────── */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.sev { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.pill { padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #f1ede3; color: var(--ink-soft); }
.pill.critical { background: var(--crit-bg); color: var(--crit); }
.pill.high { background: #fef0e0; color: #b45309; }
.pill.medium { background: var(--warn-bg); color: var(--warn); }

.todo-card { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.todo-card h3 { font-size: 15px; margin: 0 0 8px; }
.todo-card ol { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.75; }

.finding { border: 1px solid var(--line); border-radius: 10px; padding: 15px; margin: 12px 0; background: #fff; }
.finding.critical { border-left: 4px solid var(--crit); }
.finding.high { border-left: 4px solid #b45309; }
.finding.medium { border-left: 4px solid var(--warn); }
.finding.low, .finding.info { border-left: 4px solid #94a3b8; }
.finding h4 { margin: 0 0 4px; font-size: 15px; }
.finding .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f1ede3; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.finding .block { margin: 8px 0; font-size: 14px; }
.finding .block .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 2px; }
.finding code, code.inline { background: #f7f5ef; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.finding .locs { font-size: 13px; color: var(--info); }
.finding .refs a { display: block; font-size: 12px; color: #1d4ed8; word-break: break-all; }
.finding .fixbox { background: var(--go-bg); border: 1px solid #cde7d6; border-radius: 8px; padding: 8px 10px; }
details { margin: 8px 0; }
details > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--info); user-select: none; }
details[open] > summary { margin-bottom: 6px; }
ol li { margin: 4px 0; }

/* Carte de déblocage (Free → Builder) */
.lock { margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--ink); color: #fff; }
.lock h3 { margin: 0 0 6px; font-size: 15px; }
.lock ul { margin: 8px 0 14px 18px; padding: 0; font-size: 13px; color: #cfd2dd; }

/* Offre Builder */
.price { display: flex; align-items: baseline; gap: 6px; }
.price .amount { font-size: 30px; font-weight: 800; }
.price .per { color: var(--muted); font-size: 15px; }
.feat { list-style: none; margin: 6px 0 16px; padding: 0; font-size: 14.5px; }
.feat li { padding: 5px 0 5px 26px; position: relative; }
.feat li::before { content: '✓'; position: absolute; left: 0; color: var(--go); font-weight: 800; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Responsive : rail devient barre haute ─────────────────────────────── */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0 6px 0 2px; flex: none; } .brand b { font-size: 16px; }
  .nav { flex-direction: row; gap: 4px; flex: none; }
  .nav-item { padding: 8px 11px; font-size: 13.5px; white-space: nowrap; }
  .nav-item .ic { display: none; }
  .rail-foot { margin: 0 0 0 auto; padding: 0 0 0 8px; border: 0; flex: none; }
  .rail-foot .who { display: none; }
  .content { padding: 18px 16px 56px; }
  .topbar .spacer { display: none; }
  .topbar .repo { flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .clearance { flex-direction: row; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .clearance .verdict { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
