:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #ec4899;
  --secondary-dark: #db2777;
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --success: #10b981;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #0f172a; }

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(45deg, #0f172a 0%, #1e1b4b 35%, #312e81 65%, #4f46e5 100%);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Animated Background Orbs */
body::before {
  content: "";
  position: fixed;
  top: -15%;
  left: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
  animation: floatOrb 20s infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  bottom: -15%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
  animation: floatOrb 25s infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 100px) scale(1.1); }
  100% { transform: translate(-50px, -50px) scale(1); }
}

/* Confetti dots */
.confetti {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
}

.confetti div {
  position: absolute;
  width: 10px; height: 10px;
  background: #fff;
  animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* HEADER */
header {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 4px solid #ff006e;
  color: #fff;
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

.logo { display: flex; align-items: center; gap: 1rem; }

.logo-mark {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
  color: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(255, 0, 110, 0.5);
  animation: logoSpin 4s linear infinite;
}

@keyframes logoSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.logo-text { display: flex; flex-direction: column; }

.logo-main { font-size: 2rem; font-weight: 900; letter-spacing: -0.5px; background: linear-gradient(to right, #fff 0%, var(--primary-light) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 0.8rem; opacity: 0.9; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #ffd700; }

#user-bar { display: flex; gap: 0.75rem; align-items: center; }

/* MAIN */
main { padding: 3rem 0; min-height: 100vh; }

/* CARDS */
.card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.8;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* HERO SECTION */
.auth-section { padding: 2rem 0 5rem 0; }

.hero {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(25px);
  border-radius: 32px;
  padding: 4rem 3rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(45deg);
  z-index: 0;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 0, 110, 0.2);
  color: #fff;
  padding: 0.8rem 1.75rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 0, 110, 0.3);
  box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.hero h1 {
  font-size: 4rem;
  font-weight: 950;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  letter-spacing: -1.5px;
}

.highlight {
  background: linear-gradient(to right, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3rem;
  line-height: 1.9;
  max-width: 600px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3.5rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 1.75rem;
  border-radius: 24px;
  backdrop-filter: blur(12px);
  text-align: center;
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 5px;
  background: linear-gradient(90deg, #ff006e, #3a86ff);
  opacity: 0.8;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-7px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 950;
  color: #fff;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.hero-visual { position: relative; z-index: 1; }

.exam-card-hero {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  backdrop-filter: blur(15px);
}

.card-header {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 1.25rem 2rem;
  font-weight: 800;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body { padding: 2rem; }

.question-preview {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #fff;
  font-size: 1.1rem;
}

.options-preview {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.option-label {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: var(--transition);
}

.option-label:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #8338ec;
  transform: translateY(-4px);
}

/* AUTH */
.auth-wrapper { max-width: 520px; margin: 0 auto 4rem auto; }

.auth-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(28px);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  padding: 3rem 2rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -50%;
  width: 300px; height: 300px;
  background: linear-gradient(45deg, #ff006e, #8338ec);
  border-radius: 50%;
  opacity: 0.15;
  z-index: 0;
}

.auth-card > * { position: relative; z-index: 1; }

.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-header h2 { font-size: 2.2rem; font-weight: 900; color: var(--primary-light); margin-bottom: 0.75rem; }
.auth-header p { color: var(--text-muted); font-size: 1rem; }

.auth-tabs { display: flex; gap: 0.25rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.tab {
  padding: 1rem 1.75rem;
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}
.tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); background: rgba(99, 102, 241, 0.08); }
.tab:hover { color: var(--primary-light); }

form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-size: 0.9rem; font-weight: 700; color: var(--text); }

input[type="text"], input[type="email"], input[type="password"], select.form-select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: var(--transition);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4); }
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5); filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-hover); color: var(--white); }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); transform: translateY(-4px); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5); }
.btn-dark { background: #1a1a1a; color: #fff; border: 2px solid #1a1a1a; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.btn-dark:hover { background: #000000; box-shadow: 0 6px 16px rgba(0,0,0,0.4); }
.flex-1 { flex: 1; }

.ai-badge { background: var(--accent); color: #fff; border-radius: 8px; padding: 0.5rem 1.2rem; font-size: 0.8rem; font-weight: 900; margin-left: 0.75rem; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(6, 182, 212, 0.5); }

.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 1rem; color: var(--text-muted); }
.auth-footer .link { color: var(--primary-light); cursor: pointer; font-weight: 700; text-decoration: underline; }
.auth-footer .link:hover { color: var(--primary); }

.auth-msg { margin-top: 1rem; padding: 1rem 1.25rem; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; display: none; animation: slideDown 0.3s ease; border: 1px solid transparent; }
@keyframes slideDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }
.auth-msg.error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); display: block; }
.auth-msg.success { background: rgba(16, 185, 129, 0.2); color: #86efac; border-color: rgba(16, 185, 129, 0.4); display: block; }

/* LEADERBOARD */
.leaderboard-section { margin-top: 2rem; }
.lb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.lb-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--primary-light); display: flex; align-items: center; gap: 0.5rem; }
.lb-list { display: flex; flex-direction: column; gap: 0.75rem; }
.leaderboard-entry {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: rgba(30, 41, 59, 0.4); border: 1px solid var(--border); border-radius: var(--radius);
  transition: var(--transition);
}
.leaderboard-entry:hover { transform: translateX(5px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.rank-badge { font-size: 0.9rem; font-weight: 900; padding: 0.7rem 1rem; border-radius: 14px; margin-right: 0.75rem; }
.rank-1 { background: #ffd700; color: #000; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5); }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.leader-info { flex: 1; }
.leader-info h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--text); }
.leader-info p { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.leader-score { text-align: right; }
.score-big { font-size: 1.5rem; font-weight: 900; color: var(--primary-light); display: block; }
.score-small { font-size: 0.8rem; color: var(--text-muted); }

/* DASHBOARD */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dash-header h2 { font-size: 1.75rem; font-weight: 900; color: var(--primary-light); }
.dash-header p { color: var(--text-muted); font-size: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }

.stat-card { text-align: center; padding: 2rem 1.5rem; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); transition: var(--transition); }
.stat-card:hover { transform: translateY(-5px); border-color: var(--border-hover); }
.stat-value { font-size: 3rem; font-weight: 950; color: var(--primary-light); display: block; margin-bottom: 0.5rem; text-shadow: 0 0 20px rgba(165, 180, 252, 0.4); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.exam-card { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; transition: var(--transition); backdrop-filter: blur(10px); position: relative; overflow: hidden; }
.exam-card::after {
  content: "";
  position: absolute;
  top: -50%; right: -50%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}
.exam-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #8338ec; }
.exam-card .board-badge { margin-bottom: 1.5rem; }
.exam-card h3 { font-size: 1.25rem; font-weight: 900; margin-bottom: 0.75rem; color: var(--text); line-height: 1.3; }
.exam-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1rem; }
.exam-card .fee { font-size: 1.25rem; font-weight: 900; color: #34d399; margin-bottom: 1rem; }
.exam-card .status-note { font-size: 0.85rem; font-weight: 800; margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 12px; display: inline-block; }
.status-unlocked { background: rgba(16, 185, 129, 0.2); color: #86efac; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-locked { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* EXAM RUNNER */
.exam-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 3px solid var(--primary); padding-bottom: 1.5rem; margin-bottom: 2rem;
  position: sticky; top: 0; background: rgba(15, 23, 42, 0.85); z-index: 10; padding-top: 1.5rem; backdrop-filter: blur(16px);
}
.exam-header div h2 { font-size: 1.5rem; font-weight: 950; color: var(--primary-light); margin-bottom: 0.5rem; }
.exam-header div p { font-size: 1rem; color: var(--text-muted); }
.badge { background: var(--danger); color: #fff; padding: 1rem 1.75rem; border-radius: 16px; font-weight: 950; font-size: 1.5rem; box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5); animation: pulseRed 2s infinite; }

@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

.question-block { border-bottom: 1px solid rgba(255,255,255,0.08); padding: 1.5rem 0; animation: fadeIn 0.3s ease; }
.question-block:last-child { border-bottom: none; }
.question-block p { font-weight: 700; margin-bottom: 1rem; font-size: 1.1rem; line-height: 1.7; color: #fff; }
.option-label { display: block; padding: 1rem 1.25rem; margin: 0.75rem 0; background: rgba(255,255,255,0.03); border: 2px solid var(--border); border-radius: 16px; cursor: pointer; transition: var(--transition); font-size: 1rem; position: relative; color: #fff; }
.option-label:hover { background: rgba(255,255,255,0.08); border-color: var(--primary-light); transform: translateX(8px); }
.option-label input { margin-right: 1rem; accent-color: var(--primary); width: 1.3rem; height: 1.3rem; }

/* RESULTS */
.result-header { margin-bottom: 2rem; }
.result-header h2 { font-size: 2rem; font-weight: 950; color: var(--primary-light); }
.score-banner { font-size: 3rem; font-weight: 950; color: #fff; background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%); padding: 3rem; border-radius: 28px; margin-bottom: 2.5rem; text-align: center; box-shadow: 0 0 60px rgba(16, 185, 129, 0.5); border: 2px solid rgba(255,255,255,0.2); }
.correct { color: #86efac; font-weight: 900; }
.wrong { color: #fca5a5; font-weight: 900; }

/* TOAST */
#toast { position: fixed; bottom: 2rem; right: 2rem; background: rgba(30, 41, 59, 0.9); color: var(--text); padding: 1.5rem 2rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 2000; transform: translateY(150px); opacity: 0; transition: var(--transition); pointer-events: none; border: 1px solid var(--border); }
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: rgba(16, 185, 129, 0.95); color: #fff; border-color: rgba(16, 185, 129, 0.4); }
#toast.error { background: rgba(239, 68, 68, 0.95); color: #fff; border-color: rgba(239, 68, 68, 0.4); }
#toast.info { background: rgba(99, 102, 241, 0.95); color: #fff; border-color: rgba(99, 102, 241, 0.4); }

/* LOADING */
.loader { display: inline-block; width: 24px; height: 24px; border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--primary-light); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; width: 1.25rem; height: 1.25rem; border: 4px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }

.hidden { display: none !important; }

/* FOOTER */
footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--border); background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(10px); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem 1.5rem; margin-bottom: 1.25rem; }
.footer-links a { color: var(--primary-light); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* POLICY PAGES */
.policy-page { max-width: 860px; margin: 2.5rem auto 4rem; padding: 2.5rem; }
.policy-page h1 { font-size: 2rem; font-weight: 900; color: var(--primary-light); margin-bottom: 0.35rem; }
.policy-page .policy-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.75rem; }
.policy-page h2 { font-size: 1.15rem; font-weight: 800; color: var(--text); margin: 1.75rem 0 0.6rem; }
.policy-page p, .policy-page li { color: var(--text-muted); line-height: 1.75; font-size: 0.97rem; }
.policy-page ul { padding-left: 1.35rem; margin: 0.5rem 0 1rem; }
.policy-page li { margin-bottom: 0.4rem; }
.policy-page a { color: var(--primary-light); font-weight: 600; }
.policy-page .back-link { display: inline-block; margin-bottom: 1.5rem; font-weight: 700; text-decoration: none; }
.policy-page .contact-box { background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(165, 180, 252, 0.35); border-radius: 14px; padding: 1.25rem 1.5rem; margin-top: 1rem; }
.policy-page .contact-box p { margin: 0.35rem 0; color: var(--text); }
@media (max-width: 640px) { .policy-page { padding: 1.5rem; margin-top: 1.25rem; } .policy-page h1 { font-size: 1.55rem; } }

/* RESPONSIVE */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 1rem; }
  #user-bar { justify-content: center; flex-wrap: wrap; }
  .dash-header { flex-direction: column; align-items: stretch; }
  .exam-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .leaderboard-entry { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .leader-score { text-align: left; }
  .auth-card { padding: 2rem 1.5rem; }
  .hero { padding: 2.5rem 1.5rem; }
  .hero h1 { font-size: 2.2rem; }
}

/* ADMIN */
.ai-badge { background: var(--accent); color: #fff; border-radius: 8px; padding: 0.5rem 1.2rem; font-size: 0.8rem; font-weight: 900; margin-left: 0.75rem; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(6, 182, 212, 0.5); }

/* ============================================================
   QUIZORA 2026 UI ADDITIONS
   ============================================================ */

input[type="number"] {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
}
input[type="number"]:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }

select.form-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) calc(50% - 2px), calc(100% - 15px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.75rem;
}
select.form-select option { background: #1e1b4b; color: #f8fafc; }

/* Landing coverage strip */
.coverage-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: -0.75rem auto 2rem;
  padding: 0.9rem 1.25rem;
  max-width: 1060px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.coverage-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #fbbf24;
  margin-right: 0.35rem;
}
.coverage-pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #e0e7ff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(236, 72, 153, 0.22));
  border: 1px solid rgba(165, 180, 252, 0.28);
  white-space: nowrap;
}

/* Shared text / empty states */
.muted-text { color: var(--text-muted); font-size: 0.95rem; padding: 0.75rem 0; }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed rgba(165, 180, 252, 0.35);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.35);
}
.empty-state h3 { color: var(--primary-light); margin: 0.5rem 0 0.4rem; font-size: 1.2rem; }
.empty-state p { color: var(--text-muted); font-size: 0.92rem; }
.empty-icon { font-size: 2.5rem; line-height: 1; }

