/* ============================================================
   SHORTHAND SATHI — Design System v3
   Aesthetic: Warm saffron-ink. Professional. Mobile-first.
   v3 adds: scroll animations, hero waveform, counters, haptics
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Devanagari+Hindi:ital@0;1&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  color-scheme: light;
  --saffron:       #FF6B00;
  --saffron-light: #FF8C3A;
  --saffron-dark:  #E05A00;
  --saffron-pale:  #FFF4EB;
  --saffron-pale2: #FFE8D4;
  --ink:           #1A1209;
  --ink-soft:      #2D2416;
  --ink-muted:     #6B5E4A;
  --ink-faint:     #B8A898;
  --bg-page:       #FDFAF6;
  --bg-card:       #FFFFFF;
  --bg-elevated:   #FFF9F4;
  --bg-input:      #F7F4EF;
  --green:         #2D7A4F;
  --green-light:   #E8F5EE;
  --red:           #C0392B;
  --red-light:     #FDECEA;
  --amber:         #D4860A;
  --amber-light:   #FEF3DC;
  --blue:          #1A5C8A;
  --blue-light:    #E8F2FB;
  --purple:        #6B3FA0;
  --purple-light:  #F0E8FA;
  --font-body:     'Plus Jakarta Sans', sans-serif;
  --font-hindi:    'Tiro Devanagari Hindi', serif;
  --font-mono:     'JetBrains Mono', monospace;
  --radius-xs:     6px;
  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --shadow-xs:     0 1px 2px rgba(26,18,9,0.06);
  --shadow-sm:     0 1px 4px rgba(26,18,9,0.08), 0 1px 2px rgba(26,18,9,0.05);
  --shadow-md:     0 4px 16px rgba(26,18,9,0.10), 0 2px 4px rgba(26,18,9,0.06);
  --shadow-lg:     0 12px 40px rgba(26,18,9,0.12), 0 4px 8px rgba(26,18,9,0.06);
  --shadow-xl:     0 24px 64px rgba(26,18,9,0.14), 0 8px 16px rgba(26,18,9,0.08);
  --shadow-saffron: 0 4px 20px rgba(255,107,0,0.30);
  --shadow-saffron-lg: 0 8px 32px rgba(255,107,0,0.40);
  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  --navbar-h:      68px;
  --mobile-nav-h:  64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}
body.lang-hindi { font-family: var(--font-hindi); }
a { color: var(--saffron); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--saffron-light); }
img { max-width: 100%; display: block; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.display-xl { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.display-lg { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; }
.heading-xl { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; }
.heading-lg { font-size: 1.5rem; font-weight: 700; }
.heading-md { font-size: 1.2rem; font-weight: 600; }
.heading-sm { font-size: 1rem; font-weight: 600; }
.body-lg { font-size: 1.1rem; line-height: 1.7; }
.body-md { font-size: 1rem; line-height: 1.6; }
.body-sm { font-size: 0.875rem; line-height: 1.5; }
.caption { font-size: 0.75rem; color: var(--ink-muted); }
.mono { font-family: var(--font-mono); }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px; }
.container-xs { max-width: 480px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .gap-4 { gap: 32px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ── Speed-wise performance cards ───────────────────────────── */
.speed-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(26,18,9,0.08);
  border-radius: var(--radius-md);
  padding: 20px 16px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}
.wpm-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--saffron);
  line-height: 1;
}
.wpm-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.wpm-score {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.wpm-score.has-data { color: var(--ink); }
.wpm-score.no-data  { color: var(--ink-faint); }
.speed-card .progress-bar { width: 100%; margin-bottom: 6px; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md); border: 2px solid transparent;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  text-decoration: none; line-height: 1; position: relative; overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: white; opacity: 0; transition: opacity 0.15s;
}
.btn:active:not(:disabled)::after { opacity: 0.1; }

.btn-primary {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-dark) 100%);
  color: white; border-color: var(--saffron);
  box-shadow: var(--shadow-saffron);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--saffron-light) 0%, var(--saffron) 100%);
  transform: translateY(-2px); box-shadow: var(--shadow-saffron-lg); color: white;
}
.btn-secondary {
  background: transparent; color: var(--saffron); border-color: var(--saffron);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--saffron-pale); transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: var(--ink-muted); border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-input); color: var(--ink); }
