/* ══════════════════════════════════════════════════════════════
   ONLINE QUIZ PORTAL — Design System v2
   ══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --c-primary:      #6366f1;
  --c-primary-d:    #4f46e5;
  --c-primary-l:    rgba(99,102,241,.18);
  --c-accent:       #f59e0b;
  --c-accent-d:     #d97706;
  --c-success:      #10b981;
  --c-danger:       #ef4444;
  --c-bg:           #07070f;
  --c-surface:      rgba(255,255,255,.04);
  --c-border:       rgba(255,255,255,.09);
  --c-text:         #e2e8f0;
  --c-muted:        rgba(255,255,255,.45);

  --r:              14px;
  --r-sm:           9px;
  --r-xl:           22px;

  --sh-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --sh:     0 4px 24px rgba(0,0,0,.09);
  --sh-lg:  0 12px 48px rgba(0,0,0,.14);
  --sh-glow:0 0 0 3px rgba(99,102,241,.22);

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

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

html { scroll-behavior: smooth; }

body {
  /* Latin → Gujarati → Hindi/Devanagari → system fallbacks */
  font-family: 'Inter', 'Noto Sans Gujarati', 'Noto Sans Devanagari',
               -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Nirmala UI', 'Shruti', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* ══════════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.site-navbar {
  background: rgba(9, 9, 18, .95);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: .85rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow .3s;
}
.site-navbar.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.35); }

.site-navbar .navbar-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
  gap: .4rem;
  display: flex;
  align-items: center;
}
.site-navbar .brand-icon {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.4rem;
}

.site-navbar .nav-link {
  color: rgba(255,255,255,.6) !important;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .5rem 1rem !important;
  border-radius: var(--r-sm);
  transition: color .18s, background .18s;
  position: relative;
  white-space: nowrap;
}
.site-navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%; right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 1px;
  transition: left .22s var(--ease-out), right .22s var(--ease-out);
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.07);
}
.site-navbar .nav-link.active::after { left: 12px; right: 12px; }

.btn-nav-login {
  display: inline-flex; align-items: center;
  background: transparent;
  color: rgba(255,255,255,.8) !important;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: .46rem 1.15rem;
  font-size: .855rem; font-weight: 500;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}
.btn-nav-login:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.35);
  color: #fff !important;
}

.btn-nav-register {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: .46rem 1.25rem;
  font-size: .855rem; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(99,102,241,.45);
  transition: box-shadow .18s, transform .18s, background .18s;
}
.btn-nav-register:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 20px rgba(99,102,241,.6);
  transform: translateY(-1px);
}

/* Navbar dropdown */
.site-navbar .dropdown-menu {
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  padding: .5rem;
  min-width: 210px;
}
.site-navbar .dropdown-item {
  color: rgba(255,255,255,.72);
  border-radius: var(--r-sm);
  padding: .55rem .8rem;
  font-size: .875rem;
  transition: background .15s, color .15s;
}
.site-navbar .dropdown-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.site-navbar .dropdown-divider { border-color: rgba(255,255,255,.08); }
.site-navbar .dropdown-item.text-danger { color: #fca5a5 !important; }
.site-navbar .dropdown-item.text-danger:hover { background: rgba(239,68,68,.12); }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS — keyframes
   ══════════════════════════════════════════════════════════════ */
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-18px) rotate(2deg); }
  66%       { transform: translateY(-8px) rotate(-1.5deg); }
}
@keyframes floatY2 {
  0%, 100% { transform: translateY(-8px) rotate(-2deg); }
  50%       { transform: translateY(12px) rotate(1.5deg); }
}
@keyframes floatY3 {
  0%, 100% { transform: translateY(0) rotate(1deg); }
  40%       { transform: translateY(-22px) rotate(-2deg); }
}
@keyframes blobMorph {
  0%, 100% { border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%; }
  25%       { border-radius: 40% 60% 50% 50% / 60% 40% 60% 40%; }
  50%       { border-radius: 70% 30% 40% 60% / 40% 50% 60% 50%; }
  75%       { border-radius: 50% 50% 60% 40% / 70% 30% 70% 30%; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.3); }
  50%       { box-shadow: 0 0 0 14px rgba(99,102,241,.0); }
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes orbitSpin {
  from { transform: rotate(0deg) translateX(55px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(55px) rotate(-360deg); }
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes sparkle {
  0%   { opacity: 0; transform: scale(0) rotate(0); }
  50%  { opacity: 1; transform: scale(1) rotate(180deg); }
  100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

/* ── Scroll-reveal base state ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease-out), transform .65s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(.92);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-spring);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* Staggered children */
.stagger-children > * { opacity: 0; transform: translateY(22px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-spring); }
.stagger-children.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay:.05s; }
.stagger-children.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay:.12s; }
.stagger-children.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay:.19s; }
.stagger-children.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay:.26s; }
.stagger-children.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay:.33s; }
.stagger-children.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay:.40s; }

