@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-0: #f8f6ff;
  --bg-1: #f3efff;
  --surface: #ffffff;
  --surface-alt: #faf8ff;
  --ink: #0f172a;
  --muted: #5e5a72;
  --line: #e7defa;
  --brand: #7c3aed;
  --brand-strong: #5b21b6;
  --brand-soft: #ede9fe;
  --ok: #0f7b5f;
  --warn: #a85b00;
  --danger: #b42318;
  --sidebar: #1a1137;
  --sidebar-ink: #ece7ff;
  --shadow: 0 24px 48px rgba(68, 39, 124, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body.landing-page {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

body.landing-page #landingRoot {
  width: 100%;
  max-width: 100%;
}

body.landing-page #landingRoot > section {
  min-width: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(circle at 10% -10%, #efe7ff 0%, transparent 35%),
    radial-gradient(circle at 90% 0%, #f5e9ff 0%, transparent 26%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1));
}

/* Global Landing Theme */
.moving-bg {
  background: linear-gradient(-45deg, #fbfaff, #ffffff, #f5f3ff, #fdfbff);
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
}

.tech-grid {
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, rgba(139, 92, 246, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.tech-grid::after {
  content: "SEC-004 // AI-OPTIMIZED";
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 2px;
  color: rgba(139, 92, 246, 0.2);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.35;
  animation: floatOrb 25s infinite alternate;
  pointer-events: none;
}

.orb-1 {
  width: 35vw;
  height: 35vw;
  background: #8b5cf6;
  top: -15%;
  left: -10%;
}

.orb-2 {
  width: 45vw;
  height: 45vw;
  background: #6366f1;
  bottom: -15%;
  left: 20%;
  animation-delay: -7s;
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  background: #ec4899;
  top: 10%;
  right: -10%;
  animation-delay: -12s;
}

.login-card-shadow {
  box-shadow:
    0 60px 120px -25px rgba(139, 92, 246, 0.18),
    0 30px 60px -30px rgba(0, 0, 0, 0.08);
}

.hook-divider {
  position: absolute;
  right: -1px;
  top: 0;
  height: 100%;
  width: 18%;
  fill: white;
  z-index: 20;
}

.grading-text {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modern-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 24px -1px rgba(0, 0, 0, 0.05),
    0 40px 80px -20px rgba(139, 92, 246, 0.15);
  border-radius: 3rem;
  position: relative;
  overflow: hidden;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("https://grainy-gradients.vercel.app/noise.svg");
  opacity: 0.05;
  pointer-events: none;
}

.slide-content {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.98);
}

.slide-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tech-bar {
  height: 6px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.tech-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #d946ef);
  width: 0%;
  transition: width 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.slide-content.active .tech-bar-inner {
  width: 85%;
}

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

@keyframes floatOrb {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(60px, 40px) scale(1.15);
  }
}

h1,
h2,
h3,
.brand,
.eyebrow,
.timer-box strong,
.menu-link,
.btn {
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.status {
  min-height: 1.25rem;
  color: var(--brand-strong);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}

.mini-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.68rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), #2e67e6);
  color: #fff;
}

.btn-secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-ghost {
  border-color: #c8d5f1;
  background: transparent;
  color: var(--ink);
}

.btn-wide {
  width: 100%;
}

.btn-xs {
  padding: 0.42rem 0.58rem;
  font-size: 0.74rem;
  border-radius: 9px;
}

.btn-xs.active {
  border-color: #c5b3ff;
  background: #f1ebff;
  color: #5b21b6;
}

a.btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

a.btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.topbar.glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand.mark::before {
  content: "";
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  vertical-align: middle;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.identity {
  font-size: 0.86rem;
  color: var(--muted);
}

/* Landing */
.landing-shell {
  min-height: calc(100vh - 76px);
  padding: 1rem;
  display: grid;
  place-items: center;
}

.welcome-grid {
  width: min(1180px, 100%);
  background: linear-gradient(150deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.hero-ref-shell {
  width: min(1240px, 100%);
  background: linear-gradient(150deg, #f2eaff, #f8f4ff 45%, #efe7ff);
  border: 1px solid #dfd3ff;
  border-radius: 28px;
  box-shadow: 0 28px 52px rgba(86, 39, 160, 0.16);
  padding: 1rem;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 0.8rem;
}

.hero-ref-left {
  position: relative;
  border-radius: 20px;
  border: 1px solid #e4dbff;
  background: linear-gradient(180deg, #f6f0ff, #f9f6ff);
  padding: 1.25rem 1.2rem 1.15rem;
  min-height: 580px;
}

.hero-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d5c8ff;
  border-radius: 12px;
  background: #fff;
  padding: 0.42rem 0.6rem;
}

.hero-brand-chip .dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #8f62ff, #be93ff);
}

.hero-ref-left h1 {
  margin: 0.62rem 0 0.5rem;
  max-width: 18ch;
  font-size: clamp(1.6rem, 2.45vw, 2.5rem);
  line-height: 1.16;
}

.hero-grid-art {
  margin-top: 1rem;
  border: 1px solid #e8ddff;
  border-radius: 18px;
  background:
    linear-gradient(#e9defb 1px, transparent 1px),
    linear-gradient(90deg, #e9defb 1px, transparent 1px),
    linear-gradient(180deg, #fdfcff, #f7f3ff);
  background-size: 34px 34px, 34px 34px, auto;
  height: 310px;
  padding: 0.4rem;
}

.hero-wave {
  width: 100%;
  height: 100%;
}

.floating-metric {
  position: absolute;
  border: 1px solid #dfd1ff;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(108, 73, 182, 0.18);
  padding: 0.52rem 0.65rem;
  min-width: 140px;
}

.floating-metric small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.floating-metric strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.9rem;
}

.floating-metric.one {
  left: 1.25rem;
  bottom: 1.2rem;
}

.floating-metric.two {
  right: 1.15rem;
  top: 14rem;
}

.hero-ref-right {
  border-radius: 20px;
  border: 1px solid #e5dcff;
  background: #fdfcff;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hero-login-shell {
  width: min(430px, 100%);
  border: 1px solid #e6deff;
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
}

.hero-login-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, transparent 40%),
    linear-gradient(135deg, #986fff, #7c48ff);
  box-shadow: 0 10px 20px rgba(129, 73, 232, 0.3);
}

.hero-login-shell h2 {
  margin: 0;
  text-align: center;
}

.hero-login-shell .muted,
.hero-login-shell .mini-note {
  text-align: center;
}

.welcome-hero {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f4f8ff, #ffffff 55%);
}

.welcome-hero h1 {
  margin: 0.65rem 0;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  line-height: 1.16;
  max-width: 21ch;
}

.actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.actions.inline {
  display: flex;
  flex-wrap: wrap;
}

.welcome-cards {
  display: grid;
  gap: 0.75rem;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
}

.preview-card small {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.preview-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.preview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Auth */
.auth-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-shell.wide {
  place-items: stretch;
}

.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1rem;
  align-items: stretch;
}

.auth-layout.ref {
  width: min(1240px, 100%);
  grid-template-columns: 1.08fr 0.92fr;
  gap: 0.8rem;
}

.auth-promo.ref {
  border-color: #e4d8ff;
  background: linear-gradient(180deg, #f6f0ff 0%, #f9f5ff 100%);
}

.auth-card.ref {
  border-color: #e3d8ff;
  background: #fff;
  padding: 1rem;
}

.auth-graph-box {
  margin-top: 0.9rem;
  border: 1px solid #e6ddff;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8f4ff);
  padding: 0.4rem;
}

.auth-graph-box svg {
  width: 100%;
  height: 280px;
}

.auth-promo,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.auth-promo h1 {
  margin: 0.55rem 0;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.16;
  max-width: 22ch;
}

.auth-feature-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.auth-feature-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem;
  background: var(--surface-alt);
}

.auth-feature-grid strong {
  font-size: 0.9rem;
}

.auth-feature-grid p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-card h2 {
  margin: 0.5rem 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  background: var(--surface-alt);
}

.user-chip img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef2ff;
}

.chip-name {
  margin: 0;
  font-weight: 700;
}

.chip-email {
  margin: 0.12rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.role-pill {
  margin: 0.7rem 0 0;
  display: inline-block;
  border: 1px solid #ceb8ff;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #5b21b6;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
}

/* Generic Panels */
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.panel-header {
  margin-bottom: 0.8rem;
}

.panel-header h1,
.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.panel-header p {
  margin: 0.3rem 0 0;
}

.panel-header.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.62rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
}

.form-stack {
  display: grid;
  gap: 0.72rem;
}

.form-stack label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.two-col {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.inline-check input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.key-title {
  margin: 0.2rem 0 0.5rem;
  font-weight: 700;
}

.answer-key-grid,
.marks-grid {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.35rem;
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 0.42rem;
}

.answer-key-grid {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
}

.key-item {
  display: grid;
  gap: 0.18rem;
}

.key-item small,
.mark-item small {
  font-size: 0.74rem;
  color: var(--muted);
}

.marks-block,
.ocr-block,
.live-controls,
.exam-actions-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 0.72rem;
}

.marks-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  max-height: 260px;
}

.mark-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem;
}

.mark-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
}

.live-meta {
  margin-bottom: 0.56rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.live-meta strong {
  font-size: 1rem;
}

.exam-list,
.attempt-list,
.analysis-list,
.reference-list {
  display: grid;
  gap: 0.56rem;
}

.exam-item,
.attempt-item,
.analysis-item,
.reference-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.66rem;
}

.exam-row,
.attempt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.exam-meta,
.attempt-meta {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.exam-actions,
.reference-actions {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.attempt-block {
  margin-top: 0.9rem;
}

.blocked {
  border-color: #f7c8cf;
  background: #fff4f6;
}

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.admin-rail {
  position: sticky;
  top: 80px;
  align-self: start;
  border: 1px solid #2e4a85;
  border-radius: 20px;
  background: linear-gradient(180deg, #0f2554, #11203f);
  color: var(--sidebar-ink);
  padding: 1rem;
}

.admin-rail h2 {
  margin: 0.4rem 0;
}

.admin-rail .muted {
  color: #b9c8f1;
}

.rail-points {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.rail-points li {
  border: 1px solid rgba(197, 214, 253, 0.26);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font-size: 0.84rem;
  background: rgba(32, 54, 102, 0.48);
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

/* Student App */
.student-app-page {
  overflow-x: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 36, 0.42);
  z-index: 38;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(210, 188, 255, 0.2);
  background: linear-gradient(185deg, #1b103d 0%, #130d2f 100%);
  color: var(--sidebar-ink);
  padding: 1rem 0.8rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.8rem;
  z-index: 39;
}

.app-sidebar .brand {
  color: #fff;
}

.sidebar-subtitle {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #c8bcf4;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.menu-link {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #ece7ff;
  text-align: left;
  padding: 0.66rem 0.74rem;
  font-size: 0.84rem;
  cursor: pointer;
}

.menu-link:hover {
  background: rgba(167, 138, 250, 0.2);
}

.menu-link.active {
  border-color: #8b5cf6;
  background: rgba(124, 58, 237, 0.36);
  color: #fff;
}

.sidebar-footer {
  display: grid;
  gap: 0.5rem;
}

.sidebar-footer .btn-secondary,
.sidebar-footer .btn-ghost {
  color: #fff;
  background: transparent;
  border-color: rgba(207, 188, 255, 0.4);
}

.sidebar-footer .btn-secondary:hover,
.sidebar-footer .btn-ghost:hover {
  background: rgba(197, 177, 255, 0.22);
}

.app-main {
  min-width: 0;
  padding: 0.82rem;
}

.app-topbar {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 0.7rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.app-topbar-left,
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.headline {
  margin: 0;
  font-size: 1.02rem;
}

.mini-account {
  display: grid;
  gap: 0.1rem;
}

.mini-account strong {
  font-size: 0.84rem;
}

.mini-account small {
  color: var(--muted);
  font-size: 0.72rem;
}

.hamburger {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #0f172a;
}

.timer-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.3rem 0.55rem;
  display: grid;
  text-align: right;
  font-size: 0.7rem;
}

.timer-box strong {
  font-size: 1rem;
}

.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(13, 23, 48, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.profile-gate-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.registration-open {
  overflow: hidden;
}

.view-section {
  display: none;
  margin-top: 0.68rem;
}

.view-section.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.section-head.compact {
  margin-bottom: 0.55rem;
}

.dash-stats {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  padding: 0.75rem;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.24rem;
}

.dashboard-list-card,
.account-card {
  margin-top: 0.56rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.8rem;
}

.simple-list {
  display: grid;
  gap: 0.5rem;
}

.simple-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.simple-row p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
}

.student-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.62rem;
}

.paper-panel,
.qa-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 0.64rem;
  box-shadow: var(--shadow);
  min-height: 70vh;
}

.paper-panel {
  display: flex;
  flex-direction: column;
}

#examPdf {
  width: 100%;
  min-height: 520px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.pdf-toolbar {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-alt);
  padding: 0.45rem;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  flex-wrap: wrap;
}

.pdf-toolbar input,
.pdf-toolbar select {
  width: auto;
  min-width: 70px;
  font-size: 0.78rem;
  padding: 0.38rem 0.48rem;
}

.analysis-pdf-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.56rem;
  margin-bottom: 0.65rem;
}

#analysisPdf {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.76rem;
  background: #fff;
}

.question-label {
  margin: 0 0 0.42rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.option-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.option-btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 0.75rem;
  font-size: 0.96rem;
  cursor: pointer;
}

.option-btn.active {
  border-color: #c7b4ff;
  background: #f1ebff;
  color: #5b21b6;
}

.option-btn.locked {
  cursor: not-allowed;
}

.nav-actions {
  margin: 0.7rem 0;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.palette-tools {
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.jump-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.jump-wrap input {
  width: 82px;
}

.palette-note {
  margin: -0.15rem 0 0.42rem;
  font-size: 0.8rem;
}

.palette-grid {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.52rem;
  display: grid;
  gap: 0.34rem;
  max-height: 400px;
  overflow: auto;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
}

.palette-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 34px;
  font-size: 0.78rem;
  background: #fff;
  cursor: pointer;
}

.palette-btn.answered {
  background: #e9f7f3;
  border-color: #95dac0;
}

.palette-btn.current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.selector-wrap {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
}

.analysis-item,
.reference-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.analysis-item.current {
  border-color: #c7b4ff;
  background: #f2edff;
}

.analysis-item p,
.reference-item p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
}

.account-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.account-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
  padding: 0.5rem;
}

.account-grid small {
  color: var(--muted);
  font-size: 0.74rem;
}

.account-grid p {
  margin: 0.2rem 0 0;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Result */
.result-panel {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
}

.result-panel h3 {
  margin: 0 0 0.34rem;
}

.result-metrics {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
  padding: 0.45rem;
  display: grid;
  gap: 0.2rem;
}

.metric-card small {
  font-size: 0.72rem;
  color: var(--muted);
}

.metric-card strong {
  font-size: 0.84rem;
}

.result-grid {
  margin-top: 0.42rem;
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 0.36rem;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem;
  font-size: 0.76rem;
  background: #fff;
}

.result-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.24rem;
  margin-bottom: 0.14rem;
}

.result-item-line {
  line-height: 1.26;
}

.time-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.34rem;
  background: #fff;
  color: var(--muted);
  font-size: 0.66rem;
}

.result-item.correct {
  border-color: #97d9bf;
  background: #e8f8f2;
}

.result-item.wrong {
  border-color: #efb5bc;
  background: #fff0f3;
}

.result-item.missed {
  border-color: #ebddbc;
  background: #fff9ec;
}

#paperPanel:fullscreen {
  background: #fff;
  padding: 0.55rem;
}

