/* ── Reset & Base ────────────────────────────────────────────────────────────── */

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

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-input: #242736;
  --text: #e4e5e9;
  --text-muted: #8b8d97;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --success: #22c55e;
  --border: #2d3044;
  --radius: 8px;
  --max-width: 1100px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

/* ── Navbar ──────────────────────────────────────────────────────────────────── */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.nav-links a:hover {
  color: var(--text);
}

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

.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  text-align: center;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

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

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--accent);
}

input::placeholder {
  color: var(--text-muted);
}

.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ── Hero Section ────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Features Grid ───────────────────────────────────────────────────────────── */

.features {
  padding: 3rem 0;
}

.features h2 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

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

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── CTA Section ─────────────────────────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Pricing ─────────────────────────────────────────────────────────────────── */

.pricing-hero {
  text-align: center;
  padding: 2rem 0;
}

.pricing-hero h1 {
  font-size: 2.25rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
}

.pricing-card-featured {
  border-color: var(--accent);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
}

.price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.price-compare {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.pricing-card li {
  padding: 0.375rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pricing-card li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 700;
}

.pricing-trial {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

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

.auth-page {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
}

.auth-page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-form {
  margin-top: 2rem;
  text-align: left;
}

.auth-switch {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Dashboard ───────────────────────────────────────────────────────────────── */

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.banner a {
  margin: 0 0.25rem;
}

.waitlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.waitlist-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.waitlist-meta {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.waitlist-meta code {
  background: var(--bg-input);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.waitlist-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ── Modal ────────────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ── Waitlist Signup Page ────────────────────────────────────────────────────── */

.waitlist-page {
  max-width: 500px;
  margin: 3rem auto;
  text-align: center;
}

.signup-form {
  margin-top: 2rem;
}

.counter {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

#count-number {
  font-weight: 700;
  color: var(--accent);
}

/* ── Success Page ────────────────────────────────────────────────────────────── */

.success-page {
  max-width: 560px;
  margin: 3rem auto;
  text-align: center;
}

.success-page h1 {
  font-size: 2rem;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.referral-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  text-align: left;
}

.referral-box h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.referral-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.referral-link-row {
  display: flex;
  gap: 0.5rem;
}

.referral-link-row input {
  flex: 1;
  font-size: 0.85rem;
}

.referral-count {
  margin-top: 1rem;
  font-size: 0.9rem;
}

#leaderboard-section {
  text-align: left;
  margin-top: 2rem;
}

#leaderboard-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

#leaderboard-list {
  padding-left: 1.5rem;
}

#leaderboard-list li {
  padding: 0.375rem 0;
  color: var(--text-muted);
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.825rem;
}

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

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

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .waitlist-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar {
    padding: 1rem;
  }

  .nav-links {
    gap: 0.75rem;
    font-size: 0.85rem;
  }
}