/* ══════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════
   HERO — full-width centred, word-by-word animation
   ══════════════════════════════════════════════════════════════ */
.hero {
  background: #07080f;
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Animated mesh gradient */
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 20% 40%, rgba(99,102,241,.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(245,158,11,.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 90%, rgba(16,185,129,.1) 0%, transparent 55%);
  animation: gradShift 12s ease-in-out infinite;
  background-size: 300% 300%;
}

/* Blob orbs */
.hero-blob { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.hero-blob-1 { width: 500px; height: 500px; background: rgba(99,102,241,.16); top: -120px; left: -120px; animation: blobMorph 14s ease-in-out infinite; }
.hero-blob-2 { width: 380px; height: 380px; background: rgba(245,158,11,.11); bottom: -80px; right: 5%; animation: blobMorph 10s ease-in-out infinite reverse; }
.hero-blob-3 { width: 260px; height: 260px; background: rgba(16,185,129,.09); top: 35%; left: 50%; animation: blobMorph 16s ease-in-out infinite 4s; }

/* Dot grid */
.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 30%, transparent 100%);
}

/* Content wrapper */
.hero-content  { position: relative; z-index: 2; width: 100%; }
.hero-center   { max-width: 860px; margin: 0 auto; padding: 3.5rem 0; }

/* Eyebrow badge */
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 999px; padding: .35rem 1rem;
  font-size: .78rem; font-weight: 600; color: #a5b4fc;
  letter-spacing: .06em; text-transform: uppercase;
}

/* ── Word-by-word headline animation ─────────────────────────── */
.hero-title-center {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.08;
  color: #fff;
  letter-spacing: -.04em;
  margin: 0;
}

/* Each word is a clip container */
.hw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: .18em;
}
.hw > span, .hw {
  animation: wordUp .65s cubic-bezier(.22,1,.36,1) var(--d, 0ms) both;
}

/* Colour variants */
.hw-accent1 { background: linear-gradient(135deg,#f59e0b,#fbbf24); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.hw-accent2 { background: linear-gradient(135deg,#6366f1,#a5b4fc); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.hw-accent3 { background: linear-gradient(135deg,#10b981,#34d399); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.hw-white   { color: rgba(255,255,255,.9); }

/* Keyframe: slide up from below + fade in */
@keyframes wordUp {
  from { opacity: 0; transform: translateY(60%) skewX(-4deg); }
  to   { opacity: 1; transform: translateY(0)   skewX(0deg); }
}

/* Generic delayed-fade items (eyebrow, sub, buttons, stats) */
.hero-anim-item {
  animation: wordUp .7s cubic-bezier(.22,1,.36,1) var(--d, 0ms) both;
}

/* Sub */
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.52);
  line-height: 1.75;
}

/* Stats */
.hero-stats {
  display: flex; gap: 2.5rem; margin-top: 2.5rem;
}
.hero-stat-value { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-label { font-size: .75rem; color: rgba(255,255,255,.4); font-weight: 500; margin-top: .25rem; }

/* Scroll chevron */
.hero-scroll-hint {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 3rem; opacity: .35;
}
.hero-scroll-hint span {
  display: block; width: 16px; height: 16px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  animation: scrollBounce 1.6s ease-in-out infinite;
}
.hero-scroll-hint span:nth-child(2) { animation-delay: .15s; }
.hero-scroll-hint span:nth-child(3) { animation-delay: .3s; }
@keyframes scrollBounce {
  0%,100% { opacity: .2; transform: rotate(45deg) translate(0,0); }
  50%      { opacity: 1;  transform: rotate(45deg) translate(4px,4px); }
}

/* ══════════════════════════════════════════════════════════════
   CARDS — Base
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-sm) !important;
  transition: box-shadow .28s var(--ease-out), transform .28s var(--ease-out);
  overflow: hidden;
  will-change: transform;
}
.card:hover {
  box-shadow: var(--sh) !important;
  transform: translateY(-3px);
}

/* Gradient border on hover */
.card-gradient-border {
  position: relative;
  isolation: isolate;
}
.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--r) + 1px);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  opacity: 0;
  transition: opacity .3s;
  z-index: -1;
}
.card-gradient-border:hover::before { opacity: 1; }

