/* ===== SCB-BB Design System ===== */

:root {
  --scb-blue: #002D6E;
  --scb-blue-hover: #003D8F;
  --scb-blue-light: #E8EFF9;
  --scb-red: #D42A2A;
  --scb-orange: #E6890E;
  --scb-low-blue: #5B8AD4;
  --scb-info-grey: #8E97A8;
  --scb-green: #1a7a4c;

  --bg-page: #F5F7FA;
  --bg-white: #FFFFFF;
  --bg-hover: #EDF0F5;
  --border: #DDE2ED;
  --border-hover: #BFC7D9;
  --text-dark: #19252F;
  --text-body: #3B4A5A;
  --text-muted: #7584A3;
  --text-light: #ABB6CC;
  --text-white: #FFFFFF;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 8px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  --shadow-sm: 0 1px 3px rgba(0,45,110,0.06);
  --shadow-md: 0 4px 16px rgba(0,45,110,0.08);
  --shadow-lg: 0 8px 32px rgba(0,45,110,0.1);

  --transition: 0.2s ease;
}

/* ===== Reset ===== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg-page); color: var(--text-body); line-height: 1.5; }
a { color: var(--scb-blue); text-decoration: none; }
a:hover { color: var(--scb-blue-hover); }
h1, h2, h3, h4 { color: var(--text-dark); font-weight: 700; line-height: 1.25; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input { font-family: var(--font); }

/* ===== Utility ===== */

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.hidden { display: none !important; }
.text-mono { font-family: var(--font-mono); font-size: 13px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--scb-blue); color: var(--text-white); border-color: var(--scb-blue); }
.btn-primary:hover { background: var(--scb-blue-hover); border-color: var(--scb-blue-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; padding: 8px 12px; }
.btn-ghost:hover { color: var(--text-dark); background: var(--bg-hover); }
.btn-outline { background: transparent; color: var(--scb-blue); border: 1.5px solid var(--scb-blue); }
.btn-outline:hover { background: var(--scb-blue); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ===== Inputs ===== */

.input {
  width: 100%; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text-dark); background: var(--bg-white); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus { border-color: var(--scb-blue); box-shadow: 0 0 0 3px rgba(0,45,110,0.08); }
.input::placeholder { color: var(--text-light); }
.input-lg { padding: 14px 20px; font-size: 16px; }

/* ===== Toast notifications ===== */

.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  color: #fff; pointer-events: auto; max-width: 420px; box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease forwards;
}
.toast.toast-out { animation: toast-out 0.3s ease forwards; }
.toast-error { background: var(--scb-red); }
.toast-success { background: var(--scb-green); }
.toast-info { background: var(--scb-blue); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* ===== Navbar ===== */

.navbar {
  height: 56px; background: var(--bg-white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}

.navbar-logo {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  font-size: 18px; font-weight: 700; color: var(--text-dark);
}

.navbar-logo .logo-icon {
  width: 28px; height: 28px;
}

.navbar-logo .logo-text span { color: var(--scb-blue); font-weight: 400; }

.navbar-links { display: flex; align-items: center; gap: 24px; margin-right: 16px; }
.navbar-links a { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.navbar-links a:hover { color: var(--text-dark); }

.navbar-auth { display: flex; align-items: center; gap: 8px; }
.navbar-user { display: flex; align-items: center; gap: 12px; }
.nav-username { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.nav-domain { font-size: 12px; color: var(--text-muted); padding: 2px 8px; background: var(--scb-blue-light); border-radius: var(--radius-pill); }

.navbar-burger { display: none; border: none; background: none; color: var(--text-muted); padding: 4px; }

/* Mobile menu */
.mobile-menu {
  position: fixed; top: 56px; left: 0; right: 0; background: var(--bg-white);
  border-bottom: 1px solid var(--border); padding: 16px 24px; z-index: 99;
  display: flex; flex-direction: column; gap: 12px;
  animation: slide-down 0.2s ease;
}
.mobile-menu a { font-size: 14px; color: var(--text-body); padding: 8px 0; }
.mobile-menu-auth { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Landing: Hero ===== */

.hero {
  padding: 80px 0 60px; background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.hero-grid { display: flex; align-items: center; gap: 60px; }

.hero-text { flex: 1; }

.hero-title { font-size: 44px; font-weight: 800; margin-bottom: 16px; line-height: 1.15; }
.hero-title em { font-style: normal; color: var(--scb-blue); }

.hero-subtitle { font-size: 17px; color: var(--text-muted); margin-bottom: 32px; max-width: 480px; line-height: 1.6; }

.hero-form { display: flex; gap: 12px; margin-bottom: 12px; }
.hero-form .input { flex: 1; }

.hero-consent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light); }
.hero-consent input { accent-color: var(--scb-blue); }
.hero-captcha { margin-top: 16px; min-height: 100px; }
.hero-auth-gate { margin-top: 16px; padding: 20px 24px; background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius-lg); text-align: center; }
.hero-auth-text { font-size: 14px; color: var(--text-body); margin-bottom: 14px; }
.hero-auth-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hero-auth-or { font-size: 13px; color: var(--text-muted); }

.hero-visual { flex-shrink: 0; }

/* Demo card */
.demo-card {
  width: 320px; padding: 0; background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.demo-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.demo-status { color: var(--scb-green); font-weight: 600; }
.demo-status.scanning { color: var(--scb-blue); }
.demo-target { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }

.demo-donut { width: 140px; height: 140px; margin: 24px auto 16px; position: relative; }
.demo-donut canvas { width: 100%; height: 100%; }
.demo-donut-val {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 28px; font-weight: 700; color: var(--text-dark); text-align: center;
}
.demo-donut-val small { font-size: 13px; font-weight: 400; color: var(--text-light); }

.demo-bars { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.demo-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.demo-bar-label { width: 80px; color: var(--text-muted); flex-shrink: 0; text-align: right; }
.demo-bar-track { flex: 1; height: 6px; background: var(--bg-page); border-radius: 3px; overflow: hidden; }
.demo-bar-fill { height: 100%; border-radius: 3px; width: 0; transition: width 0.6s ease; }
.demo-bar-fill.crit { background: var(--scb-red); }
.demo-bar-fill.med { background: var(--scb-orange); }
.demo-bar-fill.low { background: var(--scb-low-blue); }
.demo-bar-fill.info { background: var(--scb-info-grey); }
.demo-bar-count { width: 20px; font-weight: 700; color: var(--text-dark); font-variant-numeric: tabular-nums; }

/* ===== Landing: Sections ===== */

.section { padding: 72px 0; }
.section-white { background: var(--bg-white); }
.section-title { font-size: 28px; text-align: center; margin-bottom: 12px; }
.section-sub { font-size: 15px; color: var(--text-muted); text-align: center; margin-bottom: 48px; }

.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature-card {
  padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card:hover .feature-icon { background: var(--scb-blue); color: var(--text-white); }
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  background: var(--scb-blue-light); color: var(--scb-blue); margin-bottom: 16px;
  transition: background var(--transition), color var(--transition);
}
.feature-card h3 { font-size: 15px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.steps-row { display: flex; align-items: flex-start; justify-content: center; gap: 8px; }
.step { flex: 1; max-width: 240px; text-align: center; padding: 20px; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--scb-blue); color: var(--text-white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin: 0 auto 14px;
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.step-arrow { padding-top: 28px; color: var(--text-light); flex-shrink: 0; }

.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg-white); border: none; font-size: 14px; font-weight: 500;
  color: var(--text-dark); text-align: left; transition: background var(--transition);
}
.faq-q:hover { background: var(--bg-hover); }
.faq-q svg { flex-shrink: 0; color: var(--text-light); transition: transform var(--transition); }
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding: 0 18px 14px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }

.footer { padding: 20px 0; border-top: 1px solid var(--border); background: var(--bg-white); }
.footer a { font-size: 13px; color: var(--text-muted); }
.footer a:hover { color: var(--text-dark); }
.footer-copy { font-size: 13px; color: var(--text-light); }

/* ===== Auth pages ===== */

.auth-page {
  min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center;
  padding: 40px 16px; background: var(--bg-page);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 36px; box-shadow: var(--shadow-sm);
}
.auth-card h2 { font-size: 24px; margin-bottom: 8px; }
.auth-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 13px; font-weight: 500; color: var(--text-dark); margin-top: 10px; }
.auth-form .btn { margin-top: 16px; }
.auth-footer { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-footer a { font-weight: 500; }
.auth-captcha { margin-top: 12px; min-height: 100px; }
.verify-resend { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.verify-resend .btn:disabled { color: var(--text-light); cursor: not-allowed; }
.verify-resend-timer { min-height: 18px; font-size: 12px; color: var(--text-muted); }
.phone-input-wrap {
  display: flex; align-items: center; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: border-color var(--transition);
}
.phone-input-wrap:focus-within { border-color: var(--scb-blue); }
.phone-prefix {
  padding: 10px 0 10px 14px; font-size: 15px; font-weight: 600;
  color: var(--text-dark); background: var(--bg-page); flex-shrink: 0;
  user-select: none; border-right: 1px solid var(--border);
  padding-right: 10px;
}
.phone-input {
  border: none !important; border-radius: 0 !important;
  padding-left: 12px; flex: 1; min-width: 0;
}

/* ===== Dashboard ===== */

.dash-page { padding: 32px 0; min-height: calc(100vh - 56px); }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.dash-header h2 { font-size: 22px; }
.dash-domain { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.dash-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dash-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dash-table th {
  padding: 10px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); text-align: left;
  background: var(--bg-page); border-bottom: 1px solid var(--border);
}
.dash-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--bg-hover); }
.dash-empty { text-align: center; color: var(--text-light); padding: 40px 16px !important; }

.dash-status { display: inline-flex; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.dash-status-done { background: #e6f4ea; color: var(--scb-green); }
.dash-status-running { background: var(--scb-blue-light); color: var(--scb-blue); }
.dash-status-error { background: #fdeaea; color: var(--scb-red); }

.dash-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.dash-pagination button { padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--bg-white); cursor: pointer; }
.dash-pagination button.active { background: var(--scb-blue); color: #fff; border-color: var(--scb-blue); }

/* ===== Results page ===== */

.results-topbar {
  height: 52px; background: var(--bg-white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
}
.results-topbar .home-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--text-muted); transition: all var(--transition);
  border: none; background: none; cursor: pointer;
}
.results-topbar .home-btn:hover { background: var(--bg-hover); color: var(--text-dark); }
.results-topbar .scan-id { font-size: 13px; color: var(--text-light); font-weight: 500; }
.results-topbar .target-url {
  flex: 1; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dark); background: var(--bg-page);
  outline: none; max-width: 400px; cursor: default;
}
.results-topbar .export-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; flex-shrink: 0;
  background: var(--scb-blue); color: #fff; border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.results-topbar .export-btn:hover { background: var(--scb-blue-hover); }
.results-topbar .export-btn:disabled { background: var(--bg-hover); color: var(--text-light); cursor: not-allowed; }

.summary-panel { padding: 24px 32px; background: var(--bg-white); border-bottom: 1px solid var(--border); }
.summary-grid { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }

.donut-wrap { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.donut-wrap svg { width: 100%; height: 100%; }
.donut-val {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 22px; font-weight: 700; color: var(--text-dark);
}
.donut-val small { font-size: 12px; font-weight: 400; color: var(--text-light); }

.sev-legend { display: flex; flex-direction: column; gap: 6px; }
.sev-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.sev-bar { width: 3px; height: 18px; border-radius: 2px; }
.sev-row strong { margin-left: 4px; color: var(--text-dark); font-weight: 600; }

.meta-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; margin-left: 16px; }
.meta-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.meta-item { display: flex; gap: 6px; font-size: 13px; }
.meta-label { color: var(--text-light); white-space: nowrap; }
.meta-val { color: var(--text-dark); font-weight: 500; }

.tabs-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); background: var(--bg-white); padding: 0 32px; }
.tab-btn {
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px; transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active { color: var(--scb-blue); border-bottom-color: var(--scb-blue); }


/* Master-detail */
.md-layout { display: flex; min-height: calc(100vh - 260px); }

.md-sidebar {
  width: 300px; border-right: 1px solid var(--border); background: var(--bg-white);
  overflow-y: auto; flex-shrink: 0;
}
.md-sidebar-search { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.md-sidebar-search .input { font-size: 13px; padding: 8px 12px; }

.md-detail { flex: 1; background: var(--bg-white); overflow-y: auto; }

/* Category tree */
.cat-group { border-bottom: 1px solid var(--border); }
.cat-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-dark);
  transition: background var(--transition); border: none; background: none; width: 100%; text-align: left;
}
.cat-head:hover { background: var(--bg-hover); }
.cat-head .cat-icon { font-size: 10px; color: var(--text-light); transition: transform var(--transition); }
.cat-group.open .cat-head .cat-icon { transform: rotate(90deg); }
.cat-head .cat-cnt {
  margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-light);
  background: var(--bg-hover); padding: 1px 8px; border-radius: var(--radius-pill);
}
.cat-children { display: none; }
.cat-group.open .cat-children { display: block; }

.cat-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 36px;
  font-size: 13px; color: var(--text-body); cursor: pointer;
  border-left: 3px solid transparent; transition: all var(--transition);
  animation: item-slide-in 0.2s ease;
}
.cat-item:hover { background: var(--bg-hover); }
.cat-item.active { background: var(--scb-blue-light); color: var(--scb-blue); border-left-color: var(--scb-blue); font-weight: 500; }

.cat-item .sev-bar-sm { width: 3px; height: 14px; border-radius: 2px; flex-shrink: 0; }

@keyframes item-slide-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* Vuln detail panel */
.vuln-panel { padding: 28px 32px; }
.vuln-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }

.sev-badge {
  display: inline-block; padding: 2px 10px; border-radius: 3px;
  font-size: 12px; font-weight: 600; color: #fff;
}
.sev-badge-critical, .sev-badge-high { background: var(--scb-red); }
.sev-badge-medium { background: var(--scb-orange); }
.sev-badge-low { background: var(--scb-low-blue); }
.sev-badge-info { background: var(--scb-info-grey); }

/* Perimeter table */
.perim-cards { padding: 24px 32px; }
.perim-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; }
.perim-card-title { font-size: 15px; font-weight: 600; color: var(--text-dark); font-family: var(--font-mono); margin-bottom: 12px; }
.perim-card-details { display: flex; flex-wrap: wrap; gap: 8px; }
.perim-tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; background: var(--bg-page); color: var(--text-body); border: 1px solid var(--border); }
.perim-tag-ok { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.perim-placeholder { text-align: center; color: var(--text-light); padding: 40px; font-size: 14px; }
.perim-table-legacy { width: 100%; border-collapse: collapse; }
.perim-table th {
  padding: 10px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-light); text-align: left; border-bottom: 1px solid var(--border); background: var(--bg-page);
}
.perim-table td { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }

/* Empty state */
.empty { text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 13px; color: var(--text-muted); max-width: 360px; margin: 0 auto; }

