:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647085;
  --line: #dce2ea;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --navy: #152642;
  --navy-2: #20395f;
  --orange: #ff9900;
  --orange-dark: #d97f00;
  --teal: #138b82;
  --green: #1c8b5d;
  --red: #c53b4a;
  --purple: #7357b7;
  --shadow: 0 18px 50px rgba(25, 42, 69, 0.10);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 153, 0, 0.10), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  color: var(--ink);
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.app-header {
  min-height: 82px;
  padding: 15px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(220, 226, 234, 0.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-wrap, .header-actions, .exam-metrics, .question-meta-row,
.panel-heading, .navigator-heading, .result-actions, .dialog-actions {
  display: flex;
  align-items: center;
}

.brand-wrap { gap: 13px; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
  box-shadow: 0 10px 24px rgba(21, 38, 66, 0.24);
  font-size: 1.3rem;
  font-weight: 800;
  position: relative;
}
.brand-mark::after {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 99px;
  background: var(--orange);
  position: absolute;
  bottom: 9px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.05rem, 2vw, 1.35rem); margin-bottom: 0; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.55rem); line-height: 1.16; margin-bottom: 14px; }
h3 { font-size: 1.24rem; margin-bottom: 0; }
.eyebrow {
  margin-bottom: 4px;
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.header-actions { gap: 12px; }
.local-badge {
  background: #eaf7f4;
  color: #0a6b63;
  border: 1px solid #c5e9e3;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.page-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 34px auto 70px;
}

.screen { animation: fade-in 220ms ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.center-screen {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #dfe5ed;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-panel {
  min-height: 255px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(110deg, rgba(18, 38, 67, 0.98), rgba(32, 61, 102, 0.96)),
    #142744;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
  overflow: hidden;
  position: relative;
}
.hero-panel .eyebrow { color: #ffb84b; }
.hero-panel h2 { max-width: 760px; }
.hero-copy {
  color: rgba(255, 255, 255, 0.78);
  max-width: 740px;
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 0;
}
.hero-art { position: relative; min-height: 160px; }
.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}
.orbit-one { width: 245px; height: 245px; }
.orbit-two { width: 155px; height: 155px; border-color: rgba(255, 153, 0, 0.45); }
.cloud-chip {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 98px;
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffae32, #ff8a00);
  display: grid;
  place-items: center;
  color: #172033;
  font-weight: 900;
  font-size: 1.45rem;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.23);
}
.cloud-chip::before, .cloud-chip::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-chip::before { width: 48px; height: 48px; top: -20px; left: 16px; }
.cloud-chip::after { width: 38px; height: 38px; top: -11px; right: 11px; }
.cloud-chip { isolation: isolate; }
.cloud-chip::before, .cloud-chip::after { z-index: -1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.stat-card, .panel, .question-panel, .navigator-panel, .result-stat, .review-card {
  background: var(--panel);
  border: 1px solid rgba(214, 222, 232, 0.9);
  box-shadow: 0 12px 34px rgba(27, 46, 76, 0.065);
}
.stat-card {
  border-radius: var(--radius-md);
  padding: 23px 25px;
  display: grid;
  gap: 6px;
}
.stat-label, .stat-note { color: var(--muted); }
.stat-label { font-size: 0.83rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 2.15rem; letter-spacing: -0.04em; }
.stat-note { font-size: 0.82rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 34px);
}
.primary-panel { border-top: 4px solid var(--orange); }
.panel-heading { justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.panel-copy { color: var(--muted); line-height: 1.65; margin: -12px 0 22px; }
.step-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff0d8;
  color: #9b5b00;
  font-weight: 800;
}
.step-badge.muted { background: #eaf0f7; color: var(--navy-2); }

.stack-form { display: grid; gap: 13px; }
.field-label { font-weight: 750; margin-top: 4px; }
.input-with-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  overflow: hidden;
}
.input-with-suffix:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.14); }
.input-with-suffix input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 14px 16px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}
.input-with-suffix span { padding: 0 16px; color: var(--muted); font-size: 0.9rem; }
.exam-notes { display: flex; gap: 8px; flex-wrap: wrap; margin: 5px 0 8px; }
.exam-notes span {
  background: var(--soft);
  color: #526078;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 650;
}

