:root {
  /* TAPS Brand Palette — Refined & Restrained */
  --brand: #5C1E45;
  --brand-hover: #481636;
  --brand-soft: #FBF4F8;
  --brand-border: #E8D2DF;

  --gold: #E5A800;
  --gold-bright: #FFC21A;
  --gold-soft: #FFFBEB;
  --gold-text: #7A5600;
  --gold-border: #F5DF98;

  /* Clean Neutral Surfaces */
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-subtle: #F9FAFB;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Typography Ink */
  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  /* Semantic Status */
  --success: #15803D;
  --success-soft: #F0FDF4;
  --success-border: #BBF7D0;
  --warning: #B45309;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;

  /* Elevation & Geometry */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --max-width: 960px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, h4, strong {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.03em;
}

.taps-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hide exam topbar on the full-bleed login screen */
.taps-app.is-auth-screen .topbar {
  display: none;
}
.taps-app.is-auth-screen .screen-wrap {
  padding: 0;
  max-width: none;
}

/* =========================================================================
   OFFLINE BANNER
   ========================================================================= */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #1F2937;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
}
.offline-banner[hidden] {
  display: none;
}

/* =========================================================================
   SPLIT-SCREEN LOGIN (Matches Reference Style + TAPS Brand)
   ========================================================================= */
.screen {
  display: none;
}
.screen.active {
  display: block;
}

/* Outer Soft Ambient Frame (Locked to Viewport on Desktop) */
.auth-viewport {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #E8ECF1 0%, #F1F3F6 100%);
}

.auth-split {
  width: 100%;
  max-width: 1160px;
  height: 100%;
  max-height: 760px;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  border-radius: 28px;
  background: linear-gradient(180deg, #F5F5F3 0%, #F7F5EE 52%, #FAF2D6 100%);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

/* Left Column: Inset Rounded Photo Card (Fixed on Desktop) */
.auth-visual-col {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 16px 0 16px 16px;
}

.auth-visual {
  position: relative;
  height: 100%;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background-image: var(--login-bg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  color: #FFFFFF;
}

.auth-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(24, 16, 28, 0.34) 0%,
    rgba(24, 16, 28, 0.14) 44%,
    rgba(28, 15, 29, 0.62) 100%
  );
  z-index: 1;
}

.visual-float-top,
.visual-float-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visual-float-top {
  align-items: flex-start;
  max-width: 290px;
}

.float-card-gold {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  background: #FFD64E;
  color: #1C1917;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.float-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.float-card-gold strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #1C1917;
}

.float-card-gold > span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(28, 25, 23, 0.72);
  font-weight: 500;
}

.float-card-dark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin-left: 16px;
  border-radius: 13px;
  background: rgba(24, 24, 27, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.float-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1C1917;
  flex: none;
}

.float-dot.gold {
  background: #FFD64E;
}

.visual-glass-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.visual-glass-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
}

.visual-glass-strip .material-symbols-outlined {
  font-size: 15px;
  color: #FFD64E;
}

.float-card-white {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  color: #111827;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.float-card-white strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: #111827;
}

.float-card-white p {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #4B5563;
}

/* Right Form Panel (Fixed Header & Footer, Scrollable Form Body) */
.auth-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 36px 20px;
  background: transparent;
}

.auth-panel-inner {
  width: 100%;
  max-width: 400px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.auth-panel-header {
  flex: none;
  padding-bottom: 14px;
}

.auth-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 4px 4px 12px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 24, 39, 0.18) transparent;
}

/* Pill Brand Lockup (Crextio-style) */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.auth-logo-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.auth-logo-pill strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.auth-school-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

/* 3-Step Progress Stepper */
.auth-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.stepper-item.active {
  color: var(--brand);
}
.stepper-item.active .step-num {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.stepper-item.done {
  color: var(--success);
}
.stepper-item.done .step-num {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.stepper-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
}

/* Auth Steps */
.auth-step {
  display: none;
  animation: fadeSlideUp 0.22s ease;
}
.auth-step.active {
  display: block;
  margin: auto 0;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-heading {
  margin-bottom: 22px;
  text-align: center;
}
.auth-heading.compact {
  margin-bottom: 14px;
}
.auth-heading h2 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-heading p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Form Controls (Crextio Pill Inputs) */
.field-group {
  margin-bottom: 16px;
}

.field-group > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-left: 10px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 44px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-wrap input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}

#exam-code-input {
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.input-wrap input:focus,
.input-wrap select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(92, 30, 69, 0.12);
}

