/* ============================================================
   XSS.Report — modern dark glass UI
   ============================================================ */
:root {
  --bg: #070b12;
  --bg-2: #0b111c;
  --bg-3: #101827;
  --card: rgba(16, 24, 39, 0.72);
  --card-solid: #0f1626;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e6edf7;
  --text-dim: #8b9bb4;
  --text-faint: #5b6b85;
  --accent: #ff2e63;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --success-bg: rgba(52, 211, 153, 0.12);
  --glow-1: rgba(255, 46, 99, 0.16);
  --glow-2: rgba(139, 92, 246, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, var(--glow-2), transparent 55%),
    radial-gradient(800px 500px at 50% 120%, rgba(34, 211, 238, 0.06), transparent 60%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  pointer-events: none;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent-3); text-decoration: none; }
a:hover { text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2a3f; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3d5a; }

/* ============ Public shell ============ */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }

.public-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; max-width: 1200px; margin: 0 auto; width: 100%;
}
.public-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.public-nav .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.public-nav .links { display: flex; gap: 22px; align-items: center; }
.public-nav .links a { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; transition: color .2s; }
.public-nav .links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.06); color: var(--text);
  font-weight: 600; font-size: 0.92rem; cursor: pointer;
  transition: all .18s ease; text-decoration: none; font-family: var(--sans);
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 46, 99, 0.5); background: rgba(255, 46, 99, 0.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  border: none; color: #fff;
  box-shadow: 0 6px 24px -8px rgba(255, 46, 99, 0.6);
}
.btn-primary:hover { background: linear-gradient(135deg, #ff3a6d, #ff7a7a); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 13px; font-size: 0.82rem; border-radius: 9px; }
.btn-danger { border-color: rgba(244, 63, 94, 0.4); color: var(--red); background: var(--danger-bg); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }
.btn-success { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.35); color: var(--green); }
.btn-success:hover { background: rgba(52, 211, 153, 0.22); }

/* ============ Landing ============ */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 90px 32px 60px; text-align: center;
  animation: rise .7s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-3); background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25); padding: 7px 16px; border-radius: 100px;
  margin-bottom: 26px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.9rem); font-weight: 800; letter-spacing: -0.035em;
  line-height: 1.08; margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { max-width: 680px; margin: 0 auto 34px; color: var(--text-dim); font-size: 1.08rem; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.terminal {
  max-width: 760px; margin: 56px auto 0; text-align: left;
  background: rgba(7, 12, 20, 0.85); border: 1px solid var(--border-strong);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}
.terminal .bar { display: flex; gap: 8px; align-items: center; padding: 13px 18px; background: rgba(148,163,184,0.05); border-bottom: 1px solid var(--border); }
.terminal .bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal .bar .dot.r { background: #ff5f57; } .terminal .bar .dot.y { background: #febc2e; } .terminal .bar .dot.g { background: #28c840; }
.terminal .bar .file { margin-left: 10px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); }
.terminal pre { padding: 22px; font-family: var(--mono); font-size: 0.85rem; line-height: 1.75; color: #c8d6ee; overflow-x: auto; }
.terminal .cmt { color: #5b6b85; } .terminal .kw { color: var(--accent-2); } .terminal .st { color: var(--green); } .terminal .fn { color: var(--accent-3); }

/* Features */
.features { max-width: 1200px; margin: 0 auto; padding: 70px 32px; }
.features h2 { text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.features .fh { text-align: center; color: var(--text-dim); margin-bottom: 44px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.fcard {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; backdrop-filter: blur(10px); transition: all .25s ease; position: relative; overflow: hidden;
}
.fcard::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0; transition: opacity .25s;
}
.fcard:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: 0 20px 50px -24px rgba(0,0,0,.7); }
.fcard:hover::before { opacity: 1; }
.fcard .ico { font-size: 1.5rem; margin-bottom: 14px; }
.fcard h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 8px; }
.fcard p { color: var(--text-dim); font-size: 0.9rem; }

/* ============ Auth ============ */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 38px; backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  animation: rise .6s ease both;
}
.auth-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 26px; }
.auth-card .demo { margin-top: 22px; padding: 13px 16px; border-radius: 12px; background: rgba(34,211,238,0.06); border: 1px dashed rgba(34,211,238,0.3); font-size: 0.82rem; color: var(--text-dim); font-family: var(--mono); }