.button {
  min-height: 43px;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button-primary { background: var(--orange); color: #1f2632; box-shadow: 0 9px 22px rgba(255, 153, 0, 0.23); }
.button-primary:hover:not(:disabled) { background: #ffad2e; }
.button-secondary { background: var(--navy); color: #fff; }
.button-secondary:hover:not(:disabled) { background: var(--navy-2); }
.button-ghost { background: #eef2f7; color: var(--navy); border: 1px solid #d8e0ea; }
.button-danger { background: #fbe8eb; color: #a32636; border: 1px solid #f2c7cd; }
.button-wide { width: 100%; margin-top: 7px; }

.file-drop {
  min-height: 112px;
  border: 1.5px dashed #b8c4d3;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.file-drop:hover, .file-drop.dragging { border-color: var(--orange); background: #fff9ef; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop strong, .file-drop small { display: block; }
.file-drop small { color: var(--muted); margin-top: 3px; }
.file-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fde9ec;
  color: #a52d3c;
  font-size: 0.75rem;
  font-weight: 900;
}

.radio-card-group {
  border: 0;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radio-card-group legend { font-weight: 750; margin-bottom: 9px; }
.radio-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.radio-card:has(input:checked) { border-color: var(--orange); background: #fff9ee; }
.radio-card small { display: block; color: var(--muted); margin-top: 2px; }

.import-result {
  margin-top: 18px;
  border-radius: 12px;
  padding: 14px 15px;
  background: #eaf7f4;
  border: 1px solid #c4e7df;
  color: #0c665f;
  line-height: 1.55;
  font-size: 0.9rem;
}
.import-result.warning { background: #fff5e4; border-color: #f4d69f; color: #83530a; }

.history-panel { margin-top: 22px; }
.empty-state { color: var(--muted); padding: 18px 0 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid #e7ebf0; text-align: left; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
td { font-size: 0.92rem; }
.table-action { background: transparent; color: #345f99; border: 0; font-weight: 800; }

.exam-topbar, .results-hero {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 25px 29px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
}
.exam-topbar .eyebrow, .results-hero .eyebrow { color: #ffb545; }
.exam-topbar h2 { font-size: 1.65rem; margin-bottom: 0; }
.exam-metrics { gap: 10px; }
.metric-pill {
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.13);
}
.metric-pill span, .metric-pill strong { display: block; }
.metric-pill span { color: rgba(255,255,255,.68); font-size: 0.75rem; }
.metric-pill strong { margin-top: 3px; font-size: 1.05rem; }
.timer-pill.warning { background: rgba(197, 59, 74, 0.22); border-color: rgba(255, 151, 163, 0.55); }

.progress-track {
  height: 8px;
  border-radius: 99px;
  background: #dfe5ed;
  overflow: hidden;
  margin: 17px 5px 22px;
}
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), #ffc45f); transition: width 180ms ease; }

.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}
.question-panel, .navigator-panel { border-radius: var(--radius-lg); }
.question-panel { padding: clamp(24px, 4vw, 40px); min-height: 550px; }
.navigator-panel { padding: 24px; position: sticky; top: 105px; }
.question-meta-row { justify-content: space-between; gap: 20px; }
.question-kicker {
  display: block;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.selection-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 0.88rem; }
.flag-button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
}
.flag-button.active { color: #7754af; background: #f2edfb; border-color: #d8c9ef; }
.question-text {
  font-size: clamp(1.16rem, 2vw, 1.45rem);
  line-height: 1.58;
  margin: 28px 0 24px;
}
.answer-options { display: grid; gap: 12px; }
.answer-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  background: #fff;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.answer-option:hover { border-color: #aebacd; transform: translateY(-1px); }
.answer-option.selected { border-color: var(--orange); background: #fff9ef; }
.answer-option input { position: absolute; opacity: 0; }
.option-key {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2f7;
  color: var(--navy);
  font-weight: 900;
}
.answer-option.selected .option-key { background: var(--orange); color: #202631; }
.option-copy { line-height: 1.55; padding-top: 4px; }
.save-status { min-height: 22px; margin: 14px 0 0; color: var(--muted); font-size: 0.83rem; }
.save-status.error { color: var(--red); }
.question-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

.navigator-heading { justify-content: space-between; gap: 12px; align-items: flex-start; }
.navigator-heading .button { min-height: 38px; padding: 8px 11px; font-size: 0.82rem; }
.legend-row { display: flex; gap: 11px; flex-wrap: wrap; color: var(--muted); font-size: 0.72rem; margin: 18px 0; }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: #d7dee8; }
.legend-dot.answered { background: var(--teal); }
.legend-dot.flagged { background: var(--purple); }
.legend-dot.current { background: var(--orange); }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.question-jump {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  position: relative;
}
.question-jump.answered { background: #e8f6f2; border-color: #b8dfd4; color: #0c6d64; }
.question-jump.flagged::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  position: absolute;
  top: 5px;
  right: 5px;
}
.question-jump.current { outline: 3px solid rgba(255,153,0,.26); border-color: var(--orange); }

.results-hero { justify-content: flex-start; padding: clamp(30px, 5vw, 52px); }
.results-hero h2 { margin-bottom: 10px; }
.results-hero .hero-copy { max-width: 620px; }
.score-ring {
  --score: 0deg;
  width: 170px;
  height: 170px;
  flex: 0 0 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--orange) var(--score), rgba(255,255,255,.16) 0);
  position: relative;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: var(--navy);
}
.score-ring > div { position: relative; text-align: center; }
.score-ring strong, .score-ring span { display: block; }
.score-ring strong { font-size: 2.25rem; }
.score-ring span { color: rgba(255,255,255,.68); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .12em; }
.result-actions { gap: 11px; margin-top: 20px; }

.result-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0 30px; }
.result-stat { border-radius: var(--radius-md); padding: 20px 22px; }
.result-stat span { display: block; color: var(--muted); font-size: .82rem; }
.result-stat strong { display: block; font-size: 1.85rem; margin-top: 5px; }
.review-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 15px; }
.filter-note { color: var(--muted); font-size: .86rem; }
.review-list { display: grid; gap: 15px; }
.review-card { border-radius: var(--radius-md); overflow: hidden; }
.review-card.correct { border-left: 5px solid var(--green); }
.review-card.incorrect { border-left: 5px solid var(--red); }
.review-card summary {
  list-style: none;
  cursor: pointer;
  padding: 19px 21px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
}
.review-card summary::-webkit-details-marker { display: none; }
.review-number {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  font-weight: 850;
}
.review-question { line-height: 1.5; font-weight: 700; }
.result-chip { border-radius: 999px; padding: 6px 9px; font-size: .74rem; font-weight: 850; }
.result-chip.correct { background: #e4f5ee; color: #176b4b; }
.result-chip.incorrect { background: #fbe8eb; color: #9d2c3a; }
.review-content { padding: 0 21px 22px 66px; }
.review-options { display: grid; gap: 8px; margin-bottom: 17px; }
.review-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  line-height: 1.5;
}
.review-option.correct-answer { border-color: #9ed1bd; background: #ecf8f3; }
.review-option.wrong-selection { border-color: #e6aeb6; background: #fdf0f2; }
.review-option .option-key-inline { font-weight: 900; margin-right: 7px; }
.review-option .answer-label { float: right; font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.explanation-box {
  background: #f5f8fc;
  border: 1px solid #e0e6ee;
  border-radius: 12px;
  padding: 15px 16px;
  white-space: pre-wrap;
  line-height: 1.62;
  color: #43516a;
}
.explanation-box strong { display: block; color: var(--navy); margin-bottom: 7px; }

.confirm-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(440px, calc(100% - 34px));
  box-shadow: 0 30px 90px rgba(16, 30, 53, 0.27);
}
.confirm-dialog::backdrop { background: rgba(13, 25, 44, 0.58); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: 30px; text-align: center; }
.confirm-dialog p { color: var(--muted); line-height: 1.6; }
.dialog-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  background: #fff1db;
  color: #9b5b00;
  font-size: 1.45rem;
  font-weight: 900;
}
.dialog-actions { justify-content: center; gap: 10px; margin-top: 22px; }

.toast-region {
  position: fixed;
  right: 20px;
  top: 96px;
  display: grid;
  gap: 10px;
  z-index: 100;
  width: min(390px, calc(100% - 40px));
}
.toast {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy-2);
  border-radius: 12px;
  padding: 13px 15px;
  box-shadow: 0 16px 42px rgba(17, 33, 57, 0.18);
  line-height: 1.45;
  animation: toast-in 180ms ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }

@media (max-width: 980px) {
  .hero-panel { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .exam-layout { grid-template-columns: 1fr; }
  .navigator-panel { position: static; }
  .question-grid { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 720px) {
  .app-header { padding: 12px 16px; }
  .local-badge { display: none; }
  .page-shell { width: min(100% - 24px, 1240px); margin-top: 20px; }
  .hero-panel { padding: 28px 22px; }
  .stats-grid, .result-stats-grid { grid-template-columns: 1fr 1fr; }
  .exam-topbar { align-items: flex-start; flex-direction: column; }
  .exam-metrics { width: 100%; }
  .metric-pill { flex: 1; }
  .question-meta-row { align-items: flex-start; flex-direction: column; }
  .question-grid { grid-template-columns: repeat(6, 1fr); }
  .results-hero { flex-direction: column; text-align: center; }
  .result-actions { justify-content: center; flex-wrap: wrap; }
  .review-toolbar { align-items: flex-start; flex-direction: column; }
  .review-card summary { grid-template-columns: auto minmax(0, 1fr); }
  .review-card summary .result-chip { grid-column: 2; justify-self: start; }
  .review-content { padding-left: 21px; }
}

@media (max-width: 480px) {
  .brand-wrap .eyebrow { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .stats-grid, .result-stats-grid { grid-template-columns: 1fr; }
  .radio-card-group { grid-template-columns: 1fr; }
  .question-grid { grid-template-columns: repeat(5, 1fr); }
  .question-actions { flex-direction: column-reverse; }
  .question-actions .button { width: 100%; }
}

/* Version 3: authentication and in-exam answer reveal */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
}
.user-chip small,
.user-chip strong {
  display: block;
  line-height: 1.2;
}
.user-chip small {
  color: var(--muted);
  font-size: 0.67rem;
  margin-bottom: 2px;
}
.user-chip strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}
.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
  font-weight: 900;
}
.logout-button {
  min-height: 40px;
  padding: 8px 12px;
}

.auth-layout {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  align-items: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(214, 222, 232, 0.9);
  background: #fff;
}
.auth-hero {
  padding: clamp(38px, 7vw, 78px);
  color: #fff;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 153, 0, 0.27), transparent 18rem),
    linear-gradient(135deg, #122642 0%, #213e67 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-hero .eyebrow { color: #ffb84b; }
.auth-hero h2 { max-width: 690px; }
.auth-hero > p:not(.eyebrow) {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.75;
  font-size: 1.02rem;
}
.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.auth-feature-grid span {
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}
.auth-feature-grid strong,
.auth-feature-grid small {
  display: block;
}
.auth-feature-grid strong { margin-bottom: 7px; }
.auth-feature-grid small {
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}
.auth-card {
  padding: clamp(26px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 24px;
  border-radius: 13px;
  background: #edf2f7;
}
.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.auth-tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 5px 16px rgba(24, 42, 69, 0.11);
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-form h3 { margin-bottom: 6px; }
.text-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: #fbfcfe;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.text-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.14);
}
.field-help {
  color: var(--muted);
  line-height: 1.45;
  margin-top: -6px;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.88rem;
  margin: 4px 0;
}
.checkbox-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--orange);
}
.auth-message {
  margin: 0 0 18px;
  padding: 12px 13px;
  border: 1px solid #c8ddeb;
  border-radius: 10px;
  background: #eef7fc;
  color: #315f7b;
  line-height: 1.5;
  font-size: 0.88rem;
}
.auth-message.warning {
  border-color: #edd6a8;
  background: #fff6e6;
  color: #7f550d;
}
.auth-message.error {
  border-color: #efc3ca;
  background: #fdf0f2;
  color: #9d2c3a;
}

.question-meta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.answer-toggle-button {
  border: 1px solid #bfd9d3;
  background: #edf8f5;
  color: #126b61;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 750;
}
.answer-toggle-button:hover:not(:disabled) {
  background: #e1f3ee;
  border-color: #93c8bc;
}
.answer-toggle-button.active {
  background: #dff3ec;
  border-color: #86c2b3;
  color: #0d665b;
}
.answer-toggle-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.answer-option.correct-revealed {
  border-color: #70bc9d;
  background: #eaf8f2;
  box-shadow: 0 0 0 2px rgba(28, 139, 93, 0.09);
}
.answer-option.correct-revealed .option-key {
  background: var(--green);
  color: #fff;
}
.option-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.option-text {
  min-width: 0;
}
.correct-answer-badge {
  flex: 0 0 auto;
  margin-top: -1px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #d6f0e4;
  color: #176b4b;
  font-size: 0.69rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.revealed-answer-note {
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px solid #abd5c5;
  border-radius: 12px;
  background: #edf8f4;
  color: #185f4a;
  line-height: 1.5;
}
.revealed-answer-note small {
  display: block;
  margin-top: 3px;
  color: #4d7569;
}

@media (max-width: 1040px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { padding: 42px; }
  .auth-card { padding: 34px; }
}

@media (max-width: 720px) {
  .header-actions { gap: 7px; }
  .user-chip small { display: none; }
  .user-chip { padding-right: 7px; }
  .user-chip strong { max-width: 92px; }
  .logout-button { font-size: 0.78rem; padding: 7px 9px; }
  .auth-layout { min-height: auto; }
  .auth-hero { padding: 32px 24px; }
  .auth-card { padding: 26px 22px; }
  .auth-feature-grid { grid-template-columns: 1fr; }
  .auth-feature-grid span { min-height: auto; }
  .question-meta-actions { width: 100%; justify-content: flex-start; }
  .answer-toggle-button,
  .flag-button { flex: 1; }
  .option-copy { flex-direction: column; gap: 8px; }
}

@media (max-width: 520px) {
  .user-chip strong { display: none; }
  .user-chip { padding: 5px; }
  .auth-tabs { grid-template-columns: 1fr; }
  .question-meta-actions { flex-direction: column; }
  .answer-toggle-button,
  .flag-button { width: 100%; }
}
