/* ── Warren Design System ───────────────────────────────────────── */
:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #1a1a24;
  --border:    #2a2a38;
  --accent:    #7c6af7;
  --accent2:   #5b4fcf;
  --accent-glow: rgba(124,106,247,0.18);
  --text:      #e8e8f0;
  --text2:     #9090a8;
  --text3:     #5a5a72;
  --green:     #3dd68c;
  --red:       #f87171;
  --yellow:    #fbbf24;
  --radius:    10px;
  --radius-lg: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::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);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #a090ff; }

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

/* ── Nav ──────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; height: 60px; gap: 32px;
}
.nav-logo {
  font-weight: 700; font-size: 18px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo svg { color: var(--accent); }
.nav-links { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text2); font-size: 14px; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links .btn-sm { margin-left: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; transition: all .15s; text-decoration: none;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: #8b7aff; color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(124,106,247,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-glow); border: 1px solid rgba(124,106,247,0.3);
  color: #a090ff; font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 99px; margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 20px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 18px; color: var(--text2); max-width: 560px;
  margin: 0 auto 36px;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Terminal demo */
.terminal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0;
  max-width: 600px; margin: 60px auto 0;
  text-align: left; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.terminal-bar {
  background: var(--bg3); padding: 12px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.r { background: #f87171; }
.terminal-dot.y { background: #fbbf24; }
.terminal-dot.g { background: #3dd68c; }
.terminal-title { font-size: 12px; color: var(--text3); margin-left: auto; margin-right: auto; font-family: var(--mono); }
.terminal-body { padding: 20px 20px 24px; font-family: var(--mono); font-size: 13px; line-height: 2; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--green); }
.terminal-body .dim { color: var(--text3); }

/* ── Sections ─────────────────────────────────────────────────────── */
section { padding: 80px 0; }
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 12px;
}
.section-title { font-size: clamp(24px, 4vw, 38px); font-weight: 700; margin-bottom: 16px; letter-spacing: -0.5px; }
.section-sub { color: var(--text2); font-size: 16px; max-width: 520px; }

/* ── Features ─────────────────────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin-top: 48px;
}
.feature-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--accent-glow); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 20px;
}
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text2); font-size: 14px; line-height: 1.7; }

/* ── Compare table ────────────────────────────────────────────────── */
.compare-wrap { overflow-x: auto; margin-top: 48px; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.compare-table th {
  padding: 14px 20px; text-align: left; font-size: 13px; font-weight: 600;
  color: var(--text2); border-bottom: 1px solid var(--border);
}
.compare-table th.warren { color: var(--accent); }
.compare-table td {
  padding: 14px 20px; font-size: 14px;
  border-bottom: 1px solid rgba(42,42,56,0.5);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--bg2); }
.tick { color: var(--green); }
.cross { color: var(--red); }
.compare-table td:first-child { color: var(--text2); }

/* ── Pricing ──────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin-top: 48px; align-items: start;
}
.plan-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  position: relative;
}
.plan-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124,106,247,0.08), var(--bg2));
}
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 99px; white-space: nowrap;
}
.plan-name { font-size: 14px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.plan-price { font-size: 40px; font-weight: 800; margin-bottom: 4px; }
.plan-price span { font-size: 16px; font-weight: 400; color: var(--text2); }
.plan-desc { color: var(--text2); font-size: 13px; margin-bottom: 24px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.plan-features li { font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── CTA ──────────────────────────────────────────────────────────── */
.cta-box {
  background: linear-gradient(135deg, rgba(124,106,247,0.12), rgba(91,79,207,0.06));
  border: 1px solid rgba(124,106,247,0.25);
  border-radius: var(--radius-lg); padding: 64px 40px;
  text-align: center;
}
.cta-box h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 16px; }
.cta-box p { color: var(--text2); margin-bottom: 32px; font-size: 16px; }

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 40px 0;
  color: var(--text3); font-size: 13px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text3); }
.footer-links a:hover { color: var(--text2); }

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

/* ── Auth pages ───────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 80px 24px 40px;
}
.auth-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 420px;
}
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-card .subtitle { color: var(--text2); font-size: 14px; margin-bottom: 32px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; color: var(--text2); }
.form-group input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; color: var(--text); font-size: 14px;
  font-family: var(--font); outline: none; transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text3); }
.form-error { font-size: 12px; color: var(--red); margin-top: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Alert ────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 20px; display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }
.alert-success { background: rgba(61,214,140,0.1); border: 1px solid rgba(61,214,140,0.3); color: var(--green); }
.alert-info { background: var(--accent-glow); border: 1px solid rgba(124,106,247,0.3); color: #a090ff; }

/* ── Dashboard ────────────────────────────────────────────────────── */
.dash-layout { display: flex; min-height: 100vh; padding-top: 60px; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 24px 0; position: fixed; top: 60px; bottom: 0; overflow-y: auto;
}
.sidebar-section { padding: 0 12px; margin-bottom: 6px; }
.sidebar-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: var(--text3); text-transform: uppercase;
  padding: 8px 12px 4px;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--text2);
  transition: all .15s; margin: 1px 0;
}
.sidebar a:hover { color: var(--text); background: var(--bg3); }
.sidebar a.active { color: var(--accent); background: var(--accent-glow); font-weight: 500; }
.sidebar-icon { width: 18px; text-align: center; }

.dash-main { margin-left: 220px; flex: 1; padding: 32px; max-width: calc(100vw - 220px); }
.dash-header { margin-bottom: 32px; }
.dash-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.dash-header p { color: var(--text2); font-size: 14px; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
}
.stat-label { font-size: 12px; color: var(--text3); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* Card */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.card-title { font-size: 15px; font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; }
table.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.dash-table td {
  padding: 13px 12px; font-size: 13px;
  border-bottom: 1px solid rgba(42,42,56,0.5);
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .5px;
}
.badge-free { background: rgba(144,144,168,0.15); color: var(--text2); }
.badge-dev { background: var(--accent-glow); color: #a090ff; border: 1px solid rgba(124,106,247,0.3); }
.badge-enterprise { background: rgba(251,191,36,0.15); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }
.badge-active { background: rgba(61,214,140,0.12); color: var(--green); }
.badge-inactive { background: rgba(248,113,113,0.12); color: var(--red); }

/* Code block */
.code-block {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; color: var(--text2);
  overflow-x: auto; margin: 8px 0;
}
.code-block .hl { color: var(--accent); }

/* Token reveal */
.token-display {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-family: var(--mono); font-size: 13px; color: var(--green);
}
.token-display .token-val { flex: 1; word-break: break-all; }
.copy-btn { cursor: pointer; color: var(--text3); font-size: 12px; flex-shrink: 0; }
.copy-btn:hover { color: var(--accent); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 460px;
  transform: translateY(10px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* Plan pill in sidebar */
.sidebar-plan {
  margin: 0 12px 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.sidebar-plan .plan-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.sidebar-plan .plan-name { font-size: 14px; font-weight: 600; color: var(--accent); }
.sidebar-plan .upgrade-link { font-size: 12px; color: var(--text3); display: block; margin-top: 4px; }
.sidebar-plan .upgrade-link:hover { color: var(--accent); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text2); font-size: 14px; margin-bottom: 20px; }

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

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideIn .2s ease; min-width: 220px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .dash-main { margin-left: 0; max-width: 100vw; padding: 20px 16px; }
  .nav-links .hide-mobile { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero { padding: 100px 0 60px; }
}
