/* ──────────────────────────────────────────────
   UPSCALE — Design System
   Dark premium gamified study theme
────────────────────────────────────────────── */

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

/* ── Variables ── */
:root {
  --bg-base:      #080C18;
  --bg-surface:   #0F1729;
  --bg-card:      rgba(255, 255, 255, 0.04);
  --bg-card-hover:rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(108, 99, 255, 0.5);

  --indigo:       #6C63FF;
  --indigo-light: #8B85FF;
  --indigo-dark:  #4A42D4;
  --gold:         #F59E0B;
  --gold-light:   #FBC237;
  --emerald:      #10B981;
  --emerald-light:#34D399;
  --rose:         #F43F5E;
  --purple:       #A855F7;
  --amber:        #F97316;

  --text-primary: #E8E8F0;
  --text-secondary:#B8B8CC;
  --text-muted:   #6B6B85;
  --text-accent:  #8B85FF;

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;

  --shadow-glow-indigo: 0 0 24px rgba(108, 99, 255, 0.25);
  --shadow-card:        0 4px 32px rgba(0, 0, 0, 0.4);
  --shadow-card-hover:  0 8px 48px rgba(0, 0, 0, 0.5);

  --transition-fast:  150ms ease;
  --transition-base:  250ms ease;
  --transition-slow:  400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

a { color: var(--indigo-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--indigo); }

img { max-width: 100%; display: block; }

/* ──────────────────────────────────────────────
   BACKGROUND ANIMATION
────────────────────────────────────────────── */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Gradient base layers */
.bg-animation::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.07) 0%, transparent 65%);
  animation: pulseGlow 10s ease-in-out infinite alternate;
}

.bg-animation::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, transparent 65%);
  animation: pulseGlow 14s ease-in-out infinite alternate-reverse;
}

@keyframes pulseGlow {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* Floating particles */
.bg-animation span {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}

.bg-animation span:nth-child(1) {
  width: 5px; height: 5px;
  left: 12%; bottom: -10px;
  background: rgba(108, 99, 255, 0.7);
  animation-duration: 16s; animation-delay: 0s;
}
.bg-animation span:nth-child(2) {
  width: 3px; height: 3px;
  left: 28%; bottom: -10px;
  background: rgba(245, 158, 11, 0.6);
  animation-duration: 12s; animation-delay: 3s;
}
.bg-animation span:nth-child(3) {
  width: 6px; height: 6px;
  left: 47%; bottom: -10px;
  background: rgba(16, 185, 129, 0.5);
  animation-duration: 20s; animation-delay: 6s;
}
.bg-animation span:nth-child(4) {
  width: 4px; height: 4px;
  left: 63%; bottom: -10px;
  background: rgba(108, 99, 255, 0.5);
  animation-duration: 14s; animation-delay: 1.5s;
}
.bg-animation span:nth-child(5) {
  width: 3px; height: 3px;
  left: 79%; bottom: -10px;
  background: rgba(168, 85, 247, 0.6);
  animation-duration: 18s; animation-delay: 8s;
}
.bg-animation span:nth-child(6) {
  width: 5px; height: 5px;
  left: 91%; bottom: -10px;
  background: rgba(245, 158, 11, 0.4);
  animation-duration: 22s; animation-delay: 4s;
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg);   opacity: 0; }
  8%   { opacity: 0.9; }
  85%  { opacity: 0.4; }
  100% { transform: translateY(-105vh) translateX(30px) rotate(540deg); opacity: 0; }
}

/* Grid dot overlay */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(108, 99, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* ──────────────────────────────────────────────
   LAYOUT
────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ──────────────────────────────────────────────
   NAVBAR
────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(8, 12, 24, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--indigo), var(--gold));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--indigo-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ──────────────────────────────────────────────
   GLASSMORPHISM CARD
────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), background var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card-hover);
}