/* Verified Subject Pill (Step 2) */
.verified-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.verified-pill .material-symbols-outlined {
  font-size: 18px;
  color: var(--brand);
}
.verified-pill .link-btn {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

/* Gender Segmented Cards */
.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.gender-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.gender-card:hover .gender-card-body {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.gender-card input:checked + .gender-card-body {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(92, 30, 69, 0.1);
}

/* Form Alert */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
}
.form-alert[hidden] {
  display: none;
}

/* Step 3 Preview Cards */
.preview-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.preview-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 10px;
}
.preview-card-head .material-symbols-outlined {
  font-size: 18px;
}

.duration-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 700;
}
.duration-chip .material-symbols-outlined {
  font-size: 14px;
}

.summary-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.summary-dl dt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.summary-dl dd {
  margin: 2px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.score-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
}
.score-tile small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.score-tile strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.score-tile.total-tile {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.score-tile.total-tile strong {
  color: var(--brand);
}

.grading-scale-wrap {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.grading-scale-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.grading-scale-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.grading-scale-chips span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-secondary);
}
.grading-scale-chips b {
  color: var(--brand);
  margin-right: 2px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
}
.consent-row input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(92, 30, 69, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(92, 30, 69, 0.22);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-full {
  width: 100%;
}

.step-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

/* Auth Step Pill Buttons (Crextio Warm Gold Primary + Outlined Pill Ghost) */
.auth-panel .btn {
  height: 48px;
  border-radius: 999px;
}

.auth-panel .btn-primary {
  background: #FFD44D;
  color: #1C1917;
  box-shadow: 0 6px 18px rgba(229, 168, 0, 0.24);
}
.auth-panel .btn-primary:hover:not(:disabled) {
  background: #F5C42E;
  color: #1C1917;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(229, 168, 0, 0.3);
}

.auth-panel .btn-ghost {
  background: transparent;
  border-color: rgba(17, 24, 39, 0.16);
  color: var(--text);
}
.auth-panel .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(17, 24, 39, 0.28);
}

/* Auth Footer & PWA Install Button (Pinned at Bottom) */
.auth-footer {
  flex: none;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pwa-install-btn:hover {
  background: #FEF3C7;
}
.pwa-install-btn[hidden] {
  display: none;
}

.auth-copyright {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================================
   EXAM WORKSPACE TOPBAR (Clean, Minimal White)
   ========================================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: none;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.meta-chip .material-symbols-outlined {
  font-size: 16px;
  color: var(--text-muted);
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-pill .material-symbols-outlined {
  font-size: 18px;
}
.timer-pill.timer-warning {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
}
.timer-pill.timer-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
  animation: timerPulse 0.9s infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* =========================================================================
   EXAM SCREENS & QUESTION CARDS
   ========================================================================= */
.screen-wrap {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 110px;
}

.exam-container {
  max-width: 820px;
  margin: 0 auto;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
}

.question-counter {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--gold) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.q-badge.primary {
  background: var(--gold-soft);
  border-color: var(--gold-border);
  color: var(--gold-text);
}
.q-badge.subtle {
  color: var(--text-muted);
  font-weight: 600;
}

.question-text {
  margin: 0 0 24px;
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.42;
  color: var(--text);
}

.question-media {
  margin-bottom: 20px;
}
.question-media img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Multiple Choice Options */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
}

.option-btn:hover {
  border-color: var(--brand);
  background: var(--surface-subtle);
}

.option-btn.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(92, 30, 69, 0.1);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  flex: none;
  transition: all 0.14s ease;
}

.option-btn.selected .option-letter {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.option-text {
  flex: 1;
  line-height: 1.4;
}

.selected-check {
  margin-left: auto;
  color: var(--brand);
  font-size: 20px;
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

/* Validation & Section B */
.validation-message {
  display: none;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
}
.validation-message.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-grid.validation-active {
  animation: shake 0.25s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.question-hint {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
  font-size: 13.5px;
}

.answer-label {
  display: block;
}
.answer-label > span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

textarea#answer-b {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  resize: vertical;
  -webkit-user-select: text;
  user-select: text;
}

.integrity-note {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.integrity-note.show {
  display: block;
}

/* Fill-in-the-Gaps Inline Inputs */
.gap-sentence {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 22px;
}

.gap-inline-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  margin: 0 4px;
}

.gap-input {
  min-width: 150px;
  width: 170px;
  max-width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--brand-border);
  border-bottom: 2.5px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  text-align: center;
  transition: all 0.15s ease;
}

.gap-input::placeholder {
  color: #9A748B;
  font-weight: 500;
  font-size: 13.5px;
}

.gap-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(92, 30, 69, 0.14);
}

.gap-input.has-value {
  background: var(--surface);
  border-color: var(--brand);
}

.gap-single-box {
  margin-top: 8px;
}

.gap-single-box label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.gap-single-box .gap-input {
  width: 100%;
  height: 48px;
  text-align: left;
  padding: 0 16px;
}

.gap-helper {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================================
   CENTER CARDS (Transition, Success, Status) & REVIEW SCREEN
   ========================================================================= */
.center-card {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.center-card h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}
.center-card p {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 440px;
}

.status-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.status-circle .material-symbols-outlined {
  font-size: 36px;
}
.status-circle.primary {
  background: var(--brand-soft);
  color: var(--brand);
}
.status-circle.success {
  background: var(--success-soft);
  color: var(--success);
}
.status-circle.warning {
  background: var(--gold-soft);
  color: var(--warning);
}
.status-circle.small {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
}
.status-circle.small .material-symbols-outlined {
  font-size: 28px;
}

.success-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.receipt {
  width: 100%;
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 24px;
}
.receipt p {
  margin: 6px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: none;
}
.receipt strong {
  color: var(--text);
}

/* Review Layout */
.review-layout {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px;
  align-items: start;
}

.review-main h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
}
.review-main > p {
  margin: 0 0 20px;
  color: var(--text-secondary);
}

.review-cards {
  display: grid;
  gap: 14px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.summary-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--brand);
}
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.summary-grid div {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.summary-grid span {
  font-size: 12px;
  color: var(--text-muted);
}
.summary-grid strong {
  font-size: 22px;
  color: var(--text);
}

.project-card {
  background: var(--gold-soft);
  border-color: var(--gold-border);
}
.project-card h3 {
  color: var(--gold-text);
}
.project-card strong {
  font-size: 22px;
  color: var(--gold-text);
}

.submit-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aside-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}
.submit-aside h3 {
  margin: 0;
  font-size: 18px;
}
.submit-aside p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* =========================================================================
   BOTTOM NAVIGATION BAR
   ========================================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav.hidden {
  display: none;
}