/* ===== Scan status banner ===== */

.scan-status-banner {
  display: flex; align-items: center; gap: 16px; padding: 14px 32px;
  background: var(--scb-blue); color: #fff;
  transition: background 0.5s ease;
}
.scan-status-banner.done { background: var(--scb-green); }
.scan-status-banner.error { background: var(--scb-red); }
.scan-status-banner.hidden { display: none !important; }

.scan-spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scan-status-icon { width: 18px; height: 18px; flex-shrink: 0; }
.scan-status-icon svg { animation: icon-pop 0.3s ease; }
@keyframes icon-pop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.scan-status-text { font-size: 14px; font-weight: 500; flex: 1; }
.scan-status-meta { display: flex; align-items: center; gap: 20px; font-size: 13px; opacity: 0.9; }
.scan-timer { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.scan-counter { font-variant-numeric: tabular-nums; }

.scan-share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius); color: #fff; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.scan-share-btn:hover { background: rgba(255,255,255,0.25); }

/* ===== Scan progress bar ===== */

.scan-progress { padding: 0; background: var(--bg-white); border-bottom: 1px solid var(--border); }
.progress-track { width: 100%; height: 5px; background: var(--bg-hover); overflow: hidden; }
.progress-fill {
  height: 100%; background: var(--scb-blue); transition: width 0.5s ease; width: 0;
}
.progress-fill.active {
  background: linear-gradient(90deg, var(--scb-blue), #3b7ddd, var(--scb-blue));
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
}
@keyframes progress-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.donut-wrap.scanning .donut-val { opacity: 0.55; }

.scan-status-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #fff; flex-shrink: 0;
  animation: dot-pulse 1.4s ease-in-out infinite;
}
@keyframes dot-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* Detail empty state during scan */
.scan-empty-state { text-align: center; padding: 80px 24px; }
.scan-empty-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--scb-blue); border-radius: 50%; margin: 0 auto 20px;
  animation: spin 0.9s linear infinite;
}
.scan-empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-dark); }
.scan-empty-state p { font-size: 13px; color: var(--text-muted); max-width: 340px; margin: 0 auto; }