.btn-danger { background: var(--red); color: white; border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #a93226; transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

.btn-loading { color: transparent !important; }
.btn-loading::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(26,18,9,0.06);
  padding: 24px;
}
.card-elevated {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  border: 1px solid rgba(255,107,0,0.1); padding: 24px;
}
.card-hover { transition: var(--transition-spring); cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-glass {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 0.875rem; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.form-label .required { color: var(--red); }
.form-input, .form-select, .form-textarea, select.form-input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(26,18,9,0.12); background: var(--bg-input);
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  transition: var(--transition); outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--saffron); background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.12);
}
.form-error { font-size: 0.8rem; color: var(--red); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.badge-saffron  { background: rgba(255,107,0,0.12); color: var(--saffron); }
.badge-green    { background: var(--green-light);   color: var(--green); }
.badge-red      { background: var(--red-light);     color: var(--red); }
.badge-amber    { background: var(--amber-light);   color: var(--amber); }
.badge-blue     { background: var(--blue-light);    color: var(--blue); }
.badge-gray     { background: var(--bg-input);      color: var(--ink-muted); }
.badge-purple   { background: var(--purple-light);  color: var(--purple); }

/* ============================================================
   DESKTOP NAVBAR
   ============================================================ */

/* Prevent layout shift while navbar.js loads */
#navbar-root:empty {
  height: var(--navbar-h);
  display: block;
}

.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(253,250,246,0.95); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26,18,9,0.07);
  height: var(--navbar-h);
  display: flex; align-items: center;
}
.navbar .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.navbar .container .navbar-brand { justify-self: start; }
.navbar .container #nav-links    { justify-self: center; }
.navbar .container #mobile-lang  { justify-self: end; }
.navbar-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.2rem; font-weight: 800; color: var(--ink); text-decoration: none;
}
.navbar-brand .logo-mark {
  width: 38px; height: 38px; background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 1rem;
  box-shadow: 0 2px 8px rgba(255,107,0,0.35);
}
.navbar-links {
  display: flex; align-items: center; gap: 4px;
}
.navbar-links a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 500; color: var(--ink-muted); font-size: 0.88rem;
  transition: var(--transition); white-space: nowrap;
}
.navbar-links a:hover { background: var(--bg-input); color: var(--ink); }
.navbar-links a.active {
  color: var(--saffron); font-weight: 600;
  background: var(--saffron-pale);
}

/* Language Toggle */
.lang-toggle {
  display: flex; align-items: center;
  background: var(--bg-input); border-radius: var(--radius-sm);
  padding: 3px; gap: 2px;
}
.lang-toggle button {
  padding: 5px 11px; border-radius: 7px; border: none;
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--ink-muted); transition: var(--transition);
  font-family: var(--font-body);
}
.lang-toggle button.active {
  background: var(--saffron); color: white;
  box-shadow: 0 1px 4px rgba(255,107,0,0.4);
}

/* ============================================================
   MOBILE NAVBAR
   ============================================================ */
.hamburger { display: none !important; }

@media (max-width: 768px) {
  .navbar-links {
    display: none !important;
  }
  #mobile-lang {
    display: flex !important;
    margin-left: auto;
  }
}

/* ============================================================
   PROGRESS / SCORE
   ============================================================ */
.progress-bar {
  width: 100%; height: 6px; background: var(--bg-input); border-radius: 100px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 100px; background: var(--saffron);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.green { background: var(--green); }
.progress-fill.red { background: var(--red); }

.score-circle {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 5px solid var(--bg-input);
  background: var(--bg-card); box-shadow: var(--shadow-lg);
  position: relative;
}
.score-circle::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  background: linear-gradient(135deg, transparent 40%, rgba(255,107,0,0.1));
  z-index: 0;
}
.score-circle .score-num { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; position: relative; }
.score-circle .score-label { font-size: 0.65rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; position: relative; }
.score-circle.pass { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-light), var(--shadow-md); }
.score-circle.fail { border-color: var(--red);   box-shadow: 0 0 0 4px var(--red-light),   var(--shadow-md); }