.bottom-nav-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.14s ease;
}
.nav-btn:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}
.nav-btn-primary:hover {
  background: var(--brand-hover);
  color: #FFFFFF;
}

/* =========================================================================
   MODALS
   ========================================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-md);
}
.modal-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--text);
}
.modal-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.navigator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.navigator-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.navigator-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid var(--border-strong);
}
.legend-current { background: var(--brand); border-color: var(--brand) !important; }
.legend-answered { background: var(--success-soft); border-color: var(--success) !important; }
.legend-unanswered { background: var(--surface-subtle); }

#navigator-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.nav-dot {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.nav-dot span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.nav-dot small {
  font-size: 10.5px;
  color: var(--text-muted);
}
.nav-dot.answered {
  background: var(--success-soft);
  border-color: var(--success-border);
}
.nav-dot.answered span,
.nav-dot.answered small {
  color: var(--success);
}
.nav-dot.current {
  background: var(--brand);
  border-color: var(--brand);
}
.nav-dot.current span,
.nav-dot.current small {
  color: #FFFFFF;
}

.confirm-card {
  max-width: 440px;
  text-align: center;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

/* Loading & Confetti Canvas */
.loading {
  opacity: 0.65;
  pointer-events: none;
}

.submission-splash-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 40;
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================= */
@media (max-width: 920px) {
  .auth-viewport {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 0;
    align-items: stretch;
  }

  .auth-split {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 100vh;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: 0;
  }

  .auth-visual-col {
    height: auto;
    padding: 14px 14px 0;
  }

  .auth-visual {
    height: auto;
    min-height: 240px;
    padding: 18px;
    gap: 18px;
  }

  .auth-panel {
    height: auto;
    overflow: visible;
    padding: 22px 20px 28px;
  }

  .auth-panel-inner,
  .auth-panel-body {
    height: auto;
    overflow: visible;
  }

  .auth-school-sub {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding: 10px 16px;
  }
  .brand-text span,
  .meta-chip {
    display: none;
  }
  .screen-wrap {
    padding: 20px 16px 96px;
  }
  .question-card {
    padding: 22px 18px;
  }
  .option-grid,
  .review-layout {
    grid-template-columns: 1fr;
  }
  .summary-dl,
  .score-breakdown {
    grid-template-columns: 1fr;
  }
  .confirm-actions {
    grid-template-columns: 1fr;
  }
  .nav-btn {
    padding: 0 13px;
    font-size: 13px;
  }
}

@media print {
  .topbar, .bottom-nav, .modal, .offline-banner {
    display: none !important;
  }
  .screen-wrap {
    padding: 0;
  }
  .screen:not(#screen-success) {
    display: none !important;
  }
}
