/* ============================================================
   FastBin — refined cyber design system (single source of truth)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Surface */
  --bg-base: #0B0C0E;
  --bg-canvas: #111317;
  --bg-surface: #161A1F;
  --bg-raised: #1B2027;
  --bg-overlay: rgba(11, 12, 14, 0.85);

  /* Borders */
  --border-faint: #1F232A;
  --border-default: #262B33;
  --border-strong: #353B45;

  /* Text */
  --text-primary: #E6E9EE;
  --text-secondary: #8B93A0;
  --text-tertiary: #5A626E;
  --text-disabled: #3A4049;

  /* Accent — softer teal, not neon */
  --accent: #4CC8A3;
  --accent-dim: rgba(76, 200, 163, 0.55);
  --accent-faint: rgba(76, 200, 163, 0.10);
  --accent-glow: rgba(76, 200, 163, 0.20);

  /* Semantic */
  --danger: #FF4D5E;
  --danger-faint: rgba(255, 77, 94, 0.10);
  --danger-dim: rgba(255, 77, 94, 0.55);
  --warning: #FFB454;
  --warning-faint: rgba(255, 180, 84, 0.10);
  --warning-dim: rgba(255, 180, 84, 0.55);
  --info: #5EA9FF;
  --info-faint: rgba(94, 169, 255, 0.10);
  --info-dim: rgba(94, 169, 255, 0.55);

  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  --pad-page: 32px;
  --max-width: 1440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  min-height: 100vh;
}

/* No decorative dot grid — keep the surface clean */

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-glow); color: var(--text-primary); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: 56px;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-faint);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto; height: 100%;
  padding: 0 var(--pad-page);
  display: flex; align-items: center; gap: 32px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
}
.logo-mark {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: var(--bg-base);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
}
.logo-mute { color: var(--text-tertiary); font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.nav-link {
  padding: 6px 12px;
  color: var(--text-secondary);
  transition: color 120ms ease;
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: -19px;
  height: 2px; background: var(--accent);
}
.nav-num { display: none; }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 26px; height: 26px;
  background: var(--accent-faint); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  border: 1px solid var(--accent-dim);
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad-page);
}

.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 48px 0 20px;
}
.section-head h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.section-head .num { display: none; }
.section-head .rule { flex: 1; height: 1px; background: var(--border-faint); }
.section-head .meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.chip {
  padding: 3px 9px;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-family: var(--font-mono); font-size: 11px;
  cursor: pointer; letter-spacing: 0.02em;
  transition: all 120ms ease;
}
.chip:hover { color: var(--text-secondary); }
.chip.active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-faint);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 72px 0 48px;
  position: relative;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hero h1 {
  font-size: 44px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 720px;
}
.hero h1 em { font-style: normal; color: var(--text-primary); }
.hero h1 .accent { color: var(--text-primary); }
.hero-sub {
  font-size: 15px; color: var(--text-secondary);
  max-width: 560px; line-height: 1.6;
  margin-bottom: 28px;
}
.hero-actions { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: background 120ms ease, border-color 120ms ease;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--bg-raised); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--bg-base);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: #5DD4B0; border-color: #5DD4B0; }
.btn-danger { color: var(--danger); border-color: var(--danger-dim); background: var(--danger-faint); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 77, 94, 0.18); }
.btn-arrow { display: none; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================================
   STATS GRID
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  padding: 20px 22px;
  border: 1px solid var(--border-faint);
  border-radius: 8px;
  background: var(--bg-canvas);
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.stat-value {
  font-size: 30px; font-weight: 500;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
  color: var(--text-primary);
}
.stat-value.danger { color: var(--danger); }
.stat-value.accent { color: var(--accent); }
.stat-meta {
  margin-top: 6px; font-size: 12px;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 6px;
}
.stat-delta { color: var(--accent); }
.stat-delta.down { color: var(--danger); }

/* ============================================================
   PANEL
   ============================================================ */

.panel {
  border: 1px solid var(--border-faint);
  background: var(--bg-canvas);
  border-radius: 8px;
  padding: 22px;
}
.panel-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.panel-title .num { display: none; }
.panel-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }

/* ============================================================
   TAGS
   ============================================================ */

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-secondary);
}
.tag.danger { color: var(--danger); border-color: var(--danger-dim); background: var(--danger-faint); }
.tag.warning { color: var(--warning); border-color: var(--warning-dim); background: var(--warning-faint); }
.tag.accent { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-faint); }
.tag.info { color: var(--info); border-color: var(--info-dim); background: var(--info-faint); }

/* ============================================================
   FILE LIST (home, reverse history…)
   ============================================================ */

.list {
  border: 1px solid var(--border-faint);
  background: var(--bg-canvas);
  border-radius: 8px;
  overflow: hidden;
}
.list-head {
  display: grid;
  grid-template-columns: 12px minmax(0, 2.4fr) 90px 80px 110px 100px 70px;
  gap: 16px; padding: 12px 20px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-faint);
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.list-head > div:last-child { text-align: right; }
.row {
  display: grid;
  grid-template-columns: 12px minmax(0, 2.4fr) 90px 80px 110px 100px 70px;
  gap: 16px; padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid var(--border-faint);
  cursor: pointer;
  transition: background 120ms ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--bg-surface); }
.row:hover .row-hash { color: var(--accent); }

.row-status { width: 6px; height: 6px; border-radius: 50%; }
.row-status.malicious { background: var(--danger); box-shadow: 0 0 6px var(--danger-dim); }
.row-status.suspicious { background: var(--warning); box-shadow: 0 0 6px var(--warning-dim); }
.row-status.clean { background: var(--accent); box-shadow: 0 0 6px var(--accent-dim); }
.row-status.unknown { background: var(--text-tertiary); }
.row-status.analyzing { background: var(--info); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.row-main { min-width: 0; }
.row-hash {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 120ms ease;
}
.row-hash .hex { display: none; }
.row-meta {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
}
.row-meta .sep { color: var(--text-tertiary); }
.row-meta .family { color: var(--text-primary); }
.row-type { font-size: 12px; color: var(--text-secondary); }
.row-size { font-size: 12px; color: var(--text-secondary); font-feature-settings: 'tnum'; }
.row-score { display: flex; align-items: center; gap: 8px; }
.score-bar { flex: 1; height: 2px; background: var(--border-default); position: relative; overflow: hidden; }
.score-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--text-secondary); }
.score-bar-fill.high { background: var(--danger); box-shadow: 0 0 4px var(--danger-dim); }
.score-bar-fill.med { background: var(--warning); }
.score-bar-fill.low { background: var(--accent); }
.score-num {
  font-size: 12px; font-weight: 500;
  min-width: 24px; text-align: right;
  font-feature-settings: 'tnum';
}
.score-num.high { color: var(--danger); }
.score-num.med { color: var(--warning); }
.score-num.low { color: var(--accent); }
.score-num.none { color: var(--text-tertiary); }
.tag-cell { display: flex; gap: 4px; flex-wrap: wrap; }
.row-time {
  font-size: 12px;
  color: var(--text-tertiary); text-align: right;
}

/* ============================================================
   FORMS (login / register / contact)
   ============================================================ */

.auth-card {
  max-width: 420px;
  margin: 80px auto;
  padding: 36px;
  border: 1px solid var(--border-faint);
  background: var(--bg-canvas);
  border-radius: 10px;
}
.auth-card h1 {
  font-size: 24px; font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-card .sub {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 28px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 120ms ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent-dim);
}