/* ============================================================
   TIMER
   ============================================================ */
.timer {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: white; padding: 12px 20px;
  border-radius: var(--radius-md); font-family: var(--font-mono);
  box-shadow: var(--shadow-md);
}
.timer .time-display { font-size: 2rem; font-weight: 500; letter-spacing: 0.06em; }
.timer.warning { background: var(--amber); }
.timer.danger  { background: var(--red); animation: pulse 0.9s ease infinite; }

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  padding: 14px 20px; border-radius: var(--radius-md);
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid transparent; animation: fadeIn 0.3s ease;
}
.alert-success { background: var(--green-light);  border-color: rgba(45,122,79,0.2);   color: var(--green); }
.alert-error   { background: var(--red-light);    border-color: rgba(192,57,43,0.2);   color: var(--red); }
.alert-warning { background: var(--amber-light);  border-color: rgba(212,134,10,0.2);  color: var(--amber); }
.alert-info    { background: var(--blue-light);   border-color: rgba(26,92,138,0.2);   color: var(--blue); }

.toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
@media (max-width: 768px) {
  .toast-container { left: 12px; right: 12px; top: auto; bottom: calc(var(--mobile-nav-h) + 12px); }
}
.toast {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: var(--shadow-lg); border-left: 4px solid var(--saffron);
  display: flex; align-items: center; gap: 12px;
  animation: slideUp 0.3s ease; font-size: 0.9rem; font-weight: 500;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,18,9,0.65); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fadeIn 0.2s ease;
}
@media (min-width: 769px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal {
  background: var(--bg-card); width: 100%; max-width: 560px;
  padding: 32px; animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
@media (min-width: 769px) {
  .modal { border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg-input); cursor: pointer;
  color: var(--ink-muted); transition: var(--transition); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex; gap: 4px; background: var(--bg-input);
  border-radius: var(--radius-sm); padding: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: 1; min-width: max-content; padding: 10px 16px; border-radius: 7px; border: none;
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); color: var(--ink-muted); background: transparent;
  white-space: nowrap;
}
.tab-btn.active { background: var(--bg-card); color: var(--saffron); box-shadow: var(--shadow-sm); }

/* ============================================================
   DICTATION PLAYER
   ============================================================ */
.player-card {
  background: linear-gradient(135deg, #1A1209 0%, #2D1F0E 100%);
  color: white; border-radius: var(--radius-xl);
  padding: 32px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.player-card::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,0,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.player-card::after {
  content: ''; position: absolute; bottom: -60px; left: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,0,0.1) 0%, transparent 70%);
  pointer-events: none;
}
@media (max-width: 768px) {
  .player-card { padding: 24px 20px; border-radius: var(--radius-lg); }
}

.speed-btn {
  padding: 12px 20px; border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06); color: white;
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: var(--transition);
  min-width: 72px; text-align: center;
}
.speed-btn:hover { border-color: var(--saffron); background: rgba(255,107,0,0.15); }
.speed-btn.selected {
  background: var(--saffron); border-color: var(--saffron);
  box-shadow: var(--shadow-saffron);
}
.speed-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.play-btn {
  width: 72px; height: 72px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
  color: white; font-size: 1.8rem;
  cursor: pointer; transition: var(--transition-spring);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-saffron-lg); flex-shrink: 0;
}
.play-btn:hover { transform: scale(1.08); }
.play-btn:active { transform: scale(0.96); }
.play-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Audio progress bar inside player */
.audio-progress-wrap {
  width: 100%; margin: 12px 0 4px;
}
.audio-progress-track {
  width: 100%; height: 4px; background: rgba(255,255,255,0.15);
  border-radius: 100px; overflow: hidden; cursor: pointer;
}
.audio-progress-fill {
  height: 100%; background: var(--saffron); border-radius: 100px;
  width: 0%; transition: width 0.5s linear;
}
.audio-time-label {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: rgba(255,255,255,0.45);
  font-family: var(--font-mono); margin-top: 4px;
}

