:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #637087;
  --line: #dbe2ef;
  --accent: #1b6fbf;
  --accent-dark: #145894;
  --success: #18794e;
  --success-bg: #e8f6ef;
  --error: #b42318;
  --error-bg: #fff0ed;
  --warning: #775a00;
  --focus: #f4c430;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.assessment {
  width: min(960px, 100%);
}

.assessment__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.score-card {
  min-width: 152px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(30, 48, 75, 0.08);
}

.score-card__label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.progress-track {
  height: 10px;
  background: #e7edf6;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.question-panel,
.results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(30, 48, 75, 0.12);
  padding: clamp(22px, 4vw, 40px);
}

.question-panel__topic {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.question-panel h2,
.results h2 {
  margin-bottom: 24px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.answer-list {
  display: grid;
  gap: 18px;
}

#answerOptions {
  display: grid;
  gap: 12px;
}

.answer-option {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  cursor: pointer;
}

.answer-option:hover {
  border-color: #9eb8d5;
}

.answer-option input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.answer-option span {
  line-height: 1.35;
}

.answer-option.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.answer-option.is-incorrect {
  border-color: var(--error);
  background: var(--error-bg);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  border-color: #aab5c4;
  background: #aab5c4;
  cursor: not-allowed;
}

button.secondary {
  background: white;
  color: var(--accent);
}

button.secondary:hover {
  background: #edf5ff;
}

.feedback {
  margin-top: 22px;
  padding: 16px;
  border-radius: 8px;
  line-height: 1.45;
}

.feedback.correct {
  background: var(--success-bg);
  color: var(--success);
}

.feedback.incorrect,
.feedback.warning {
  background: var(--error-bg);
  color: var(--error);
}

.feedback.warning {
  color: var(--warning);
}

.results {
  margin-top: 18px;
}

.results p {
  font-size: 1.15rem;
}

.review-list {
  display: grid;
  gap: 14px;
  margin: 24px 0;
  padding-left: 22px;
}

.review-list li {
  line-height: 1.45;
}

.review-list strong {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 20px 12px;
    place-items: start center;
  }

  .assessment__header {
    align-items: stretch;
    flex-direction: column;
  }

  .score-card {
    width: 100%;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