/* User bar additions */
.header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.exam-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Exam cards */
.exam-card .card-badges,
.card-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.board-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(131, 56, 236, 0.35);
}
.exam-card .card-badges .board-badge { margin-bottom: 0; }
.week-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #a5f3fc;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.exam-card-sub { font-size: 0.9rem !important; color: var(--text-muted); margin-bottom: 0.7rem !important; }
.meta-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.35rem 0 0.9rem; }
.meta-pill {
  padding: 0.32rem 0.65rem;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.exam-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.exam-card .status-note { display: inline-block; }

/* Exam runner */
.exam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}
#answered-count { color: #a5f3fc; font-weight: 800; }
.exam-note {
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.28);
  color: #a5f3fc;
  font-size: 0.84rem;
  font-weight: 600;
}
.exam-submit-row { margin-top: 1.5rem; }

.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
  color: var(--primary-light);
}
.section-divider::before,
.section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.45), transparent);
}
.section-divider span {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(165, 180, 252, 0.32);
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 85%;
  line-height: 1.35;
}
.question-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.q-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.28rem 0.6rem;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}
.q-topic { color: var(--text-muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.q-marks { margin-left: auto; color: #fbbf24; font-size: 0.75rem; font-weight: 800; }
.question-block p.question-text { margin-bottom: 1rem; }
.options-list { display: flex; flex-direction: column; gap: 0.55rem; }
.options-list .option-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}
.options-list .option-label:hover { transform: translateX(4px); }
.options-list .option-label.selected {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.13);
}
.options-list .option-label input { margin: 0; flex: 0 0 auto; }
.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(165, 180, 252, 0.18);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 900;
}
.option-text { flex: 1; color: var(--text); font-size: 0.97rem; line-height: 1.45; }
.timer-danger { animation: pulseRed 1s infinite; }