/* ──────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--indigo-light), var(--indigo));
  box-shadow: 0 6px 24px rgba(108, 99, 255, 0.5);
  transform: translateY(-1px);
  color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #e08a00);
  color: #1a0a00;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
  color: #1a0a00;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
}

/* ──────────────────────────────────────────────
   FORM INPUTS
────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

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

.form-input:focus {
  outline: none;
  border-color: var(--indigo);
  background: rgba(108, 99, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.form-input.error {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

/* Select override */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B85' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.form-input option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.form-error {
  font-size: 12px;
  color: var(--rose);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Password strength indicator */
.password-match {
  font-size: 12px;
  margin-top: 6px;
  transition: color var(--transition-fast);
}
.password-match.ok   { color: var(--emerald); }
.password-match.fail { color: var(--rose); }

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--indigo);
  cursor: pointer;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────
   MESSAGES (Toast notifications)
────────────────────────────────────────────── */
.messages-container {
  position: fixed;
  top: 80px;
  right: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin-left: auto;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--emerald-light); }
.toast-error   { background: rgba(244, 63, 94, 0.15);  border: 1px solid rgba(244, 63, 94, 0.3);  color: #FB7185; }
.toast-info    { background: rgba(108, 99, 255, 0.15); border: 1px solid rgba(108, 99, 255, 0.3); color: var(--indigo-light); }
.toast-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--gold-light); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ──────────────────────────────────────────────
   AUTH PAGES (Login / Register)
────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 5vw, 44px) clamp(20px, 5vw, 40px);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--indigo), var(--gold));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
}

.auth-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--indigo-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--indigo-light);
  font-weight: 500;
}

.auth-footer a:hover { color: var(--indigo); }

/* Social login placeholders */
.social-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.btn-social {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.btn-social .soon-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--indigo);
  color: white;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ──────────────────────────────────────────────
   ONBOARDING
────────────────────────────────────────────── */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.onboarding-card {
  width: 100%;
  max-width: 560px;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 44px);
}

/* Progress steps */
.steps-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: all var(--transition-slow);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-circle.active {
  border-color: var(--indigo);
  background: rgba(108, 99, 255, 0.15);
  color: var(--indigo-light);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
}

