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

:root {
  --red: #dc2626;
  --red-light: #ef4444;
  --red-dark: #991b1b;
  --red-soft: rgba(220, 38, 38, 0.08);
  --red-glow: rgba(220, 38, 38, 0.25);
  --gradient: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);

  --bg: #09090b;
  --bg-elevated: #111113;
  --bg-card: #151518;
  --bg-surface: rgba(255, 255, 255, 0.025);

  --text: #fafafa;
  --text-dim: #a1a1aa;
  --text-faint: #52525b;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --green: #10b981;
  --blue: #3b82f6;
  --yellow: #f59e0b;
  --purple: #9333ea;
  --cyan: #06b6d4;
  --orange: #ea580c;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ---- Background ---- */
.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% -10%, rgba(220, 38, 38, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(220, 38, 38, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Utility ---- */
.muted { color: var(--text-dim); }
.red { color: var(--red); }
.green { color: var(--green); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-body);
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 20px var(--red-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--red-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-danger { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-success { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.2); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 0.2s; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Top Nav ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  height: 64px;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  font-family: var(--font-heading);
}
.topnav .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  font-family: var(--font-heading);
}
.topnav-links {
  display: flex;
  gap: 32px;
}
.topnav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
  position: relative;
}
.topnav-links a:hover, .topnav-links a.active { color: var(--text); }
.topnav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
}
.topnav-actions { display: flex; gap: 8px; align-items: center; }

/* Mobile menu toggle */
.topnav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
}

/* ---- Hero ---- */
.hero {
  padding: 120px 40px 100px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--red-soft);
  color: var(--red-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.15);
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text);
}
.hero-title .red {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lede {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-features {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.hero-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}
.hero-feature .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* ---- Sections ---- */
.section {
  padding: 80px 40px;
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.section-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: var(--red-soft);
  color: var(--red-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.12);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}
.section-sub {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Exam Grid ---- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.exam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
  position: relative;
}
.exam-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.exam-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  font-family: var(--font-heading);
}
.exam-card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.exam-card-full {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.exam-card-date {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---- Countdown ---- */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.countdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.countdown-exam {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--font-heading);
}
.countdown-days {
  font-size: 32px;
  font-weight: 700;
  color: var(--red);
  font-family: var(--font-mono);
  line-height: 1;
  margin: 8px 0;
}
.countdown-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ---- How Steps ---- */
.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
  counter-reset: step;
}
.step-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(220,38,38,0.15);
  font-family: var(--font-mono);
}
.step-card h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.step-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ---- Pricing ---- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.price-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: all 0.2s ease;
}
.price-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.price-card.featured {
  background: linear-gradient(180deg, rgba(220,38,38,0.08), rgba(220,38,38,0.02));
  border-color: rgba(220,38,38,0.25);
}
.price-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: var(--gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 999px;
  text-transform: uppercase;
}
.price-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.price-card .plan-type {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.price-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--red);
  font-family: var(--font-mono);
  margin: 14px 0;
  line-height: 1;
}
.price-amount small {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  font-family: var(--font-body);
}
.price-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 18px; }

/* ---- FAQ ---- */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  -webkit-user-select: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  color: var(--text-faint);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--red); }
.faq-item p { padding: 0 20px 18px; color: var(--text-dim); font-size: 14px; line-height: 1.7; }

