:root {
  --navy: #17365d;
  --navy-dark: #0f2847;
  --blue: #1769aa;
  --blue-light: #e9f3fb;
  --border: #c8d2dc;
  --text: #172331;
  --muted: #5b6875;
  --surface: #ffffff;
  --background: #eef2f5;
  --success: #26734d;
  --success-light: #e7f5ed;
  --danger: #a6342b;
  --danger-light: #fbecea;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.site-header {
  padding: 16px 24px;
  color: white;
  background: var(--navy);
  border-bottom: 5px solid #f0b323;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--navy);
  background: white;
  border-radius: 4px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand div > span {
  font-size: 0.85rem;
  opacity: 0.8;
}

.shell {
  width: min(900px, calc(100% - 32px));
  margin: 48px auto 24px;
}

.card {
  padding: clamp(24px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgb(15 40 71 / 8%);
}

.welcome-screen,
.results-screen {
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  color: var(--navy-dark);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
}

.intro {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.test-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 620px;
  margin: 32px auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.test-summary div {
  padding: 18px 10px;
}

.test-summary div + div {
  border-left: 1px solid var(--border);
}

.test-summary strong,
.test-summary span {
  display: block;
}

.test-summary strong {
  color: var(--navy);
  font-size: 1.35rem;
}

.test-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.button {
  min-height: 48px;
  padding: 11px 24px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.button:focus-visible,
.answer-option:focus-within {
  outline: 3px solid #f0b323;
  outline-offset: 3px;
}

.button-primary {
  color: white;
  background: var(--blue);
}

.button-primary:hover {
  background: #0f578f;
}

.button-secondary {
  color: var(--navy);
  background: white;
  border-color: var(--border);
}

.button-secondary:hover {
  background: #f5f7f9;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.disclaimer {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.test-status {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.test-status > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  background: #dfe5ea;
  border-radius: 10px;
}

#progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 180ms ease;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 32px 0 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 24px;
  color: var(--navy-dark);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  line-height: 1.35;
}

.answer-list {
  display: grid;
  gap: 12px;
}

.question-figure {
  display: flex;
  justify-content: center;
  margin: 0 0 24px;
  padding: 18px;
  background: #f4f6fa;
  border: 1px solid #d8dee9;
  border-radius: 10px;
}

.question-figure[hidden] {
  display: none;
}

.question-figure svg {
  width: 190px;
  height: 190px;
  max-width: 60vw;
}

.review-figure {
  margin: 12px 0 16px;
  padding: 12px;
  background: #fff;
}

.review-figure svg {
  width: 120px;
  height: 120px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px;
  border: 2px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.answer-option:hover {
  border-color: var(--blue);
}

.answer-option.selected {
  background: var(--blue-light);
  border-color: var(--blue);
}

.answer-option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.answer-letter {
  color: var(--navy);
  font-weight: 700;
}

.test-actions,
.result-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.result-actions {
  justify-content: center;
}

.result-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-badge.pass {
  color: var(--success);
  background: var(--success-light);
}

.result-badge.fail {
  color: var(--danger);
  background: var(--danger-light);
}

.result-score {
  margin: 20px 0 4px;
  color: var(--navy);
  font-size: 2rem;
  font-weight: 800;
}

.review-list {
  display: grid;
  gap: 16px;
  margin-top: 36px;
  text-align: left;
}

.review-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--danger);
  border-radius: 4px;
}

.review-item.correct {
  border-left-color: var(--success);
}

.review-item h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.review-item p {
  margin: 5px 0;
}

.review-label {
  color: var(--muted);
  font-weight: 700;
}

.explanation {
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  padding: 12px 24px 28px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .site-header {
    padding: 12px 16px;
  }

  .shell {
    width: min(100% - 20px, 900px);
    margin-top: 20px;
  }

  .card {
    padding: 22px 18px;
  }

  .test-summary {
    grid-template-columns: 1fr;
  }

  .test-summary div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .test-actions,
  .result-actions {
    flex-direction: column-reverse;
  }

  .button {
    width: 100%;
  }
}