.step-circle.done {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-label.active  { color: var(--indigo-light); }
.step-label.done    { color: var(--emerald); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 8px;
  transition: background var(--transition-slow);
}
.step-connector.done { background: var(--emerald); }

.onboarding-heading {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.onboarding-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Exam radio cards */
.exam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.exam-card {
  position: relative;
  cursor: pointer;
}

.exam-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.exam-card-inner {
  padding: 16px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  transition: all var(--transition-base);
  text-align: center;
}

.exam-card input[type="radio"]:checked + .exam-card-inner {
  border-color: var(--indigo);
  background: rgba(108, 99, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.exam-card-inner:hover {
  border-color: rgba(108, 99, 255, 0.4);
  background: rgba(108, 99, 255, 0.06);
}

.exam-card-icon { font-size: 24px; margin-bottom: 6px; }
.exam-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.exam-card-desc { font-size: 11px; color: var(--text-muted); }

/* Prep level cards */
.prep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.prep-card {
  position: relative;
  cursor: pointer;
}

.prep-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.prep-card-inner {
  padding: 20px 24px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 16px;
}

.prep-card input[type="radio"]:checked + .prep-card-inner {
  border-color: var(--indigo);
  background: rgba(108, 99, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.prep-card-inner:hover {
  border-color: rgba(108, 99, 255, 0.4);
  background: rgba(108, 99, 255, 0.06);
}

.prep-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.prep-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.prep-info p  { font-size: 12px; color: var(--text-muted); }

/* Subject chips */
.subjects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.subject-chip {
  position: relative;
  cursor: pointer;
}

.subject-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.subject-chip-inner {
  padding: 8px 16px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-chip input[type="checkbox"]:checked + .subject-chip-inner {
  border-color: var(--indigo);
  background: rgba(108, 99, 255, 0.15);
  color: var(--indigo-light);
}

.subject-chip-inner:hover {
  border-color: rgba(108, 99, 255, 0.4);
  background: rgba(108, 99, 255, 0.08);
  color: var(--text-primary);
}

/* Avatar upload */
.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base);
  cursor: pointer;
}

.avatar-upload-area:hover { border-color: var(--indigo); }

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.avatar-upload-text p  { font-size: 12px; color: var(--text-muted); }

input[type="file"].avatar-upload { display: none; }

/* Onboarding nav */
.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────────────────────────────────────
   DASHBOARD
────────────────────────────────────────────── */
.dashboard-page {
  padding: 32px 0 60px;
}

/* Greeting section */
.greeting-section {
  margin-bottom: 36px;
}

.greeting-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--indigo-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.greeting-date {
  font-size: 14px;
  color: var(--text-muted);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 24px 20px;
  border-top: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.stat-card.indigo { border-top-color: var(--indigo); }
.stat-card.gold   { border-top-color: var(--gold); }
.stat-card.emerald{ border-top-color: var(--emerald); }
.stat-card.purple { border-top-color: var(--purple); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  filter: blur(8px);
  opacity: 0.6;
}

.stat-card.indigo::before { background: var(--indigo); }
.stat-card.gold::before   { background: var(--gold); }
.stat-card.emerald::before{ background: var(--emerald); }
.stat-card.purple::before { background: var(--purple); }

.stat-icon {
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* XP Bar */
.xp-section {
  margin-bottom: 40px;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.xp-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.level-badge.indigo { background: rgba(108, 99, 255, 0.2); color: var(--indigo-light); border: 1px solid rgba(108, 99, 255, 0.3); }
.level-badge.emerald{ background: rgba(16, 185, 129, 0.2); color: var(--emerald-light); border: 1px solid rgba(16, 185, 129, 0.3); }
.level-badge.gold   { background: rgba(245, 158, 11, 0.2); color: var(--gold-light); border: 1px solid rgba(245, 158, 11, 0.3); }

.xp-numbers {
  font-size: 13px;
  color: var(--text-muted);
}

.xp-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--indigo), var(--gold));
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.section-title-icon.indigo { background: rgba(108, 99, 255, 0.2); }
.section-title-icon.gold   { background: rgba(245, 158, 11, 0.2); }
.section-title-icon.emerald{ background: rgba(16, 185, 129, 0.2); }

/* Game cards grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.game-card {
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: default;
}

.game-card:hover {
  transform: translateY(-2px);
}

.game-card.locked {
  cursor: not-allowed;
}

.game-card-bg-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(20px);
}
.game-card.indigo  .game-card-bg-glow { background: var(--indigo); }
.game-card.gold    .game-card-bg-glow { background: var(--gold); }
.game-card.emerald .game-card-bg-glow { background: var(--emerald); }
.game-card.purple  .game-card-bg-glow { background: var(--purple); }
.game-card.rose    .game-card-bg-glow { background: var(--rose); }
.game-card.amber   .game-card-bg-glow { background: var(--amber); }

.game-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(8, 12, 24, 0.65);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 2;
}

.game-card:hover .game-lock-overlay { opacity: 1; }

.game-lock-overlay svg {
  width: 24px; height: 24px;
  color: var(--text-muted);
}

.game-lock-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.game-icon-wrap {
  font-size: 32px;
  margin-bottom: 14px;
  filter: grayscale(0.3);
}

.game-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.game-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.game-coming-badge {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(108, 99, 255, 0.15);
  color: var(--indigo-light);
  border: 1px solid rgba(108, 99, 255, 0.25);
}

/* Dashboard two-column layout */
.dashboard-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-bottom: 40px;
}

/* Empty states */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 14px; line-height: 1.6; }

/* Streak widget */
.streak-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.streak-flame {
  font-size: 36px;
  animation: flameFlicker 2s ease-in-out infinite;
}

.streak-flame.hot { animation: flamePulse 1s ease-in-out infinite; }

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.05) rotate(3deg); }
}
@keyframes flamePulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px var(--gold)); }
  50%       { transform: scale(1.1); filter: drop-shadow(0 0 12px var(--gold)); }
}

