:root {
  --bg-color: #0d0f17;
  --text-color: #f3f4f6;
  --text-muted: #9ca3af;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.12);
  --primary-gradient: linear-gradient(135deg, #6c5ce7, #3b82f6);
  --accent-emerald: #10b981;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html.light {
  --bg-color: #f8fafc;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.08);
  --input-bg: rgba(0, 0, 0, 0.03);
  --input-border: rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Background Blobs */
.blob {
  position: absolute;
  width: 350px;
  height: 350px;
  filter: blur(120px);
  z-index: -1;
  border-radius: 50%;
  opacity: 0.5;
}
.blob-purple { top: 10%; left: -100px; background: #6c5ce7; }
.blob-blue { top: 40%; right: -100px; background: #3b82f6; }
.blob-emerald { bottom: 10%; left: 30%; background: #10b981; }

/* Glassmorphism Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 99px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.6);
}
.btn-ghost {
  background: transparent;
  color: var(--text-color);
}
.btn-ghost:hover {
  background: var(--card-border);
}
.w-full { width: 100%; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 16px 0;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  font-family: var(--font-heading);
}
.logo span { color: #6c5ce7; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-color); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.theme-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 80px 24px;
}
.hero-text h1 { font-size: 3.2rem; line-height: 1.1; margin: 16px 0; }
.hero-text p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; }

/* Floating Coin Visual */
.hero-visual { position: relative; display: flex; justify-content: center; }
.floating-coin {
  font-size: 8rem;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 80px;
}
.stat-card { text-align: center; }
.stat-card h2 { font-size: 2.2rem; margin-bottom: 8px; color: #10b981; }

/* Modal & Forms Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.modal-content {
  width: 100%;
  max-width: 440px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
}
.tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  color: var(--text-color);
  border-bottom: 2px solid #6c5ce7;
}

/* Form Controls & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-group input,
.referral-box input,
.withdraw-card input {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}
.form-group input:focus,
.withdraw-card input:focus {
  border-color: #6c5ce7;
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
}
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.form-options a {
  color: #6c5ce7;
  text-decoration: none;
}

/* Footer Section */
.footer {
  border-top: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  padding: 60px 0 20px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand p {
  margin-top: 12px;
  color: var(--text-muted);
  max-width: 300px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links h4,
.footer-contact h4 {
  margin-bottom: 12px;
  color: var(--text-color);
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--text-color);
}
.footer-contact p {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Utilities */
.hidden { display: none !important; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}