/* Shine sweep on hover */
.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::after {
  content: '';
  position: absolute;
  top: -50%; left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-20deg);
  transition: left .55s var(--ease-out);
}
.card-shine:hover::after { left: 140%; }

/* Category card */
.cat-card {
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text);
}
.cat-card:hover { color: var(--c-text); }
.cat-card .cat-thumb {
  height: 150px;
  overflow: hidden;
  position: relative;
}
.cat-card .cat-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease-out);
}
.cat-card:hover .cat-thumb img { transform: scale(1.08); }

.cat-card .cat-icon-wrap {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99,102,241,.1);
  transition: background .3s;
}
.cat-card:hover .cat-icon-wrap {
  background: rgba(99,102,241,.18);
}
.cat-card .cat-icon-wrap i { font-size: 2.8rem; color: var(--c-primary); opacity: .7; }

/* Level card */
.level-card {
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text);
  border-radius: var(--r) !important;
  overflow: hidden;
  position: relative;
}
.level-card .level-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  position: absolute;
  top: 0; left: 0; right: 0;
}

/* Quiz card */
.quiz-card {
  position: relative;
}
.quiz-card .quiz-badge-row {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem;
}
.quiz-card .quiz-meta-badge {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: .2rem .6rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--c-muted);
  display: inline-flex; align-items: center; gap: .3rem;
}

/* Stat card */
.stat-card {
  border-radius: var(--r) !important;
  border: none !important;
  box-shadow: var(--sh-sm) !important;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.04), transparent);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--sh) !important; }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* Feature card (homepage) */
.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--r-xl) !important;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: none !important;
  backdrop-filter: blur(10px);
  transition: transform .3s var(--ease-spring), box-shadow .3s, border-color .3s;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(99,102,241,.2) !important;
  border-color: rgba(99,102,241,.3) !important;
}
.feature-card h5 { color: #e2e8f0; }
.feature-card .feature-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.8rem;
}

/* ══════════════════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════════════════ */
.section-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: .6rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--c-text);
  line-height: 1.15;
}
.section-sub { color: var(--c-muted); font-size: 1rem; max-width: 520px; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: .875rem;
  transition: all .2s var(--ease-out);
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-d));
  border: none;
  box-shadow: 0 2px 10px rgba(99,102,241,.35);
  color: #fff;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,.5);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,.25);
  transform: skewX(-20deg);
  transition: left .4s;
}
.btn-glow:hover::after { left: 120%; }