.waveform {
  height: 56px; display: flex; align-items: center; gap: 3px;
  overflow: hidden;
}
.waveform-bar {
  width: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.2);
  animation: wave 1.4s ease-in-out infinite;
}
.waveform-bar:nth-child(odd)  { animation-delay: 0.2s; }
.waveform-bar:nth-child(3n)   { animation-delay: 0.4s; }
.waveform-bar:nth-child(4n)   { animation-delay: 0.6s; }
.waveform.playing .waveform-bar { background: var(--saffron); }

/* ============================================================
   TRANSCRIPTION AREA
   ============================================================ */
.transcription-area {
  width: 100%; min-height: 280px; padding: 20px;
  font-family: var(--font-hindi); font-size: 1.1rem; line-height: 2;
  border-radius: var(--radius-lg); border: 2px solid rgba(26,18,9,0.1);
  background: var(--bg-card); color: var(--ink);
  resize: vertical; outline: none; transition: var(--transition);
}
.transcription-area:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(255,107,0,0.08);
}
.transcription-area:disabled { background: var(--bg-input); opacity: 0.6; }
@media (max-width: 768px) {
  .transcription-area { min-height: 220px; font-size: 1rem; }
}

/* ============================================================
   RESULTS PAGE — WORD CHIPS
   ============================================================ */
.word-chip {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 6px;
  font-size: 0.88rem; cursor: default; transition: var(--transition);
  margin: 2px; position: relative;
}
.word-chip:hover { transform: scale(1.05); z-index: 2; }
/* Tooltip on hover */
.word-chip[title]:hover::after {
  content: attr(title);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: white; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; z-index: 100;
  box-shadow: var(--shadow-md);
}
.word-chip[title]:hover::before {
  content: '';
  position: absolute; bottom: calc(100% + 2px); left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--ink);
  pointer-events: none; z-index: 100;
}
.chip-correct        { background: #e8f5ee; color: #2D7A4F; }
.chip-spelling_error { background: #fef3dc; color: #B8860B; border-bottom: 2px solid #D4860A; }
.chip-omission       { background: #fdecea; color: #C0392B; text-decoration: line-through; opacity: 0.85; }
.chip-wrong_word     { background: #fdecea; color: #C0392B; border: 2px solid #C0392B; }
.chip-addition       { background: #e8f2fb; color: #1A5C8A; border: 2px solid #1A5C8A; }
.chip-repeat         { background: #fff0e0; color: #FF6B00; border: 2px dashed #FF6B00; }

.legend-wrap {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.82rem;
  padding: 12px 0;
}
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--ink-muted); }
.legend-dot {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid rgba(26,18,9,0.06); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
  transition: var(--transition-spring);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--ink-muted); font-weight: 500; }
.stat-change { font-size: 0.78rem; font-weight: 600; }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* Streak badge with flame animation */
.streak-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,107,0,0.15); color: var(--saffron);
  padding: 6px 14px; border-radius: 100px; font-size: 0.85rem; font-weight: 600;
}
.streak-flame {
  display: inline-block;
  animation: flameFlicker 0.6s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0%   { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

.attempt-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  border: 1px solid rgba(26,18,9,0.05);
  margin-bottom: 8px;
}
.attempt-row:hover { background: var(--saffron-pale); border-color: rgba(255,107,0,0.15); }
.attempt-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
}
.attempt-icon.pass { background: var(--green-light); color: var(--green); }
.attempt-icon.fail { background: var(--red-light);   color: var(--red); }

/* ============================================================
   PRICING
   ============================================================ */
.pricing-card {
  background: var(--bg-card); border-radius: var(--radius-xl);
  border: 2px solid rgba(26,18,9,0.08); padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
  transition: var(--transition-spring);
}
.pricing-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); }
.pricing-card.featured {
  background: var(--ink); color: white; border-color: var(--saffron);
  box-shadow: var(--shadow-saffron-lg);
}
.pricing-card.featured .text-muted { color: rgba(255,255,255,0.6); }
.price-amount { font-size: 3rem; font-weight: 800; line-height: 1; }
.price-period { font-size: 1rem; opacity: 0.7; }
.feature-list { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.feature-list li .check { color: var(--saffron); }

/* ============================================================
   LANDING PAGE — HERO (v3: rich background, animated waveform)
   ============================================================ */
.hero {
  padding: 80px 0 64px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 60% -10%, rgba(255,107,0,0.13) 0%, transparent 60%),
              radial-gradient(ellipse 80% 60% at 0% 100%, rgba(255,107,0,0.07) 0%, transparent 55%),
              var(--bg-page);
}

