:root {
  --bg: #f3f7f8;
  --surface: #ffffff;
  --surface-soft: #edf6f4;
  --primary: #166d8f;
  --primary-dark: #0d506d;
  --accent: #2f9e7e;
  --text: #18313d;
  --muted: #5e7280;
  --border: #d8e5e8;
  --correct: #197c54;
  --correct-bg: #e6f5ee;
  --incorrect: #b42335;
  --incorrect-bg: #fbe8eb;
  --skipped: #9a6700;
  --skipped-bg: #fff4d8;
  --shadow: 0 20px 60px rgba(24, 49, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(22, 109, 143, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(47, 158, 126, 0.14), transparent 38%),
    var(--bg);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: calc(100vh - 86px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 42px 0 24px;
}

.screen {
  display: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

.screen.is-active {
  display: block;
  animation: fadeSlide 280ms ease both;
}

.intro-screen {
  max-width: 820px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin: 0 auto 30px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.subtitle {
  max-width: 650px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.primary-btn,
.secondary-btn {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-btn {
  color: #ffffff;
  background: var(--primary);
}

.primary-btn:hover:not(:disabled),
.primary-btn:focus-visible:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

.secondary-btn {
  color: var(--primary-dark);
  background: #ffffff;
  border: 1px solid var(--border);
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.assessment-header,
.summary-header,
.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.progress-meta {
  min-width: 180px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.progress-track {
  width: 180px;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4edf0;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 260ms ease;
}

.question-card {
  min-height: 390px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
}

.question-card.is-changing {
  animation: cardChange 240ms ease both;
}

.question-text {
  margin-bottom: 24px;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.45;
}

.options-list {
  display: grid;
  gap: 12px;
}

.option-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 12px 16px;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 170ms ease, background-color 170ms ease, transform 170ms ease;
}

.option-btn:hover,
.option-btn:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.option-btn.is-selected {
  border-color: var(--primary);
  background: #eaf5f8;
  box-shadow: inset 4px 0 0 var(--primary);
}

.option-letter {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--surface-soft);
  font-weight: 800;
}

.option-btn.is-selected .option-letter {
  color: #ffffff;
  background: var(--primary);
}

.question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-item {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.summary-item.correct {
  background: var(--correct-bg);
  border-color: rgba(25, 124, 84, 0.25);
}

.summary-item.incorrect {
  background: var(--incorrect-bg);
  border-color: rgba(180, 35, 53, 0.2);
}

.summary-item.skipped {
  background: var(--skipped-bg);
  border-color: rgba(154, 103, 0, 0.2);
}

.summary-label {
  display: block;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  font-size: 2rem;
}

.score-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding: 18px 20px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary-dark);
}

.score-panel p {
  margin: 0;
  font-weight: 700;
}

.score-panel strong {
  font-size: 2rem;
}

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

.review-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.review-card.is-correct {
  border-left: 5px solid var(--correct);
}

.review-card.is-incorrect,
.review-card.is-skipped {
  border-left: 5px solid var(--incorrect);
}

.review-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.review-status.correct {
  color: var(--correct);
  background: var(--correct-bg);
}

.review-status.incorrect {
  color: var(--incorrect);
  background: var(--incorrect-bg);
}

.review-status.skipped {
  color: var(--skipped);
  background: var(--skipped-bg);
}

.review-question {
  margin-bottom: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.answer-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.answer-row span {
  color: var(--muted);
  font-weight: 700;
}

.answer-row strong {
  color: var(--text);
}

.answer-row.correct-answer strong {
  color: var(--correct);
}

.disclaimer {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 26px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

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

@keyframes cardChange {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(22, 109, 143, 0.1), transparent 260px),
      var(--bg);
  }

  .app-shell {
    width: 100%;
    min-height: calc(100vh - 112px);
    padding: 0;
    place-items: stretch;
  }

  .screen {
    min-height: calc(100vh - 112px);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 22px 16px;
  }

  .intro-screen.is-active {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  h1 {
    margin-bottom: 28px;
    font-size: 2.15rem;
    line-height: 1.12;
  }

  .assessment-header,
  .summary-header,
  .review-header,
  .score-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-meta,
  .progress-track {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .question-card {
    min-height: auto;
    padding: 18px 14px;
  }

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

  .question-actions {
    flex-direction: column-reverse;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .answer-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .disclaimer {
    width: calc(100% - 28px);
    padding-bottom: 18px;
    font-size: 0.78rem;
  }
}

@media (max-width: 460px) {
  .screen {
    padding: 18px 12px;
  }

  .eyebrow {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 1.28rem;
  }

  .question-text {
    margin-bottom: 18px;
    font-size: 1.08rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .summary-item {
    min-height: 96px;
    padding: 14px 12px;
  }

  .summary-label {
    min-height: 34px;
    font-size: 0.78rem;
  }

  .summary-item strong {
    font-size: 1.65rem;
  }

  .option-btn {
    grid-template-columns: 32px 1fr;
    min-height: 54px;
    padding: 12px;
  }

  .option-letter {
    width: 30px;
    height: 30px;
  }
}