.streak-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.streak-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Goals widget */
.goals-widget { padding: 24px; }
.goals-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.goals-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* User avatar in navbar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  border: 2px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar:hover { border-color: var(--indigo); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info { text-align: right; }
.user-name  { font-size: 14px; font-weight: 600; }
.user-plan  {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.user-plan.free { color: var(--text-muted); }

/* ──────────────────────────────────────────────
   MOBILE NAVBAR
────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.hamburger:hover { background: var(--bg-card-hover); }
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 85vw);
  height: 100%;
  background: #0D1426;
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 8px;
  overflow-y: auto;
}

.mobile-nav.open { display: block; }
.mobile-nav.open .mobile-nav-backdrop { opacity: 1; }
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-close {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.mobile-nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.mobile-nav-link .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.mobile-nav-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Tablet  ≤ 1024px
────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Small tablet / large phone  ≤ 900px
────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row      { grid-template-columns: repeat(2, 1fr); }
  .dashboard-body { grid-template-columns: 1fr; }
  .exam-grid      { grid-template-columns: 1fr 1fr; }

  /* Show hamburger, hide desktop nav actions */
  .hamburger    { display: flex; }
  .nav-actions  { display: none; }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Mobile  ≤ 640px
────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Safe edge padding on container */
  .container { padding: 0 16px; }

  /* Auth pages — card must breathe */
  .auth-page,
  .onboarding-page {
    padding: 20px 12px;
    align-items: flex-start;
    padding-top: 32px;
  }
  .auth-card,
  .onboarding-card {
    padding: 28px 20px;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  .auth-heading  { font-size: 22px; }
  .auth-subheading { font-size: 13px; }

  /* Social buttons stack on very small screens */
  .social-btns { flex-direction: column; gap: 8px; }

  /* Dashboard */
  .dashboard-page { padding: 20px 0 48px; }
  .greeting-text  { font-size: 20px; }
  .greeting-date  { font-size: 12px; }

  /* Stats — 2 column compact */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card     { padding: 16px 14px; }
  .stat-value    { font-size: 22px; }
  .stat-icon     { font-size: 18px; margin-bottom: 8px; }

  /* XP section */
  .xp-section    { padding: 18px 16px !important; }
  .xp-header     { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Games — single column */
  .games-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Onboarding */
  .onboarding-heading { font-size: 20px; }
  .onboarding-sub     { font-size: 13px; }
  .exam-grid          { grid-template-columns: 1fr 1fr; gap: 8px; }
  .exam-card-inner    { padding: 12px 8px; }
  .exam-card-icon     { font-size: 20px; }
  .exam-card-name     { font-size: 12px; }
  .exam-card-desc     { font-size: 10px; }
  .prep-card-inner    { padding: 14px 16px; gap: 12px; }
  .prep-icon          { font-size: 22px; }
  .onboarding-nav     { flex-direction: column-reverse; gap: 10px; }
  .onboarding-nav .btn { width: 100%; justify-content: center; }

  /* Step indicator — hide text labels */
  .step-label    { display: none; }
  .steps-indicator { margin-bottom: 28px; }

  /* Streak widget compact */
  .streak-widget { padding: 14px 16px; }
  .streak-count  { font-size: 28px; }
  .streak-flame  { font-size: 28px; }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Small phone  ≤ 400px
────────────────────────────────────────────── */
@media (max-width: 400px) {
  .auth-card,
  .onboarding-card { padding: 24px 16px; }

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

  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }

  .section-title { font-size: 15px; }

  .games-grid { gap: 10px; }
  .game-card  { padding: 20px 16px; }

  .logo-tagline { display: none; }
}

/* ──────────────────────────────────────────────
   UTILITIES
────────────────────────────────────────────── */
.text-indigo  { color: var(--indigo-light); }
.text-gold    { color: var(--gold); }
.text-emerald { color: var(--emerald); }
.text-muted   { color: var(--text-muted); }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