#paperPanel:fullscreen #examPdf {
  min-height: calc(100vh - 140px);
}

/* Responsive */
@media (max-width: 1024px) {
  .moving-bg {
    animation: none;
    background:
      radial-gradient(circle at 12% -8%, rgba(139, 92, 246, 0.12) 0%, transparent 36%),
      radial-gradient(circle at 92% 8%, rgba(236, 72, 153, 0.1) 0%, transparent 30%),
      linear-gradient(180deg, #fbfaff 0%, #ffffff 48%, #f7f3ff 100%);
  }

  .orb {
    display: none;
  }

  .modern-card {
    backdrop-filter: none;
    border: 1px solid #efe9ff;
    box-shadow: 0 18px 34px -16px rgba(81, 53, 136, 0.16);
  }

  .noise-overlay {
    display: none;
  }

  .login-card-shadow {
    box-shadow: 0 24px 40px -22px rgba(84, 54, 146, 0.28);
  }

  .tech-grid {
    opacity: 0.55;
  }

  /* Mobile performance mode: disable non-essential continuous animations */
  .animate-ping,
  .animate-pulse {
    animation: none !important;
  }

  .tech-grid,
  .tech-bar-inner {
    transition: none !important;
  }

  #landingRoot,
  .landing-visual,
  .landing-auth {
    transform: translateZ(0);
    will-change: auto;
  }

  .hook-divider {
    display: none;
  }

  .tech-grid {
    background-size: 30px 30px;
  }

  body.landing-page #slideDots {
    gap: 0.5rem;
    position: relative;
    z-index: 80;
    pointer-events: auto;
  }
}