/* Large ambient saffron orb top-right */
.hero::before {
  content: ''; position: absolute; top: -140px; right: -160px;
  width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,0,0.12) 0%, rgba(255,107,0,0.04) 45%, transparent 70%);
  pointer-events: none; animation: heroOrb 8s ease-in-out infinite alternate;
}

/* Subtle bottom-left secondary orb */
.hero::after {
  content: ''; position: absolute; bottom: -80px; left: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,0,0.06) 0%, transparent 65%);
  pointer-events: none;
}

@keyframes heroOrb {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.8; }
  100% { transform: scale(1.06) translate(-20px, 20px); opacity: 1; }
}

/* Hero background waveform decoration */
.hero-waveform-bg {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 80px; display: flex; align-items: flex-end;
  gap: 2px; padding: 0 5%; pointer-events: none; overflow: hidden;
  opacity: 0.18;
}
.hero-waveform-bg span {
  flex: 1; border-radius: 2px 2px 0 0;
  background: var(--saffron);
  animation: heroBg 2.4s ease-in-out infinite;
  min-width: 2px;
}
.hero-waveform-bg span:nth-child(2n)   { animation-delay: -0.3s; }
.hero-waveform-bg span:nth-child(3n)   { animation-delay: -0.6s; }
.hero-waveform-bg span:nth-child(4n)   { animation-delay: -0.9s; }
.hero-waveform-bg span:nth-child(5n)   { animation-delay: -1.2s; }
.hero-waveform-bg span:nth-child(7n)   { animation-delay: -1.6s; }
.hero-waveform-bg span:nth-child(11n)  { animation-delay: -2.0s; }

@keyframes heroBg {
  0%, 100% { height: 12px; }
  50%       { height: var(--h, 40px); }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--saffron-pale); border: 1px solid rgba(255,107,0,0.25);
  color: var(--saffron); padding: 8px 16px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(255,107,0,0.15);
}

/* Social proof counter ticker */
.hero-social-proof {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--ink-muted); margin-top: 12px;
}
.hero-social-proof .count-num {
  font-weight: 800; color: var(--saffron); font-size: 0.95rem;
}

/* ============================================================
   EXAM SCHEME CARDS — coloured identity (v3)
   ============================================================ */
.scheme-identity-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 768px) {
  .scheme-identity-grid { grid-template-columns: repeat(2, 1fr); }
}