/* ===== Vuln detail sections ===== */
.vuln-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.vuln-section:last-child { border-bottom: none; margin-bottom: 0; }
.vuln-section h4 { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--text-dark); }
.vuln-section p { font-size: 14px; line-height: 1.7; color: var(--text-body); margin-bottom: 8px; }
.vuln-section pre {
  background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; font-family: var(--font-mono); font-size: 12px; overflow-x: auto;
  line-height: 1.5; color: var(--text-muted); margin: 8px 0 0; white-space: pre-wrap;
  position: relative;
}
.vuln-section .copy-curl {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px; font-size: 11px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-white);
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.vuln-section .copy-curl:hover { color: var(--text-dark); border-color: var(--border-hover); }

/* ===== AI Summary ===== */
.ai-summary-wrap { padding: 0 32px 0; background: var(--bg-white); border-bottom: 1px solid var(--border); }
.ai-summary-card {
  margin: 16px 0; padding: 20px 24px; border: 1px solid var(--scb-blue-light);
  border-radius: var(--radius-lg); background: linear-gradient(135deg, #f0f4fb 0%, #e8eef9 100%);
}
.ai-summary-head {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  color: var(--scb-blue); margin-bottom: 12px;
}
.ai-summary-card p {
  font-size: 14px; line-height: 1.7; color: var(--text-body); margin: 0; white-space: pre-line;
}
.ai-summary-body { font-size: 14px; line-height: 1.7; color: var(--text-body); }
.ai-summary-body h3 { color: var(--scb-blue); font-weight: 600; font-size: 15px; margin: 20px 0 8px; }
.ai-summary-body h4 { color: var(--scb-blue); font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
.ai-summary-body h3:first-child, .ai-summary-body h4:first-child { margin-top: 0; }
.ai-summary-body p { margin: 0 0 8px; line-height: 1.7; }
.ai-summary-body p:last-child { margin-bottom: 0; }
.ai-summary-body strong { color: var(--text-dark); }
.ai-summary-body ul, .ai-summary-body ol { margin: 8px 0; padding-left: 24px; }
.ai-summary-body li { margin-bottom: 4px; line-height: 1.6; }
.ai-summary-body code {
  font-family: var(--font-mono); font-size: 12px;
  background: rgba(0,45,110,0.06); padding: 1px 5px; border-radius: 3px;
}
.ai-summary-body blockquote, .ai-quote {
  margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--scb-blue);
  background: rgba(0,45,110,0.03); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px; color: var(--text-body);
}
.ai-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ai-table th, .ai-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.ai-table th { background: var(--bg-page); font-weight: 600; color: var(--text-dark); }
.ai-table td { color: var(--text-body); }

/* ===== Animations ===== */

@media (prefers-reduced-motion: no-preference) {
  .anim-fade-in {
    opacity: 0; transform: translateY(16px);
    animation: fade-up 0.6s ease forwards;
  }
  .anim-delay-1 { animation-delay: 0.15s; }
  .anim-delay-2 { animation-delay: 0.3s; }

  .anim-on-scroll { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .anim-on-scroll.visible { opacity: 1; transform: translateY(0); }

  .view-transition { transition: opacity 0.2s ease; }

  .sev-row strong { transition: transform 0.15s ease; }
  .sev-row strong.pulse { animation: num-pulse 0.3s ease; }
}

@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }
@keyframes num-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ===== Responsive ===== */

@media (max-width: 1024px) {
  .hero-grid { flex-direction: column; text-align: center; }
  .hero-subtitle { margin: 0 auto 32px; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; align-items: center; gap: 16px; }
  .step-arrow { display: none; }
  .step { max-width: 100%; width: 100%; }
  .md-sidebar { width: 240px; }
  .summary-grid { flex-direction: column; align-items: flex-start; }
  .meta-grid { grid-template-columns: 1fr; margin-left: 0; }
  .meta-grid-3 { grid-template-columns: 1fr; }
  .scan-status-meta { gap: 12px; }
}

@media (max-width: 768px) {
  .dash-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .navbar { padding: 0 12px; height: 48px; }
  .navbar-logo { font-size: 16px; gap: 8px; }
  .navbar-logo .logo-icon { width: 24px; height: 24px; }
  .navbar-links { display: none; }
  .navbar-auth { display: none; }
  #nav-user-landing { display: none; }
  .navbar-burger { display: flex; }
  .mobile-menu-auth { flex-wrap: wrap; }
  .mobile-menu-auth .nav-username { flex: 1 1 100%; overflow-wrap: anywhere; }

  .hero { padding: 40px 0 32px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 15px; margin-bottom: 24px; }
  .hero-form { flex-direction: column; gap: 10px; }
  .hero-form .btn-lg { padding: 14px 24px; font-size: 15px; }
  .hero-consent { font-size: 12px; }

  .section { padding: 48px 0; }
  .section-title { font-size: 22px; margin-bottom: 8px; }
  .section-sub { font-size: 14px; margin-bottom: 32px; }

  .feature-card { padding: 20px; }
  .feature-card h3 { font-size: 14px; }
  .feature-card p { font-size: 12px; }

  .step { padding: 12px; }
  .step h3 { font-size: 14px; }
  .step p { font-size: 12px; }

  .faq-q { padding: 12px 14px; font-size: 13px; }
  .faq-a p { padding: 0 14px 12px; font-size: 12px; }

  .footer { padding: 16px 0; }
  .footer .container { flex-direction: column; gap: 8px; text-align: center; }
  .footer-links { gap: 12px; flex-wrap: wrap; justify-content: center; }
  .footer a { font-size: 12px; }
  .footer-copy { font-size: 12px; }

  .auth-card { padding: 28px 20px; }

  .results-topbar { padding: 0 12px; height: 44px; gap: 8px; }
  .results-topbar .scan-id { font-size: 11px; }
  .results-topbar .target-url { font-size: 12px; padding: 4px 8px; max-width: none; flex: 1; min-width: 0; }
  .results-topbar .home-btn { width: 36px; height: 36px; }

  .scan-status-banner { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .scan-status-text { font-size: 13px; flex: 1; min-width: 0; }
  .scan-status-meta { gap: 8px; font-size: 11px; width: 100%; justify-content: flex-start; }
  .scan-timer { font-size: 12px; }
  .scan-share-btn { padding: 4px 10px; font-size: 11px; }
  .scan-spinner { width: 14px; height: 14px; border-width: 2px; }

  .summary-panel { padding: 16px; }
  .summary-grid { gap: 16px; }
  .donut-wrap { width: 80px; height: 80px; }
  .donut-val { font-size: 18px; }
  .donut-val small { font-size: 10px; }
  .sev-row { font-size: 12px; }
  .meta-grid { gap: 4px 16px; }
  .meta-item { font-size: 12px; }
  .meta-label { font-size: 11px; }
  .meta-val { font-size: 12px; }

  .ai-summary-wrap { padding: 0 12px; }
  .ai-summary-card { padding: 14px 16px; margin: 12px 0; }
  .ai-summary-head { font-size: 13px; gap: 6px; }
  .ai-summary-body { font-size: 13px; line-height: 1.6; }
  .ai-summary-body h3 { font-size: 14px; margin: 14px 0 6px; }
  .ai-summary-body h4 { font-size: 13px; margin: 12px 0 4px; }
  .ai-summary-body p { font-size: 13px; margin: 0 0 6px; }
  .ai-summary-body ul, .ai-summary-body ol { padding-left: 18px; margin: 6px 0; }
  .ai-summary-body li { font-size: 13px; margin-bottom: 3px; }
  .ai-summary-body code { font-size: 11px; word-break: break-all; }
  .ai-summary-body blockquote, .ai-quote { font-size: 12px; padding: 8px 12px; margin: 8px 0; }

  .ai-table { font-size: 11px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ai-table th, .ai-table td { padding: 6px 8px; white-space: nowrap; }
  .ai-table td { white-space: normal; min-width: 80px; }

  .tabs-bar { padding: 0 12px; }
  .tab-btn { padding: 10px 14px; font-size: 13px; }

  .perim-cards { padding: 16px; }

  .md-layout { flex-direction: column; min-height: auto; }
  .md-sidebar { width: 100%; max-height: 300px; border-right: none; border-bottom: 1px solid var(--border); }
  .md-sidebar-search { padding: 8px 12px; }
  .md-sidebar-search .input { font-size: 12px; padding: 6px 10px; }
  .cat-head { padding: 10px 12px; font-size: 13px; min-height: 44px; }
  .cat-item { padding: 10px 12px 10px 28px; font-size: 12px; min-height: 44px; }

  .vuln-panel { padding: 16px; }
  .vuln-title { font-size: 16px; margin-bottom: 6px; }
  .vuln-section h4 { font-size: 14px; }
  .vuln-section p { font-size: 13px; }
  .vuln-section pre { padding: 10px; font-size: 11px; }


  .empty { padding: 40px 16px; }
  .scan-empty-state { padding: 40px 16px; }
  .scan-empty-spinner { width: 32px; height: 32px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 14px; }
  .scan-status-text { font-size: 12px; }
  .scan-status-meta { font-size: 10px; }
  .vuln-title { font-size: 15px; }
  .donut-wrap { width: 64px; height: 64px; }
  .donut-val { font-size: 16px; }
}
