/* SlamDoor — Design System
   Dark, bold, protective. Colors evoke security and trust. */

:root {
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-elevated: #1c1c26;
  --accent: #22c55e;
  --accent-dim: #16a34a;
  --gold: #eab308;
  --text: #f0f0f5;
  --text-muted: #888899;
  --text-dim: #555566;
  --border: #2a2a35;
  --border-light: #33334a;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-logo .logo-icon { font-size: 1.4rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-card);
}

.nav-scan-btn {
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  white-space: nowrap;
  transition: background 0.15s !important;
}

.nav-scan-btn:hover {
  background: var(--accent-dim) !important;
  color: #fff !important;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.page { padding: 48px 0 80px; }

/* ── Typography ── */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-elevated {
  background: var(--bg-elevated);
  border-color: var(--border-light);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-light);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-card); }

.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ── Risk badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-high   { background: rgba(234,179,8,0.18);  color: #eab308; border: 1px solid rgba(234,179,8,0.35); }
.badge-medium { background: rgba(234,179,8,0.12);  color: #eab308; border: 1px solid rgba(234,179,8,0.25); }
.badge-low    { background: rgba(34,197,94,0.18);  color: #22c55e; border: 1px solid rgba(34,197,94,0.35); }

/* ── Alert box ── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin: 16px 0;
}
.alert-danger { background: rgba(230,57,70,0.1); border-color: var(--danger); }
.alert-warning { background: rgba(233,196,106,0.1); border-color: var(--warning); }
.alert-success { background: rgba(42,157,143,0.1); border-color: var(--success); }
.alert-info { background: rgba(244,162,97,0.1); border-color: var(--gold); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.15s;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }

/* ── Section helpers ── */
.section { padding: 60px 0; }
.section-sm { padding: 32px 0; }
.section-title { margin-bottom: 8px; color: var(--accent); }
.section-subtitle { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 40px; }

/* ── Hero (full-viewport door background) ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4a0d1a;
  background-image:
    radial-gradient(ellipse at 50% 60%, #6b1c2e 0%, #3d0a18 45%, #1a0409 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  padding: 0;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 3px,
      rgba(0,0,0,0.04) 3px,
      rgba(0,0,0,0.04) 4px
    );
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,15,0.5) 0%,
    rgba(10,10,15,0.3) 40%,
    rgba(10,10,15,0.65) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 120px 24px 80px;
  max-width: 800px;
}

.hero-door {
  font-size: 5.5rem;
  margin-bottom: 28px;
  display: block;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.6));
  animation: hero-door-enter 0.8s ease-out both;
}

@keyframes hero-door-enter {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.hero-headline {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--gold);
  margin-bottom: 24px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.7), 0 0 60px rgba(234,179,8,0.15);
  letter-spacing: -0.02em;
  animation: hero-text-enter 0.8s 0.1s ease-out both;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(240,240,245,0.85);
  margin-bottom: 40px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
  animation: hero-text-enter 0.8s 0.2s ease-out both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: hero-text-enter 0.8s 0.3s ease-out both;
}

@keyframes hero-text-enter {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 640px) {
  .hero-door { font-size: 4rem; }
  .hero-inner { padding: 100px 20px 60px; }
}

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .container { padding: 0 16px; }
  .page { padding: 32px 0 60px; }
  .card { padding: 20px; }
  .btn-lg { padding: 14px 24px; }
}

/* ── Report page specific ── */
.report-content h3 { color: var(--accent); margin: 32px 0 12px; font-size: 1.15rem; }
.report-content p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.75; }
.report-content strong { color: var(--text); }

.key-facts { display: flex; flex-direction: column; gap: 10px; }
.key-fact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text-muted);
}
.key-fact::before { content: '⚡'; flex-shrink: 0; }

/* ── Chat interface ── */
.chat-messages {
  height: 360px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.ai {
  background: var(--bg-elevated);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-light);
}

.chat-msg.ai strong { color: var(--gold); }

/* ── Threat alert card ── */
.threat-card {
  border: 1px solid var(--danger);
  background: rgba(230, 57, 70, 0.05);
  border-radius: var(--radius);
  padding: 20px;
  margin: 12px 0;
}

.threat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.threat-icon { font-size: 1.5rem; }
.threat-name { font-weight: 700; font-size: 1rem; }
.threat-why { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 10px; }
.threat-action {
  color: var(--warning);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Scan button (floating) ── */
.fab-scan {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99;
  transition: all 0.2s;
}
.fab-scan:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(34, 197, 94, 0.5);
}

@media (max-width: 480px) {
  .fab-scan { padding: 14px; border-radius: 50%; }
  .fab-scan .fab-text { display: none; }
}