/* Neutralize browser autofill yellow/blue background */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-base) inset;
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}
.field textarea { resize: vertical; min-height: 100px; }
.auth-card .actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.auth-card .actions .btn { flex: 1; justify-content: center; }
.auth-foot {
  margin-top: 20px;
  font-size: 12px; color: var(--text-tertiary);
  text-align: center;
}
.auth-foot a { color: var(--accent); }
.form-error {
  font-size: 12px; color: var(--danger);
  margin-top: 8px;
  font-family: var(--font-mono);
}
.form-success {
  font-size: 12px; color: var(--accent);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* Password strength meter (register page) */
.password-strength {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.password-strength .strength-fill {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  position: relative;
}
.password-strength .strength-fill::before {
  content: "";
  position: absolute; inset: 0 100% 0 0;
  background: var(--text-tertiary);
  transition: right 200ms ease, background 200ms ease;
}
.password-strength.strength-weak .strength-fill::before { right: 70%; background: var(--danger); }
.password-strength.strength-medium .strength-fill::before { right: 40%; background: var(--warning); }
.password-strength.strength-strong .strength-fill::before { right: 0; background: var(--accent); }
.password-strength.strength-weak .strength-text { color: var(--danger); }
.password-strength.strength-medium .strength-text { color: var(--warning); }
.password-strength.strength-strong .strength-text { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  margin-top: 80px;
  padding: 28px var(--pad-page);
  border-top: 1px solid var(--border-faint);
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 16px;
  max-width: var(--max-width); margin-left: auto; margin-right: auto;
}
.footer-mark { display: none; }
.footer-spacer { flex: 1; }

/* ============================================================
   TABS (reverse)
   ============================================================ */

.tabs {
  border-bottom: 1px solid var(--border-faint);
  display: flex; align-items: center;
  background: var(--bg-canvas);
}
.tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: color 120ms ease;
  background: transparent;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text-primary); }
.tab.active::after {
  content: "";
  position: absolute; inset: auto 0 -1px 0;
  height: 2px; background: var(--accent);
}
.tab .count {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 1px 7px;
  background: var(--bg-base);
  border-radius: 999px;
  font-feature-settings: 'tnum';
}
.tab.active .count { color: var(--accent); }

/* ============================================================
   ALERT
   ============================================================ */

.alert {
  border: 1px solid var(--border-default);
  background: var(--bg-canvas);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert.danger {
  border-color: var(--danger-dim);
  background: var(--danger-faint);
  color: var(--danger);
}
.alert.warning {
  border-color: var(--warning-dim);
  background: var(--warning-faint);
  color: var(--warning);
}
.alert.info {
  border-color: var(--info-dim);
  background: var(--info-faint);
  color: var(--info);
}

/* ============================================================
   AI REPORT (rendered markdown panel)
   ============================================================ */

.ai-report {
  padding: 24px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
}
.ai-report h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-faint);
}
.ai-report h2:first-child { margin-top: 0; }
.ai-report h3 { font-size: 13px; font-weight: 500; margin-top: 16px; margin-bottom: 6px; }
.ai-report p { margin-bottom: 10px; color: var(--text-secondary); }
.ai-report ul, .ai-report ol { padding-left: 22px; margin-bottom: 12px; color: var(--text-secondary); }
.ai-report li { margin-bottom: 4px; }
.ai-report code {
  font-family: var(--font-mono); font-size: 12px;
  padding: 1px 5px;
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  color: var(--accent);
}
.ai-report pre {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  padding: 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.ai-report pre code { border: none; padding: 0; background: transparent; color: var(--text-primary); }
.ai-report strong { color: var(--text-primary); font-weight: 500; }

.ai-report-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
.ai-report-empty .ai-icon { display: none; }
.ai-report-empty .hint {
  font-size: 12px;
  color: var(--text-disabled);
  margin-top: 12px;
}

.ai-report-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.ai-report-loading::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

/* ============================================================
   UTILS
   ============================================================ */

.hidden { display: none !important; }
.monospace { font-family: var(--font-mono); }
.text-mute { color: var(--text-tertiary); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }

/* Mobile fallback */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border-faint); }
  .hero h1 { font-size: 36px; }
  .row, .list-head { grid-template-columns: 12px 1fr 80px 50px; }
  .row > *:nth-child(4), .row > *:nth-child(5),
  .list-head > *:nth-child(4), .list-head > *:nth-child(5) { display: none; }
  .nav-links { display: none; }
}
