@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:       #06080f;
  --bg1:      #0b0f1a;
  --bg2:      #111827;
  --surface:  rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.14);
  --text:     #f1f5f9;
  --text2:    #94a3b8;
  --text3:    #475569;
  --accent:   #6366f1;
  --accent2:  #a855f7;
  --green:    #10b981;
  --red:      #f43f5e;
  --yellow:   #f59e0b;
  --grad:     linear-gradient(135deg, #6366f1, #a855f7);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent2); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ══════════════════════════════════════════
   NAV
══════════════════════════════════════════ */
nav {
  position: sticky; top: 0; z-index: 100;
  height: 60px;
  background: rgba(6,8,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -.02em;
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text2); font-size: .875rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-pill {
  background: var(--grad); color: #fff !important;
  padding: .4rem 1.1rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  transition: opacity .2s, transform .15s;
}
.nav-pill:hover { opacity: .9; transform: translateY(-1px); }

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

.layout { display: flex; min-height: calc(100vh - 60px); }

/* ── Sidebar ── */
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}

.sidebar-section {
  padding: .25rem .75rem .1rem 1.2rem;
  font-size: .7rem; font-weight: 600;
  color: var(--text3); letter-spacing: .08em; text-transform: uppercase;
  margin-top: .5rem;
}

.sidebar-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1.2rem;
  color: var(--text2); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: all .15s; text-decoration: none;
  border-left: 2px solid transparent;
  position: relative;
}
.sidebar-item:hover { color: var(--text); background: var(--surface); }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(99,102,241,.08); }
.sidebar-item .icon { font-size: 1rem; width: 18px; text-align: center; }

.main-content { flex: 1; padding: 2rem 2.5rem; overflow-y: auto; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 1.5rem 1rem; }
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }
.card + .card { margin-top: 1rem; }

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--text); margin-bottom: 1rem;
}