/* ============ Forms ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; padding: 12px 15px; border-radius: 12px;
  background: rgba(7, 12, 20, 0.7); border: 1px solid var(--border-strong);
  color: var(--text); font-family: var(--sans); font-size: 0.94rem;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 46, 99, 0.15);
}
.input::placeholder, textarea.input::placeholder { color: var(--text-faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b9bb4' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }
textarea.input { resize: vertical; font-family: var(--mono); font-size: 0.85rem; min-height: 110px; }
.hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 6px; }
.checkrow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.9rem; color: var(--text-dim); cursor: pointer; }
.checkrow input { accent-color: var(--accent); width: 17px; height: 17px; }

/* ============ Flash / toast ============ */
.flash {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 13px 22px; border-radius: 13px; font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: drop .4s ease both;
  border: 1px solid; backdrop-filter: blur(12px);
}
.flash.ok { background: var(--success-bg); border-color: rgba(52,211,153,0.4); color: var(--green); }
.flash.err { background: var(--danger-bg); border-color: rgba(244,63,94,0.45); color: var(--red); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ App layout ============ */
.app {
  display: grid; grid-template-columns: 250px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  background: rgba(9, 14, 24, 0.85); border-right: 1px solid var(--border);
  backdrop-filter: blur(12px); display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 800; letter-spacing: -0.02em; }
.sidebar .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px;
  color: var(--text-dim); font-size: 0.92rem; font-weight: 600; transition: all .16s;
}
.sidebar nav a .ic { width: 20px; text-align: center; font-size: 1rem; }
.sidebar nav a:hover { background: rgba(148,163,184,0.07); color: var(--text); }
.sidebar nav a.active { background: linear-gradient(135deg, rgba(255,46,99,0.16), rgba(139,92,246,0.12)); color: #fff; border: 1px solid rgba(255,46,99,0.25); }
.sidebar .side-foot { padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 0.76rem; color: var(--text-faint); }

.main { padding: 26px 34px 60px; min-width: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.topbar .crumb { font-size: 0.8rem; color: var(--text-faint); margin-top: 2px; }
.topbar .actions { display: flex; gap: 10px; align-items: center; }

/* ============ Cards & stats ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; backdrop-filter: blur(10px); margin-bottom: 22px;
}
.card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.card .card-sub { color: var(--text-dim); font-size: 0.84rem; margin-bottom: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; backdrop-filter: blur(10px); position: relative; overflow: hidden;
  transition: all .22s ease; animation: rise .5s ease both;
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat .label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }
.stat.hot .label { color: var(--accent); }
.stat.hot::after { content: ""; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255,46,99,0.25), transparent 70%); }
.stat.cyan .label { color: var(--accent-3); }
.stat.violet .label { color: var(--accent-2); }

/* charts row */
.charts-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.charts-row .card { margin-bottom: 0; }
@media (max-width: 1000px) { .charts-row { grid-template-columns: 1fr; } }

canvas.chart { width: 100%; height: 220px; display: block; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table thead th {
  text-align: left; padding: 12px 14px; font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint);
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(148,163,184,0.05); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--mono); font-size: 0.8rem; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { font-size: 0.76rem; color: var(--text-faint); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
}
.badge.red { background: var(--danger-bg); color: var(--red); border: 1px solid rgba(244,63,94,0.3); }
.badge.green { background: var(--success-bg); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.badge.amber { background: rgba(251,191,36,0.12); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }
.badge.cyan { background: rgba(34,211,238,0.1); color: var(--accent-3); border: 1px solid rgba(34,211,238,0.3); }
.badge.gray { background: rgba(148,163,184,0.1); color: var(--text-dim); border: 1px solid rgba(148,163,184,0.25); }
.badge.violet { background: rgba(139,92,246,0.12); color: var(--accent-2); border: 1px solid rgba(139,92,246,0.3); }

/* pills (tabs) */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-dim); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all .16s; font-family: var(--sans);
}
.pill:hover { color: var(--text); border-color: var(--accent); }
.pill.active { background: linear-gradient(135deg, var(--accent), #ff6b6b); color: #fff; border-color: transparent; box-shadow: 0 6px 20px -8px rgba(255,46,99,.6); }

/* ============ Heatmap ============ */
.heatmap { display: grid; grid-template-columns: 44px repeat(24, 1fr); gap: 2px; }
.heatmap .hm-label { font-size: 0.62rem; color: var(--text-faint); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.heatmap .hm-cell { aspect-ratio: 1; border-radius: 3px; background: rgba(148,163,184,0.08); min-width: 8px; transition: transform .1s; }
.heatmap .hm-cell:hover { transform: scale(1.25); outline: 1px solid var(--border-strong); }
.heatmap .hm-dow { font-size: 0.62rem; color: var(--text-faint); display: flex; align-items: center; padding-right: 6px; }

/* ============ Detail pages ============ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 0.88rem; }
.kv .k { color: var(--text-faint); font-weight: 600; }
.kv .v { word-break: break-word; font-family: var(--mono); font-size: 0.82rem; }
pre.codeblock {
  background: rgba(7,12,20,0.8); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px; font-family: var(--mono); font-size: 0.78rem; line-height: 1.65;
  overflow-x: auto; max-height: 340px; overflow-y: auto; color: #c8d6ee; white-space: pre-wrap; word-break: break-word;
}
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { font-family: var(--mono); font-size: 0.8rem; }

/* skeleton empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty .big { font-size: 2.4rem; margin-bottom: 10px; }
.empty h3 { color: var(--text-dim); margin-bottom: 6px; font-weight: 700; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(4,7,12,0.7); backdrop-filter: blur(6px);
  z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: 20px;
  width: 100%; max-width: 560px; padding: 30px; max-height: 88vh; overflow-y: auto;
  animation: rise .3s ease both;
}
.modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.modal .close-x { float: right; cursor: pointer; color: var(--text-faint); font-size: 1.2rem; background: none; border: none; }

/* progress */
.bar-track { height: 8px; border-radius: 100px; background: rgba(148,163,184,0.12); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease; }

/* avatars */
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 0.82rem; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* footer */
.public-foot { text-align: center; padding: 30px; color: var(--text-faint); font-size: 0.82rem; border-top: 1px solid var(--border); }

/* responsive app */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .sidebar .brand { padding: 0 12px 0 0; }
  .sidebar nav { flex-direction: row; }
  .sidebar .side-foot { display: none; }
  .main { padding: 18px 16px 40px; }
}
