/* =============================================================================
   styles.css — presentation only. Color encodes severity; the engine owns logic.
   ============================================================================= */

:root {
  --bg: #0f1419;
  --panel: #1a212b;
  --panel-2: #222b38;
  --border: #2c3744;
  --text: #e6edf3;
  --muted: #93a1b1;
  --accent: #4f8cff;

  --pass: #2ea043;
  --fail: #e5484d;
  --anomaly: #e5484d;   /* 🔴 */
  --attention: #e3b341; /* 🟡 */
  --info: #3fb950;      /* 🟢 */

  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #131a23, var(--bg));
}
.site-header h1 { margin: 0; font-size: 1.5rem; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

main { max-width: 960px; margin: 0 auto; padding: 24px; }

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 40px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus { border-color: var(--accent); background: var(--panel-2); outline: none; }
.dropzone.dragover { border-color: var(--accent); background: #1d2a3e; }
.dropzone-title { font-size: 1.1rem; margin: 0 0 8px; }
.dropzone-or { color: var(--muted); margin: 8px 0; }
.dropzone-hint { color: var(--muted); font-size: 0.82rem; margin: 14px 0 0; }

.btn {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 0.95rem; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }

/* ---- States ---- */
.error-banner {
  margin-top: 16px; padding: 14px 16px; border-radius: 8px;
  background: #3a1a1c; border: 1px solid var(--fail); color: #ffd7d8;
}
.loading { margin-top: 20px; color: var(--muted); font-style: italic; }

/* ---- Verdict header ---- */
#results { margin-top: 24px; }
.verdict {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel);
}
.verdict-badge {
  font-size: 1.3rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 8px 18px; border-radius: 8px; color: #fff;
}
.verdict-badge.pass { background: var(--pass); }
.verdict-badge.fail { background: var(--fail); }
.verdict-meta { color: var(--muted); font-size: 0.95rem; }
.verdict-meta strong { color: var(--text); }
.verdict-counts { margin-left: auto; display: flex; gap: 14px; font-size: 0.9rem; }
.verdict-counts span { white-space: nowrap; }

/* ---- Axes table ---- */
.axes {
  margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.axes table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.axes th, .axes td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--border); }
.axes th:first-child, .axes td:first-child { text-align: left; }
.axes thead th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
.axes tr:last-child td { border-bottom: none; }
.axes .num { font-family: var(--mono); }
.axes .ok { color: var(--info); }
.axes .bad { color: var(--fail); font-weight: 600; }
.axes .axis-info td { color: var(--muted); font-style: italic; }

/* ---- Findings ---- */
.findings-title { margin: 26px 0 12px; font-size: 1.1rem; }
.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  border: 1px solid var(--border); border-left-width: 5px;
  border-radius: 10px; background: var(--panel); padding: 14px 16px;
}
.card.sev-anomaly { border-left-color: var(--anomaly); }
.card.sev-attention { border-left-color: var(--attention); }
.card.sev-info { border-left-color: var(--info); }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-icon { font-size: 1.05rem; }
.card-title { font-weight: 600; }
.card-ref { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.card-msg { color: var(--text); }
.card-amounts { margin-top: 8px; display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.card-amounts b { color: var(--text); font-weight: 600; }

.all-clear {
  padding: 20px; border-radius: 10px; text-align: center;
  background: #14241a; border: 1px solid var(--pass); color: #c6f6d5;
}

/* ---- Pair (intangibilité) section ---- */
.pair-section {
  margin-top: 20px; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.pair-title { margin: 0 0 6px; font-size: 1.1rem; }
.pair-hint { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; }
.pair-inputs { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pair-slot { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.pair-slot-label { color: var(--muted); font-size: 0.85rem; }
.pair-slot input[type="file"] {
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem;
}

#pairResults { margin-top: 24px; }
.inline-badge { font-size: 0.85rem; padding: 3px 10px; letter-spacing: 0.04em; vertical-align: middle; }

/* ---- Dossier justificatif table ---- */
.dossier { margin-top: 22px; }
.dossier-note { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; }
.dossier-group { margin-bottom: 18px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dossier-group.dossier-unknown { border-color: var(--attention); }
.dossier-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--panel-2);
}
.dossier-group-title { font-weight: 600; }
.dossier-table table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dossier-table th, .dossier-table td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.dossier-table thead th { background: var(--panel); color: var(--muted); font-weight: 600; }
.dossier-table tr:last-child td { border-bottom: none; }
.dossier-table .num { font-family: var(--mono); text-align: right; }
.dossier-table .sens { font-family: var(--mono); text-align: center; }
.dossier-table .sev-attention-row td { background: rgba(227, 179, 65, 0.08); }

.site-footer {
  max-width: 960px; margin: 30px auto 40px; padding: 0 24px;
  color: var(--muted); font-size: 0.8rem; text-align: center;
}