.btn-outline-primary {
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-control, .form-select {
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  padding: .65rem .95rem;
  font-size: .9rem;
  background: rgba(255,255,255,.07);
  color: #e2e8f0;
  transition: border-color .2s, box-shadow .2s;
}
.form-control::placeholder { color: rgba(255,255,255,.3); }
.form-control:focus, .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.22);
  outline: none;
  background: rgba(255,255,255,.1);
  color: #fff;
}
.form-select option { background: #1e1b4b; color: #e2e8f0; }
.form-label { font-size: .85rem; font-weight: 600; color: rgba(255,255,255,.7); }
.invalid-feedback { color: #fca5a5 !important; }
.form-control.is-invalid, .form-select.is-invalid { border-color: rgba(239,68,68,.6) !important; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: calc(100vh - 62px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(155deg,#06060f 0%,#0d0d2b 50%,#130825 100%);
  position: relative; overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  border-radius: 20px !important;
  border: 1px solid rgba(99,102,241,.15) !important;
  box-shadow: var(--sh-lg) !important;
  overflow: hidden;
  animation: scaleIn .45s var(--ease-spring) both;
}

.auth-header {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--c-primary-d) 50%, var(--c-primary) 100%);
  padding: 2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-header::before {
  content: '';
  position: absolute;
  top: -40%; left: -20%;
  width: 80%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-header h1 { font-size: 1.45rem; font-weight: 800; margin: 0; position: relative; z-index:1; }
.auth-header p  { margin: .5rem 0 0; opacity: .75; font-size: .875rem; position: relative; z-index:1; }
.auth-header .auth-icon { font-size: 2.2rem; margin-bottom: .5rem; display: block; opacity: .9; position: relative; z-index:1; }

.auth-card .card-body { padding: 2rem; background: transparent !important; }
.auth-card .text-muted { color: rgba(255,255,255,.45) !important; }
.auth-card a:not(.btn) { color: #a5b4fc; }
.auth-card a:not(.btn):hover { color: #c7d2fe; }
.auth-card .btn-outline-secondary {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.6);
}
.auth-card .btn-outline-secondary:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }

/* ══════════════════════════════════════════════════════════════
   DARK THEME — Bootstrap overrides
   ══════════════════════════════════════════════════════════════ */
.bg-white   { background: rgba(255,255,255,.04) !important; }
.bg-light   { background: rgba(255,255,255,.03) !important; }
.text-dark  { color: #e2e8f0 !important; }
.text-muted { color: rgba(255,255,255,.45) !important; }

/* Cards */
.card {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.09) !important;
  color: var(--c-text);
}
.card-header {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.08) !important;
  color: var(--c-text);
}
.card-footer {
  background: rgba(255,255,255,.03) !important;
  border-color: rgba(255,255,255,.07) !important;
}

/* Tables */
.table { color: var(--c-text); border-color: rgba(255,255,255,.07); }
.table thead th, .table-light th, .table-light td { background: rgba(255,255,255,.06) !important; color: rgba(255,255,255,.6) !important; border-color: rgba(255,255,255,.07) !important; }
.table tbody tr { border-color: rgba(255,255,255,.06); }
.table-hover tbody tr:hover { background: rgba(99,102,241,.07) !important; }
.table td, .table th { border-color: rgba(255,255,255,.06) !important; }
.badge.bg-secondary { background: rgba(255,255,255,.15) !important; color: rgba(255,255,255,.8) !important; }
.badge.bg-success   { background: rgba(16,185,129,.25) !important; color: #6ee7b7 !important; }
.badge.bg-danger    { background: rgba(239,68,68,.25)  !important; color: #fca5a5 !important; }
.badge.bg-primary   { background: rgba(99,102,241,.35) !important; color: #c7d2fe !important; }

/* Accordion */
.accordion-item { background: rgba(255,255,255,.03) !important; border-color: rgba(255,255,255,.09) !important; }
.accordion-button {
  background: rgba(255,255,255,.04) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
  background: rgba(99,102,241,.15) !important;
  color: #c7d2fe !important;
}
.accordion-button::after { filter: invert(1) brightness(.7); }
.accordion-body { background: rgba(255,255,255,.02) !important; color: rgba(255,255,255,.55) !important; }

/* Dropdowns */
.dropdown-menu { background: #0f172a !important; border-color: rgba(255,255,255,.1) !important; }
.dropdown-item { color: rgba(255,255,255,.75) !important; }
.dropdown-item:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }

/* Breadcrumb */
.breadcrumb-item.active { color: rgba(255,255,255,.45) !important; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.25) !important; }

/* Input group */
.input-group-text {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.6) !important;
}

/* Pagination */
.page-link { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.65); }
.page-link:hover { background: rgba(99,102,241,.2); color: #fff; border-color: rgba(99,102,241,.4); }
.page-item.active .page-link { background: var(--c-primary); border-color: var(--c-primary); }

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: #07080f;
  color: rgba(255,255,255,.55);
  padding: 4rem 0 1.5rem;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.5), rgba(245,158,11,.4), transparent);
}
.site-footer .footer-brand {
  font-size: 1.15rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem;
}
.site-footer .footer-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
}
.site-footer h6 {
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.site-footer a {
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-size: .875rem;
  display: block; margin-bottom: .5rem;
  transition: color .18s, transform .18s;
}
.site-footer a:hover { color: #fff; transform: translateX(3px); }
.site-footer hr { border-color: rgba(255,255,255,.06); margin: 2rem 0 1.5rem; }
.site-footer .bottom-bar { font-size: .78rem; color: rgba(255,255,255,.25); }

/* ══════════════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════════════ */
.badge { border-radius: 6px; font-weight: 600; }

.text-gradient {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.alert {
  border: none; border-radius: var(--r-sm);
  font-size: .875rem; padding: .85rem 1rem;
}
.alert-success { background: rgba(16,185,129,.12) !important; border-color: rgba(16,185,129,.3) !important; color: #6ee7b7 !important; }
.alert-danger  { background: rgba(239,68,68,.12)  !important; border-color: rgba(239,68,68,.3)  !important; color: #fca5a5 !important; }
.alert-warning { background: rgba(245,158,11,.12) !important; border-color: rgba(245,158,11,.3) !important; color: #fcd34d !important; }
.alert-info    { background: rgba(59,130,246,.12) !important; border-color: rgba(59,130,246,.3) !important; color: #93c5fd !important; }

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before { color: var(--c-muted); }
.breadcrumb-item.active { color: var(--c-muted); }

/* Pagination */
.page-link { border-radius: var(--r-sm) !important; border-color: #e2e8f0; color: var(--c-primary); margin: 0 2px; }
.page-item.active .page-link { background: var(--c-primary); border-color: var(--c-primary); }

/* Table */
.table thead th {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; border-bottom-width: 1px;
}

/* Tilt wrapper (applied by JS) */
.tilt-card { transform-style: preserve-3d; }

/* Animated counter */
.counter { display: inline-block; animation: countUp .6s var(--ease-spring) both; }

@media (max-width: 768px) {
  .hero { min-height: auto; padding: 4rem 0; }
  .hero-float-zone { display: none; }
  .hero-title { font-size: 2rem; }
  .hero-stats { gap: 1.2rem; }
}

/* ══════════════════════════════════════════════════════════════
   ACCESSIBILITY — WCAG 2.1 AA
   ══════════════════════════════════════════════════════════════ */

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

/* Skip to main content link */
.skip-link:focus {
  top: 0 !important;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Visible focus ring on all interactive elements — WCAG 2.4.7 */
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove focus ring for mouse users only */
:focus:not(:focus-visible) { outline: none; }

/* High-contrast focus for dark backgrounds */
.site-navbar :focus-visible,
.site-footer :focus-visible {
  outline-color: #fff;
}

/* Ensure buttons have minimum touch target — WCAG 2.5.5 */
.btn { min-height: 38px; }

/* Reduce motion for users who prefer it — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-blob, .float-card, .hero-orbit-dot { animation: none !important; }
}

/* Ensure sufficient color contrast for muted text — WCAG 1.4.3 */
.text-muted { color: #475569 !important; }  /* 4.6:1 on white */

/* Error state — color alone is not used, always paired with icon/text */
.is-invalid { border-left: 3px solid var(--c-danger); }
.invalid-feedback { display: flex; align-items: center; gap: .3rem; }
.invalid-feedback::before { content: '⚠'; font-size: .9em; }

/* Ensure images have visible alt boundary if they fail to load */
img { max-width: 100%; }
img[alt]:not([alt=""]) { min-width: 20px; min-height: 20px; }

/* Link underline on hover for non-nav links — WCAG 1.4.1 */
p a, .prose a, .text-muted a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Table accessibility */
table caption { caption-side: top; font-weight: 600; text-align: left; padding: .5rem 0; }

/* Form required indicator accessibility */
.form-label .req { color: var(--c-danger); margin-left: .2rem; }

/* ══════════════════════════════════════════════════════════════
   MULTI-LANGUAGE — Unicode / Indic Scripts
   Gujarati (gu), Hindi/Devanagari (hi), and Latin all use the
   same font stack; the browser picks the right glyph per character.
   ══════════════════════════════════════════════════════════════ */

/* Any element marked with a lang attribute gets the right script font */
[lang="gu"], .lang-gu {
  font-family: 'Noto Sans Gujarati', 'Shruti', 'Rekha', sans-serif;
  line-height: 1.8;   /* Gujarati needs more line-height for matras */
  letter-spacing: 0;  /* Gujarati connects glyphs — no letter spacing */
}

[lang="hi"], .lang-hi {
  font-family: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', sans-serif;
  line-height: 1.8;
  letter-spacing: 0;
}

/* Question text and answer options — ensure script renders cleanly */
.question-text, .option-text, .quiz-content {
  font-family: 'Inter', 'Noto Sans Gujarati', 'Noto Sans Devanagari',
               'Nirmala UI', 'Shruti', sans-serif;
  line-height: 1.75;
  word-break: break-word;   /* prevents overflow for long Indic words */
  overflow-wrap: break-word;
}

/* Input/textarea — allow any Unicode input including Gujarati/Hindi */
input, textarea, select {
  font-family: inherit;  /* inherits the full multi-script stack */
}

/* ══════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE
   Base = mobile (< 576px). Build up from there.
   ══════════════════════════════════════════════════════════════ */

/* ── Mobile base (all screens) ─────────────────────────────── */
.container { padding-left: 1rem; padding-right: 1rem; }

/* Stack columns on mobile */
.hero-content .row { gap: 2rem; }

/* Auth cards full-width on small screens */
.auth-wrapper { padding: 1rem .75rem; }
.auth-card { border-radius: 14px !important; }

/* Tables scroll horizontally instead of overflowing */
.table-responsive-always { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card .table-responsive, .card table { min-width: 480px; }

/* Touch-friendly quiz option buttons */
.quiz-option-btn {
  min-height: 52px;
  padding: .75rem 1rem;
  touch-action: manipulation;
}

/* Prevent text selection during quiz swipe */
.quiz-content { -webkit-user-select: none; user-select: none; }
.quiz-content .question-text { -webkit-user-select: text; user-select: text; }

/* Bottom navigation pill for quiz on mobile */
.quiz-nav-mobile {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--c-border);
  padding: .75rem 1rem;
  z-index: 100;
  display: none;
}

/* Sticky timer bar on mobile quiz */
.quiz-timer-bar {
  position: sticky;
  top: 62px;
  z-index: 50;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: .5rem 1rem;
}

/* ── Small (≥ 576px) ────────────────────────────────────────── */
@media (min-width: 576px) {
  .auth-card { border-radius: 18px !important; }
  .quiz-nav-mobile { display: none; }
}

/* ── Medium (≥ 768px) ───────────────────────────────────────── */
@media (min-width: 768px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
  .quiz-nav-mobile { display: none !important; }
}

/* ── Large (≥ 992px) ────────────────────────────────────────── */
@media (min-width: 992px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

/* ── Max 575px (phones only) ────────────────────────────────── */
@media (max-width: 575px) {
  /* Hero */
  .hero { padding: 3rem 0; }
  .hero-title { font-size: 1.75rem; letter-spacing: -.02em; }
  .hero-sub { font-size: .95rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { justify-content: space-between; }
  .hero-float-zone { display: none !important; }

  /* Auth */
  .auth-header { padding: 1.5rem 1rem; }
  .auth-card .card-body { padding: 1.25rem; }

  /* Cards */
  .feature-card { padding: 1.25rem 1rem; }
  .float-card { display: none; }

  /* Footer */
  .site-footer { padding: 2.5rem 0 1rem; }

  /* Nav */
  .site-navbar .navbar-collapse { padding: 1rem 0; }
  .btn-nav-login, .btn-nav-register {
    display: block; width: 100%; text-align: center; margin-top: .5rem;
  }

  /* Tables — show horizontal scroll hint */
  .card .table-responsive::after {
    content: '← Swipe to see more →';
    display: block;
    text-align: center;
    font-size: .72rem;
    color: var(--c-muted);
    padding: .4rem;
  }
  .card .table-responsive::-webkit-scrollbar { height: 3px; }

  /* Quiz mobile */
  .quiz-nav-mobile { display: flex !important; gap: .5rem; }

  /* Leaderboard podium — shrink on phones */
  .d-flex.align-items-end .float-card { min-width: 130px !important; }

  /* Settings tabs — scrollable */
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .nav-tabs .nav-link { white-space: nowrap; }

  /* Admin sidebar collapses */
  #adminSidebar { display: none !important; }
}

/* ── Max 768px ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { min-height: auto; padding: 3.5rem 0; }
  .hero-float-zone { display: none; }
  .hero-title { font-size: 2rem; }
  .hero-stats { gap: 1rem; }

  /* Section titles */
  .section-title { font-size: 1.5rem; }

  /* Cards grid */
  .stagger-children .col-xl-2 { flex: 0 0 50%; max-width: 50%; }

  /* Leaderboard podium stack on tablet */
  .hero-float-zone .d-flex { flex-wrap: wrap; justify-content: center; }

  /* Admin sidebar hidden on small tablets */
  #adminSidebar { width: 200px !important; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .site-navbar, .site-footer, .skip-link,
  #cookieBanner, .quiz-nav-mobile { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; }
}