@media (max-width: 1200px) {
  .welcome-grid,
  .hero-ref-shell,
  .auth-layout,
  .auth-layout.ref,
  .admin-layout,
  .student-shell {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: 272px;
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .hamburger {
    display: inline-flex;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-rail {
    position: static;
  }

  #examPdf {
    min-height: 420px;
  }

  .hero-ref-left {
    min-height: auto;
  }

  .floating-metric {
    position: static;
    margin-top: 0.45rem;
  }
}

@media (max-width: 760px) {
  body.landing-page .tech-grid::after {
    display: none;
  }

  .orb {
    filter: blur(90px);
    opacity: 0.24;
  }

  .orb-1 {
    width: 50vw;
    height: 50vw;
    left: -14%;
  }

  .orb-2 {
    width: 58vw;
    height: 58vw;
    left: 12%;
  }

  .orb-3 {
    width: 44vw;
    height: 44vw;
    right: -14%;
  }

  .slide-content {
    inset: auto;
    width: 100%;
    max-width: 100%;
  }

  .modern-card {
    border-radius: 1.6rem;
  }

  .brand {
    font-size: 0.86rem;
    max-width: 58vw;
    white-space: normal;
    line-height: 1.1;
  }

  .topbar,
  .app-topbar {
    align-items: flex-start;
  }

  .topbar-right,
  .app-topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-feature-grid,
  .two-col,
  .option-buttons {
    grid-template-columns: 1fr;
  }

  .reference-item,
  .analysis-item,
  .simple-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-main {
    padding: 0.64rem;
  }

  .result-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .pdf-toolbar {
    align-items: flex-start;
  }

  .pdf-toolbar-group {
    width: 100%;
  }
}
