:root {
  /* Deep tinted navy-black, not pure black — SOC-console feel, not "hacker terminal" */
  --bg: #0a0f1a;
  --bg-elevated: #0d1421;
  --surface: #141d30;
  --surface-2: #1b2740;
  --border: #26314a;
  --border-soft: #1d2740;
  --text: #e7ecf5;
  --muted: #8b96ad;
  --muted-dim: #5f6a80;

  /* Amber signal accent — radar/CRT-console association, not neon green/cyan */
  --accent: #e8a33d;
  --accent-strong: #f4b856;
  --accent-dim: rgba(232, 163, 61, 0.14);

  --pass: #37b673;
  --pass-dim: rgba(55, 182, 115, 0.14);
  --warn: #e8a33d;
  --warn-dim: rgba(232, 163, 61, 0.14);
  --fail: #e5484d;
  --fail-dim: rgba(229, 72, 77, 0.14);
  --info: #6c7a94;
  --info-dim: rgba(108, 122, 148, 0.14);

  --radius: 10px;
  --font-ui: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container { max-width: 920px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Header, with a single deliberate motion moment: a slow amber sweep --- */
.site-header {
  position: relative;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-soft);
  padding: 48px 0 36px;
  overflow: hidden;
}
.scan-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 42%,
    rgba(232, 163, 61, 0.10) 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 260% 100%;
  animation: sweep 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sweep {
  0% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
  100% { background-position: 120% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-sweep { animation: none; }
}

.site-header .logo {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent-strong);
  font-size: 1.1rem;
}
.site-header .tagline { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* --- Scan form --- */
.scan-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}
.scan-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
#domainInput {
  flex: 1 1 280px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-data);
  font-size: 0.98rem;
}
#domainInput::placeholder { color: var(--muted-dim); }
#domainInput:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
#scanButton {
  padding: 12px 22px;
  background: var(--accent);
  color: #16110a;
  border: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
#scanButton:hover { background: var(--accent-strong); }
#scanButton:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
#scanButton:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.help-text { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }

.status-region { margin-top: 24px; min-height: 1.4em; }
.status-region.loading { color: var(--accent-strong); font-weight: 600; }
.status-region.error { color: var(--fail); font-weight: 600; }

.results-region { margin-top: 24px; }

/* --- Score card: radial gauge instead of a flat circle --- */
.score-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.score-gauge {
  --gauge-color: var(--fail);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--gauge-color) calc(var(--pct) * 1%), var(--surface-2) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.score-gauge::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}
.score-gauge-label {
  position: relative;
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
}
.score-meta { flex: 1 1 260px; }
.score-meta h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-family: var(--font-data);
  font-weight: 600;
  word-break: break-word;
}
.score-meta .score-points { color: var(--muted); font-weight: 400; font-family: var(--font-ui); }
.score-meta p { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }

.severity-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.severity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.severity-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.severity-pill.has-items.high { color: #ffb3b5; border-color: rgba(229, 72, 77, 0.4); background: var(--fail-dim); }
.severity-pill.has-items.high .dot { background: var(--fail); }
.severity-pill.has-items.medium { color: #ffd699; border-color: rgba(232, 163, 61, 0.4); background: var(--warn-dim); }
.severity-pill.has-items.medium .dot { background: var(--warn); }
.severity-pill.has-items.low { color: #cdd6e5; border-color: rgba(108, 122, 148, 0.4); background: var(--info-dim); }
.severity-pill.has-items.low .dot { background: var(--info); }
.severity-pill .dot.pass-dot { background: var(--pass); }
.severity-pill.has-items.passing { color: #a7e8c6; border-color: rgba(55, 182, 115, 0.4); background: var(--pass-dim); }

/* --- Check groups & items --- */
.check-group { margin-bottom: 20px; }
.check-group h3 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 600;
}

.check-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
  align-items: flex-start;
}
.check-icon {
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}
.check-item.pass .check-icon { color: var(--pass); background: var(--pass-dim); }
.check-item.warn .check-icon { color: var(--warn); background: var(--warn-dim); }
.check-item.fail .check-icon { color: var(--fail); background: var(--fail-dim); }
.check-item.info .check-icon { color: var(--info); background: var(--info-dim); }
.check-body h4 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-family: var(--font-data);
  font-weight: 600;
  color: var(--text);
}
.check-body p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.check-body .recommendation { margin-top: 4px; font-style: italic; color: var(--muted-dim); }

/* --- Subheadings: sentence case with a tick, not tracked-out uppercase --- */
.recon-group .recon-subheading,
.surface-group .recon-subheading {
  margin: 18px 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}
.recon-group .recon-subheading:first-of-type,
.surface-group .recon-subheading:first-of-type { margin-top: 4px; }

.recon-empty {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: var(--muted-dim);
  font-style: italic;
}

.tech-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-data);
  color: var(--text);
}
.tech-badge-category {
  font-weight: 400;
  font-size: 0.72rem;
  font-family: var(--font-ui);
  color: var(--muted);
}

.recon-dns-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.recon-dns-row {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border-soft);
}
.recon-dns-row:last-child { border-bottom: none; }
.recon-dns-type {
  flex-shrink: 0;
  width: 56px;
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--accent-strong);
}
.recon-dns-values { color: var(--muted); font-family: var(--font-data); word-break: break-word; }

.endpoint-list { display: flex; flex-direction: column; gap: 6px; }
.endpoint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.86rem;
}
.endpoint-row.found .check-icon { color: var(--pass); }
.endpoint-row.missing .check-icon { color: var(--info); }
.endpoint-row.blocked .check-icon { color: var(--warn); }
.endpoint-label { font-weight: 600; font-family: var(--font-data); flex-shrink: 0; color: var(--text); }
.endpoint-meta { color: var(--muted); }

.surface-note {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}
.surface-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.surface-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.86rem;
}
.surface-name { font-weight: 600; font-family: var(--font-data); color: var(--accent-strong); }
.surface-meta { color: var(--muted); font-size: 0.82rem; }

.sqli-list { display: flex; flex-direction: column; gap: 8px; }
.sqli-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  align-items: flex-start;
}
.sqli-row .check-icon { border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; }
.sqli-row.high .check-icon { color: var(--fail); background: var(--fail-dim); }
.sqli-row.medium .check-icon { color: var(--warn); background: var(--warn-dim); }
.sqli-row.low .check-icon { color: var(--info); background: var(--info-dim); }
.sqli-body h4 { margin: 0 0 2px; font-size: 0.95rem; font-family: var(--font-data); color: var(--text); }
.sqli-body p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.sqli-score {
  font-weight: 400;
  font-size: 0.74rem;
  font-family: var(--font-ui);
  color: var(--muted-dim);
}

.site-footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-dim);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 520px) {
  .input-row { flex-direction: column; }
  #scanButton { width: 100%; }
  .score-card { flex-direction: column; text-align: center; align-items: center; }
  .severity-pills { justify-content: center; }
}