/* Glow card */
.card-glow {
  background: var(--surface);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 14px; padding: 1.5rem;
  box-shadow: 0 0 30px rgba(99,102,241,.08);
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 500px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-label { font-size: .75rem; color: var(--text3); font-weight: 500; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub { font-size: .75rem; color: var(--text3); margin-top: .3rem; }
.stat-up { color: var(--green); }
.stat-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; margin-top: .4rem; }

/* ══════════════════════════════════════════
   GRID HELPERS
══════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
@media (max-width: 768px) { .grid-2,.grid-3 { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text2); margin-bottom: .45rem; letter-spacing: .02em; }
.form-control {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: .65rem .9rem;
  color: var(--text);
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-control::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.3rem;
  border-radius: 10px;
  font-size: .875rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; border: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,.3);
}
.btn-primary:hover { opacity: .9; box-shadow: 0 6px 20px rgba(99,102,241,.4); transform: translateY(-1px); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: rgba(255,255,255,.1); border-color: var(--border2); }

.btn-danger { background: rgba(244,63,94,.15); color: var(--red); border: 1px solid rgba(244,63,94,.25); }
.btn-danger:hover { background: rgba(244,63,94,.25); }

.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }

.btn-sm { padding: .35rem .85rem; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; border-radius: 12px; }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-green { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.badge-red   { background: rgba(244,63,94,.12);  color: #fb7185; border: 1px solid rgba(244,63,94,.2); }
.badge-blue  { background: rgba(99,102,241,.12); color: #818cf8; border: 1px solid rgba(99,102,241,.2); }
.badge-yellow{ background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.badge-gray  { background: rgba(255,255,255,.06); color: var(--text2); border: 1px solid var(--border); }

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  color: var(--text3); font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .06em;
  text-align: left; padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
}
td { padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.04); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ══════════════════════════════════════════
   ALERTS
══════════════════════════════════════════ */
.alert {
  padding: .8rem 1rem; border-radius: 10px;
  font-size: .85rem; font-weight: 500;
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #34d399; }
.alert-error   { background: rgba(244,63,94,.1);  border: 1px solid rgba(244,63,94,.25);  color: #fb7185; }

/* ══════════════════════════════════════════
   CODE
══════════════════════════════════════════ */
pre {
  background: #080b12;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  font-size: .8rem; line-height: 1.7;
  position: relative;
}
code { font-family: 'JetBrains Mono', monospace; color: #a5b4fc; }
pre .str  { color: #86efac; }
pre .key  { color: #f9a8d4; }
pre .num  { color: #fde68a; }
pre .cmt  { color: #475569; }
pre .kw   { color: #818cf8; }

/* Copy button on pre */
pre .copy-btn {
  position: absolute; top: .7rem; right: .7rem;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text2); font-size: .7rem; font-family: 'Inter', sans-serif;
  padding: .25rem .6rem; border-radius: 6px; cursor: pointer;
  transition: all .15s;
}
pre .copy-btn:hover { background: var(--surface2); color: var(--text); }

/* ══════════════════════════════════════════
   TABS
══════════════════════════════════════════ */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem; overflow-x: auto;
}
.tab {
  padding: .6rem 1.2rem; cursor: pointer;
  font-size: .825rem; font-weight: 500; color: var(--text2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ══════════════════════════════════════════
   KEYCODE BOX
══════════════════════════════════════════ */
.keycode-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: 10px; padding: .75rem 1rem;
}
.keycode-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem; color: var(--accent2);
  word-break: break-all;
}

/* ══════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,.18), transparent);
}
.auth-card {
  background: var(--bg1);
  border: 1px solid var(--border2);
  border-radius: 20px; padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.4);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-mark {
  display: inline-block;
  width: 56px; height: 56px;
  background: var(--grad);
  border-radius: 16px;
  margin-bottom: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto .75rem;
}
.auth-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-logo p { color: var(--text2); font-size: .875rem; margin-top: .3rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.2rem 0; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: var(--border); }
.auth-divider span { color: var(--text3); font-size: .75rem; }

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

/* ══════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════ */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem; font-weight: 700; color: var(--text);
}
.page-header p { color: var(--text2); font-size: .875rem; margin-top: .3rem; }

/* ══════════════════════════════════════════
   LANDING
══════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 7rem 1.5rem 5rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99,102,241,.22) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(168,85,247,.12) 0%, transparent 60%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  color: #a5b4fc; font-size: .8rem; font-weight: 600;
  padding: .35rem 1rem; border-radius: 999px;
  margin-bottom: 1.5rem;
  letter-spacing: .03em;
}
.hero-eyebrow::before { content: '●'; color: var(--green); font-size: .5rem; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.8rem; font-weight: 800; line-height: 1.08;
  letter-spacing: -.04em;
  color: var(--text);
  margin-bottom: 1.2rem;
}
.hero h1 .grad-text {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text2); font-size: 1.1rem; line-height: 1.7;
  max-width: 520px; margin: 0 auto 2.5rem;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 768px) { .hero h1 { font-size: 2.4rem; } }

/* Feature cards */
.features-section { padding: 3rem 0 5rem; }
.features-title {
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700;
  margin-bottom: .5rem;
}
.features-sub { text-align: center; color: var(--text2); margin-bottom: 3rem; }

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.feature-card:hover {
  border-color: rgba(99,102,241,.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.3);
}
.feature-icon {
  width: 44px; height: 44px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: 1rem;
}
.feature-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 700; margin-bottom: .5rem;
}
.feature-card p { color: var(--text2); font-size: .875rem; line-height: 1.6; }

/* API demo block */
.api-demo {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  margin: 4rem 0;
}
.api-demo-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.api-demo-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.api-demo-body { padding: 1.5rem; }

/* Stats bar */
.stats-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1.5rem; text-align: center;
  margin: 3rem 0;
}
@media (max-width:768px) { .stats-bar { grid-template-columns: 1fr 1fr; } }
.stats-bar .n {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-bar .l { color: var(--text2); font-size: .825rem; margin-top: .3rem; }

/* Pricing cards */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
}
.pricing-card.featured {
  border-color: rgba(99,102,241,.45);
  background: rgba(99,102,241,.06);
  box-shadow: 0 0 40px rgba(99,102,241,.1);
}
.pricing-card .price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem; font-weight: 800;
}
.pricing-card .price span { font-size: 1rem; font-weight: 400; color: var(--text2); }
.pricing-features { list-style: none; margin-top: 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.pricing-features li { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--text2); }
.pricing-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text3); font-size: .8rem;
}

/* Divider */
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Utility */
.text-muted { color: var(--text2); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-mono   { font-family: 'JetBrains Mono', monospace; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* Tooltip (for keycode copy) */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-wrap .tooltip {
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); font-size: .75rem;
  padding: .3rem .6rem; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.tooltip-wrap:hover .tooltip { opacity: 1; }

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text3);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; }
.empty-state p { font-size: .875rem; }

/* Notification dot */
.notify-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse 2s infinite;
}

/* Tag chips */
.chip {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 6px;
  font-size: .75rem; font-weight: 500;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
}
