:root {
  --bg: #0a0a0b;
  --bg-raised: #141416;
  --bg-input: #1a1a1e;
  --border: #2a2a2e;
  --text: #e8e8ec;
  --text-secondary: #8e8e96;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
}

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

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Typography ──────────────────────────────────────────────────────────── */

h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; text-align: center; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ─── Logo ────────────────────────────────────────────────────────────────── */

.logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.logo span { color: var(--accent); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: 0.6rem 0.75rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: 0.95rem;
}
input:focus { outline: none; border-color: var(--accent); }
.inline-form { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.inline-form input { flex: 1; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}

/* ─── Errors / Banners ────────────────────────────────────────────────────── */

.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 0.75rem; }
.banner {
  background: rgba(99,102,241,0.1); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem;
}
.banner code {
  display: block; margin: 0.5rem 0; padding: 0.5rem;
  background: var(--bg); border-radius: 4px; font-family: var(--font-mono);
  font-size: 0.8rem; word-break: break-all;
}

/* ─── Landing ─────────────────────────────────────────────────────────────── */

.landing-header { padding: 1rem 0; }
.landing-header .container { display: flex; justify-content: space-between; align-items: center; }
.landing-nav a { color: var(--text-secondary); margin-left: 1.5rem; }
.landing-nav a:hover { color: var(--text); }

.hero { padding: 6rem 0 4rem; text-align: center; }
.hero h1 { font-size: 3rem; letter-spacing: -1px; line-height: 1.15; margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.15rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

.features { padding: 4rem 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.feature-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.pricing { padding: 4rem 0 6rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; max-width: 900px; margin: 2rem auto 0; }
.pricing-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; }
.pricing-card.featured { border-color: var(--accent); }
.pricing-card .price { font-size: 2.5rem; font-weight: 800; margin: 1rem 0; }
.pricing-card .price span { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.pricing-card ul { list-style: none; margin: 1.5rem 0; text-align: left; }
.pricing-card li { padding: 0.4rem 0; color: var(--text-secondary); }
.pricing-card li::before { content: "✓ "; color: var(--success); }
.pricing-card .btn { width: 100%; }

/* ─── Auth ────────────────────────────────────────────────────────────────── */

.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-tabs { display: flex; margin: -1.5rem -1.5rem 1.5rem; border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 0.75rem; background: none; border: none; color: var(--text-secondary); font-size: 0.95rem; cursor: pointer; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ─── App Layout ──────────────────────────────────────────────────────────── */

.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; padding: 1.5rem; background: var(--bg-raised);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.nav-link {
  display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius);
  color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.25rem;
}
.nav-link:hover { color: var(--text); background: var(--bg-input); }
.nav-link.active { color: var(--text); background: var(--bg-input); }
.sidebar-spacer { flex: 1; }
.main-content { flex: 1; padding: 2rem 2.5rem; overflow-y: auto; }
.panel { max-width: 800px; }

/* ─── Stats ───────────────────────────────────────────────────────────────── */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.stat-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ─── Lists ───────────────────────────────────────────────────────────────── */

.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.5rem;
}
.list-item-info { flex: 1; }
.list-item-info .name { font-weight: 500; }
.list-item-info .meta { font-size: 0.8rem; color: var(--text-secondary); }

/* ─── Setup ───────────────────────────────────────────────────────────────── */

.setup-steps { margin-top: 1.5rem; }
.step { margin-bottom: 2rem; }
.step h3 { color: var(--accent); }
pre {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.85rem; margin: 0.75rem 0;
}

/* ─── Billing ─────────────────────────────────────────────────────────────── */

.billing-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-spacer { display: none; }
  .main-content { padding: 1.5rem; }
}
