:root {
  --bg: #060B14;
  --panel: #0C1524;
  --panel2: #0F1C30;
  --line: rgba(0, 212, 255, 0.18);
  --cyan: #00D4FF;
  --blue: #2F80FF;
  --txt: #E6F1FF;
  --muted: #7C93B4;
  --good: #10B981;
  --warn: #F59E0B;
  --bad: #EF4444;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(0,212,255,.10), transparent 60%),
    linear-gradient(transparent 95%, rgba(0,212,255,.05) 96%) 0 0 / 100% 34px,
    linear-gradient(90deg, transparent 95%, rgba(0,212,255,.05) 96%) 0 0 / 34px 100%;
}

.topbar {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--cyan);
}
.brand-mark span { color: var(--txt); margin-left: 4px; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--cyan); }

.wrap {
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto; padding: 32px 20px 80px;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--cyan); letter-spacing: .5px; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; text-transform: none; letter-spacing: 0; }

.fld { display: block; margin: 18px 0; }
.fld > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .5px; }
input[type=text], input[type=password], select {
  width: 100%; padding: 12px 14px; font-size: 15px;
  background: #08111E; color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input[type=text]:focus, input[type=password]:focus, select:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,212,255,.15);
}
select option { background: #08111E; color: var(--txt); }

.modules { display: flex; flex-wrap: wrap; gap: 10px; }
.mod {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; user-select: none; background: #08111E; font-size: 14px;
}
.mod input { accent-color: var(--cyan); width: 16px; height: 16px; }
.mod.on { border-color: var(--cyan); background: rgba(0,212,255,.08); }

.btn {
  margin-top: 6px; padding: 12px 26px; font-size: 15px; font-weight: 600;
  color: #041018; background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: none; border-radius: 10px; cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost {
  margin: 0; padding: 9px 18px; font-size: 13px; font-weight: 600;
  color: var(--cyan); background: transparent;
  border: 1px solid var(--cyan); border-radius: 10px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(0,212,255,.10); }

.err { margin-top: 14px; padding: 10px 14px; border-radius: 8px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #FCA5A5; font-size: 13px; }

.loading { text-align: center; padding: 40px 0; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid rgba(0,212,255,.2); border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.verdict-row { display: flex; align-items: center; gap: 18px; }
.verdict-row #export { margin-left: auto; }
.badge {
  font-size: 15px; font-weight: 700; padding: 10px 16px; border-radius: 10px;
  white-space: nowrap;
}
.badge.good { background: rgba(16,185,129,.15); color: var(--good); border: 1px solid rgba(16,185,129,.5); }
.badge.monitor { background: rgba(245,158,11,.15); color: var(--warn); border: 1px solid rgba(245,158,11,.5); }
.badge.action { background: rgba(239,68,68,.15); color: var(--bad); border: 1px solid rgba(239,68,68,.5); }
.verdict-eq { font-size: 15px; }
.chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: rgba(47,128,255,.12); border: 1px solid var(--line); color: var(--muted); }
.chip.found { color: var(--cyan); border-color: var(--cyan); }

.prose { font-size: 14px; line-height: 1.75; color: #CFE0F5; }
.prose p { margin: 0 0 12px; }
#findings li { font-size: 14px; line-height: 1.6; margin-bottom: 6px; color: #CFE0F5; }
#recommendations li { font-size: 14px; line-height: 1.6; margin-bottom: 8px; color: #CFE0F5; }
#reco-card h2 { color: var(--good); }

/* print-only report header (hidden on screen) */
.print-only { display: none; }
.print-head .ph-title { font-size: 20px; font-weight: 800; color: #0b2540; }
.print-head .ph-meta { font-size: 12px; color: #40506a; margin-top: 4px; }

.mod-block { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.mod-head { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #08111E; font-size: 14px; }
.mod-head .tag { font-size: 11px; color: var(--muted); }
.mod-body { padding: 12px 14px; display: none; }
.mod-body.open { display: block; }
.mod-body pre { margin: 0; font-size: 12px; line-height: 1.5; color: #9FB6D4; white-space: pre-wrap; word-break: break-word; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot.y { background: var(--good); }
.dot.n { background: var(--muted); }

/* ─────────────────────────── Print / PDF export ─────────────────────────── */
@media print {
  /* white background, dark text for a clean printable report */
  html, body {
    background: #fff !important; color: #10202f !important;
  }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bg-grid, .topbar, .no-print, #loading { display: none !important; }
  .print-only { display: block !important; }
  .wrap { max-width: 100%; margin: 0; padding: 0; }

  .print-head { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 2px solid #0b2540; }

  .card {
    background: #fff !important; border: 1px solid #c9d6e6 !important;
    border-radius: 8px; box-shadow: none;
    margin-bottom: 14px; padding: 16px 18px;
    break-inside: avoid; page-break-inside: avoid;
  }
  h1, h2 { color: #0b2540 !important; }
  .prose, .prose p, #findings li, #recommendations li, .verdict-eq { color: #1a2a3a !important; }
  .muted { color: #47586e !important; }

  /* keep verdict colours legible on white */
  .badge.good { background: #e6f7f0 !important; color: #0a7a55 !important; border-color: #0a7a55 !important; }
  .badge.monitor { background: #fdf3e0 !important; color: #9a6400 !important; border-color: #9a6400 !important; }
  .badge.action { background: #fdeaea !important; color: #b62222 !important; border-color: #b62222 !important; }
  .chip { color: #47586e !important; border-color: #c9d6e6 !important; background: #f2f6fb !important; }
  .chip.found { color: #0a5a8a !important; border-color: #0a5a8a !important; }
}