.scheme-identity-card {
  border-radius: var(--radius-lg); padding: 28px 20px;
  text-align: center; cursor: pointer;
  transition: var(--transition-spring);
  border: 2px solid transparent; position: relative; overflow: hidden;
}
.scheme-identity-card::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.15); pointer-events: none;
}
.scheme-identity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.scheme-identity-card .scheme-icon {
  font-size: 2.4rem; margin-bottom: 12px; display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.scheme-identity-card strong { font-size: 1.05rem; display: block; }
.scheme-identity-card .caption { font-size: 0.72rem; margin-top: 4px; opacity: 0.75; }

/* SSC — Blue */
.scheme-ssc { background: linear-gradient(135deg, #1A5C8A 0%, #134a70 100%); color: white; }
/* CRPF — Olive green */
.scheme-crpf { background: linear-gradient(135deg, #3B6B35 0%, #2d5229 100%); color: white; }
/* Railways — Railway Red */
.scheme-railways { background: linear-gradient(135deg, #C0392B 0%, #962d22 100%); color: white; }
/* Delhi Police — Deep navy */
.scheme-delhi { background: linear-gradient(135deg, #2C3E7A 0%, #1e2d5c 100%); color: white; }

/* ============================================================
   SCHEME SELECTOR (practice page)
   ============================================================ */
.scheme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
@media (max-width: 480px) {
  .scheme-grid { grid-template-columns: repeat(2, 1fr); }
}
.scheme-card {
  padding: 16px; border-radius: var(--radius-md);
  border: 2px solid rgba(26,18,9,0.08); cursor: pointer;
  transition: var(--transition-spring); text-align: center;
  background: var(--bg-card);
}
.scheme-card:hover { border-color: var(--saffron); background: var(--saffron-pale); transform: translateY(-2px); }
.scheme-card.selected { border-color: var(--saffron); background: var(--saffron-pale); box-shadow: 0 0 0 3px rgba(255,107,0,0.15); }
.scheme-card strong { font-size: 0.88rem; display: block; color: var(--ink); }
.scheme-card span   { font-size: 0.72rem; color: var(--ink-muted); }

/* ============================================================
   STEP INDICATOR
   ============================================================ */
.step-indicator {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 28px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.step-indicator::-webkit-scrollbar { display: none; }
.step { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink-faint); font-size: 0.82rem; font-weight: 600; }
.step.active { color: var(--saffron); }
.step.done   { color: var(--green); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center; font-size: 0.78rem; flex-shrink: 0;
}
.step.active .step-num { background: var(--saffron); border-color: var(--saffron); color: white; }
.step.done .step-num   { background: var(--green);   border-color: var(--green);   color: white; }
.step-sep { width: 24px; height: 2px; background: currentColor; flex-shrink: 0; opacity: 0.4; }

/* ============================================================
   GK QUIZ
   ============================================================ */
.gk-option {
  width: 100%; text-align: left; padding: 14px 18px;
  border-radius: var(--radius-md); border: 2px solid rgba(26,18,9,0.08);
  background: var(--bg-card); cursor: pointer; transition: var(--transition);
  font-size: 0.95rem; color: var(--ink);
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.gk-option:hover:not(:disabled) { border-color: var(--saffron); background: var(--saffron-pale); transform: translateX(4px); }
.gk-option.correct  { border-color: #2D7A4F; background: #e8f5ee; color: #2D7A4F; font-weight: 600; }
.gk-option.wrong    { border-color: #C0392B; background: #fdecea; color: #C0392B; }
.gk-option.revealed { border-color: #2D7A4F; background: #e8f5ee; color: #2D7A4F; }
.gk-option:disabled { cursor: default; }
.gk-label {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(26,18,9,0.07); display: flex; align-items: center;
  justify-content: center; font-size: 0.8rem; font-weight: 700;
}
.gk-option.correct .gk-label  { background: #2D7A4F; color: white; }
.gk-option.wrong .gk-label    { background: #C0392B; color: white; }
.gk-option.revealed .gk-label { background: #2D7A4F; color: white; }

/* ============================================================
   SCROLL REVEAL ANIMATIONS (v3)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1),
              transform 0.55s cubic-bezier(0.4,0,0.2,1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.18s; }
.reveal-delay-3 { transition-delay: 0.26s; }
.reveal-delay-4 { transition-delay: 0.34s; }

/* Count-up number animation */
.count-up-num { display: inline-block; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--ink-muted); }
.text-saffron { color: var(--saffron); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; }  .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; } .p-section { padding: 64px 0; }
.divider { border: none; border-top: 1px solid rgba(26,18,9,0.07); margin: 20px 0; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-elevated) 50%, var(--bg-input) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26,18,9,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,18,9,0.25); }

/* Touch improvements */
@media (max-width: 768px) {
  .btn { min-height: 44px; }
  .form-input, .form-select { min-height: 48px; font-size: 16px; }
  .card { padding: 16px; }
  .container { padding: 0 16px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.85; } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes wave    { 0%,100% { height: 6px; } 50% { height: 36px; } }
@keyframes pop     { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scoreReveal { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Score circle entrance */
.score-circle-animate {
  animation: scoreReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

audio { display: none !important; }
.protected-content { user-select: none; -webkit-user-select: none; }

/* Lang toggle — single element #mobile-lang, always visible in navbar */
#mobile-lang { display: flex; margin-left: 8px; }
/* Nothing to hide on mobile — it's always the only toggle */
@media (max-width: 768px) {
  #mobile-lang { display: flex; margin-left: auto; }
}