/* Results */
.result-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0 0 2rem; }
.score-banner {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 52%, #db2777 100%);
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.45);
  padding: 2rem 1.5rem;
  font-size: 1rem;
}
.score-hero { display: flex; align-items: baseline; justify-content: center; gap: 0.5rem; }
.score-main { font-size: 4.2rem; line-height: 1; font-weight: 950; color: #fff; text-shadow: 0 8px 28px rgba(0, 0, 0, 0.25); }
.score-denom { font-size: 1.5rem; font-weight: 800; color: rgba(255, 255, 255, 0.78); }
.score-exam-title { color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; font-weight: 700; margin: 0.65rem 0 1.35rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; max-width: 700px; margin: 0 auto; }
.summary-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.75rem 0.5rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.summary-pill strong { font-size: 1.45rem; font-weight: 950; color: #fff; line-height: 1.1; }
.summary-pill span { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.74); }
.summary-good { background: rgba(16, 185, 129, 0.28); border-color: rgba(134, 239, 172, 0.45); }
.summary-bad { background: rgba(239, 68, 68, 0.24); border-color: rgba(252, 165, 165, 0.42); }
.summary-skip { background: rgba(148, 163, 184, 0.2); border-color: rgba(203, 213, 225, 0.3); }

.review-heading { color: var(--primary-light); font-size: 1.35rem; font-weight: 900; margin: 1rem 0 1.25rem; }
.review-block {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border);
  border-left: 5px solid rgba(148, 163, 184, 0.5);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.review-ok { border-left-color: #10b981; }
.review-bad { border-left-color: #ef4444; }
.review-skip { border-left-color: #94a3b8; }
.review-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.65rem; }
.section-tag {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(165, 180, 252, 0.28);
}
.answer-note { margin-left: auto; font-size: 0.76rem; font-weight: 800; }
.answer-note.correct { color: #86efac; }
.answer-note.incorrect { color: #fca5a5; }
.answer-note.skipped { color: var(--text-muted); }
.review-question { font-size: 1.02rem; font-weight: 700; color: #fff; margin-bottom: 0.9rem; line-height: 1.6; }
.review-options { display: flex; flex-direction: column; gap: 0.45rem; }
.review-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.92rem;
  color: #e2e8f0;
}
.review-option.is-correct { background: rgba(16, 185, 129, 0.13); border-color: rgba(16, 185, 129, 0.45); }
.review-option.is-wrong { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.42); }
.review-option-text { flex: 1; }
.review-tag { margin-left: auto; padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.64rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.tag-correct { background: #10b981; color: #fff; }
.tag-wrong { background: #ef4444; color: #fff; }
.explanation-box {
  margin-top: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  font-size: 0.88rem;
  line-height: 1.6;
}
.explanation-box strong { color: #fbbf24; }

/* Leaderboard filter */
.lb-filter-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lb-filter-row label { color: var(--text-muted); font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.lb-filter-row select { max-width: 460px; }

/* Admin */
.section-title { color: var(--primary-light); font-size: 1.3rem; font-weight: 900; margin-bottom: 0.25rem; }
.section-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.2rem; }
.admin-form-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) minmax(190px, 1fr); gap: 1rem; align-items: end; }
.admin-generate-cell { justify-content: flex-end; }
.progress-track { height: 12px; margin-top: 0.9rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; border: 1px solid var(--border); }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #06b6d4, #6366f1, #ec4899); transition: width 0.5s ease; }
.admin-exam-card { padding: 1.4rem; }
.admin-exam-card.is-inactive { opacity: 0.72; }
.admin-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.status-chip { padding: 0.32rem 0.65rem; border-radius: 999px; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; }
.chip-live { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.45); color: #86efac; }
.chip-hidden { background: rgba(148, 163, 184, 0.14); border: 1px solid rgba(148, 163, 184, 0.32); color: #cbd5e1; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.btn-sm { padding: 0.55rem 0.8rem; font-size: 0.8rem; border-radius: 10px; white-space: nowrap; }
.admin-exam-card h3 { font-size: 1.05rem; margin: 0.15rem 0 0.4rem; }

/* Responsive additions */
@media (max-width: 760px) {
  .coverage-strip { border-radius: 20px; justify-content: flex-start; }
  .coverage-label { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form-row { grid-template-columns: 1fr; }
  .admin-generate-cell { justify-content: stretch; }
  .lb-filter-row { flex-direction: column; align-items: stretch; }
  .lb-filter-row select { max-width: none; }
  .exam-toolbar { flex-direction: column; align-items: flex-start; }
  .hero-stats { display: flex; flex-direction: column; gap: 0.8rem; }
  .stat-item { min-width: 0; }
  .answer-note { margin-left: 0; width: 100%; }
  .review-head { align-items: flex-start; }
  .score-main { font-size: 3.2rem; }
  .score-banner { padding: 1.5rem 1rem; }
}

/* ============================================================
   LAYOUT POLISH
   Keeps the colourful QUIZORA look while making the landing page
   and dashboards fit the first screen cleanly.
   ============================================================ */

/* Admin summary cards: 4 across on desktop instead of 3 + 1 */
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* Timer: calm blue during the exam, red only for the last 5 minutes */
#timer {
  background: linear-gradient(135deg, #0891b2 0%, #4f46e5 100%);
  animation: none;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
#timer.timer-danger {
  background: var(--danger);
  animation: pulseRed 1s infinite;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}

/* Two-column hero on desktop so the login card is reachable sooner */
@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 2.5rem;
    align-items: center;
    padding: 2.75rem 2.5rem;
  }
  .hero-content { max-width: none; }
  .hero-badge { margin-bottom: 1.1rem; }
  .hero h1 { font-size: 3.1rem; margin-bottom: 1rem; }
  .hero p { font-size: 1.12rem; line-height: 1.7; margin-bottom: 1.5rem; max-width: none; }
  .hero-stats { margin-top: 1.5rem; gap: 0.9rem; }
  .stat-item { flex: 1; min-width: 0; padding: 1rem 0.8rem; }
  .stat-number { font-size: 2rem; }
  .stat-label { font-size: 0.66rem; letter-spacing: 0.08em; }
  .hero-visual { align-self: center; }
}

/* Compact mobile / tablet hero; the decorative mock card is not worth
   a full extra screen of scrolling on a phone. */
@media (max-width: 899px) {
  .hero { padding: 2.25rem 1.5rem; }
  .hero-visual { display: none; }
  .hero-badge { margin-bottom: 1rem; padding: 0.65rem 1.1rem; font-size: 0.8rem; }
  .hero h1 { font-size: 2.6rem; margin-bottom: 1rem; }
  .hero p { font-size: 1.08rem; line-height: 1.65; margin-bottom: 1.5rem; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 1.6rem;
  }
  .stat-item { min-width: 0; padding: 0.85rem 0.4rem; }
  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: 0.58rem; letter-spacing: 0.05em; margin-top: 0.3rem; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 2.2rem; }
  .coverage-strip { margin-top: 0; padding: 0.8rem; }
  .auth-wrapper { margin-bottom: 2rem; }
}