/* ---- Footer ---- */
.footer {
  margin-top: 80px;
  padding: 48px 40px 28px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.footer-inner { max-width: 1140px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.footer-brand p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
  margin: 14px 0 0;
  max-width: 320px;
}
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--red-light); }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- App Layout (Dashboard/Admin) ---- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 50;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  font-family: var(--font-heading);
}
.sidebar .brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-heading);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar .nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  padding: 14px 12px 6px;
  margin-top: 4px;
}
.sidebar .nav-section:first-child { margin-top: 0; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 40px;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.sidebar a.active {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}
.sidebar a .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.user-card .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.user-card .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card .balance {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  font-family: var(--font-mono);
}

.main {
  margin-left: 250px;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(12px);
}
.app-topbar h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}
.app-topbar .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.app-content {
  flex: 1;
  padding: 28px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* ---- Welcome Banner ---- */
.welcome-banner {
  background: linear-gradient(135deg, rgba(220,38,38,0.1), rgba(220,38,38,0.02));
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.welcome-banner h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.welcome-banner p { font-size: 14px; color: var(--text-dim); }
.welcome-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
}
.stat-card:hover { background: rgba(255,255,255,0.035); }
.stat-icon { font-size: 18px; margin-bottom: 8px; }
.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ---- Cards ---- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title a { font-size: 12px; color: var(--red); font-weight: 600; }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
  min-height: 44px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.input::placeholder { color: var(--text-faint); }
.textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ---- Alerts ---- */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.alert.show { display: block; }
.alert-error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.alert-info { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); color: #93c5fd; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-red { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.badge-green { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.badge-yellow { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.badge-blue { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.badge-gray { background: rgba(255, 255, 255, 0.05); color: var(--text-dim); }

/* ---- Tables ---- */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.table-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.data-table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  max-width: 100%;
}
.data-table th {
  text-align: left;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table tr:last-child td { border-bottom: none; }
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.empty .icon { font-size: 38px; margin-bottom: 12px; opacity: 0.4; }

/* ---- Modals ---- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.active { display: flex; }
.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
}
.modal-close { font-size: 24px; color: var(--text-dim); padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px 24px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Toasts ---- */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
}
.toast-item.success { border-left-color: var(--green); }
.toast-item.error { border-left-color: var(--red-light); }
@keyframes toast-in {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Auth Pages ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(17, 17, 19, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 17px;
  font-family: var(--font-heading);
}
.auth-brand .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  font-family: var(--font-heading);
}
.auth-card h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.auth-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.auth-foot a { color: var(--red-light); font-weight: 600; }
.back-home {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  z-index: 10;
  transition: all 0.2s;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.back-home:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* ---- Payment Intent ---- */
.intent-box {
  background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(220,38,38,0.02));
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.intent-amount-big {
  font-size: 40px;
  font-weight: 700;
  color: var(--red);
  font-family: var(--font-mono);
  line-height: 1;
  margin: 8px 0;
}
.countdown-timer {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--green);
  margin: 6px 0;
}
.countdown-bar { height: 4px; background: rgba(255,255,255,0.04); border-radius: 999px; overflow: hidden; }
.countdown-fill { height: 100%; width: 100%; background: var(--green); transition: width 1s linear; }

/* ---- Verify Nag ---- */
.verify-nag {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02));
  border-bottom: 1px solid rgba(245,158,11,0.15);
  font-size: 13px;
}
.verify-nag b { color: #fbbf24; }

/* ---- Loading ---- */
.loading { padding: 60px 20px; text-align: center; color: var(--text-dim); font-size: 13px; }
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Answers ---- */
.answer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.answer-card:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.035); }
.answer-card h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.answer-card .meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 10px; }
.answer-content {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  line-height: 1.8;
  font-size: 14px;
  max-height: 70vh;
  overflow-y: auto;
}
.answer-content h1, .answer-content h2, .answer-content h3 { margin: 14px 0 8px; font-family: var(--font-heading); }
.answer-content p { margin: 10px 0; }
.answer-content ol, .answer-content ul { margin: 10px 0 10px 22px; }
.answer-content code { background: rgba(220,38,38,0.08); padding: 2px 6px; border-radius: 4px; color: var(--red-light); font-size: 12px; font-family: var(--font-mono); }
.answer-content pre { background: rgba(0,0,0,0.35); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; margin: 12px 0; font-family: var(--font-mono); }

/* ---- Content Pages ---- */
.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 24px 80px;
  position: relative;
  z-index: 1;
}
.content-page h1 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  line-height: 1.8;
  color: var(--text-dim);
  font-size: 14px;
}
.content-card h2 {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}
.content-card h2:first-child { margin-top: 0; }
.content-card ul { margin: 10px 0 10px 22px; }
.content-card li { margin-bottom: 4px; }
.content-card b { color: var(--text); }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .topnav { padding: 0 20px; }
  .topnav-links { display: none; }
  .topnav-toggle { display: flex; }
  .hero { padding: 80px 20px 60px; }
  .section { padding: 60px 20px; }
  .footer { padding: 40px 20px 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .how-steps { grid-template-columns: 1fr 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
  .content-page { padding: 80px 20px 60px; }
  .content-card { padding: 24px; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 6px 10px;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar .brand, .sidebar .sidebar-foot, .sidebar .nav-section { display: none; }
  .sidebar nav { flex-direction: row; gap: 2px; flex: 1; }
  .sidebar a {
    flex-direction: column;
    font-size: 9px;
    padding: 8px 4px;
    flex: 1;
    min-width: 56px;
    text-align: center;
    justify-content: center;
    min-height: 52px;
  }
  .sidebar a .icon { font-size: 18px; }
  .sidebar a.active { box-shadow: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .app-topbar { padding: 14px 18px; }
  .app-content { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .modal { padding: 12px; }
  .modal-box { max-width: 100%; border-radius: var(--radius); }
  .data-table { min-width: 520px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 32px; }
  .hero-features { gap: 16px; flex-direction: column; align-items: center; }
  .footer-cols { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .topnav-actions .btn-ghost { display: none; }
}
