:root {
  --ink: #16202a;
  --muted: #5e6a75;
  --line: #d9e3e7;
  --paper: #fbfcfd;
  --white: #ffffff;
  --navy: #003e58;
  --blue: #13a8e8;
  --orange: #ff6a13;
  --teal: #007d9d;
  --soft: #edf8fc;
  --success: #16794c;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 20px 60px rgba(18, 32, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.sim-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(217, 227, 231, 0.9);
  backdrop-filter: blur(14px);
}

.brand,
.sim-nav {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 178px;
  height: auto;
}

.sim-nav {
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.sim-nav a:hover {
  color: var(--navy);
}

.sim-shell {
  min-height: calc(100vh - 88px);
}

.lead-screen {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.62fr);
  gap: 42px;
  align-items: center;
  padding: clamp(36px, 6vw, 86px) clamp(20px, 5vw, 72px);
  background:
    linear-gradient(120deg, rgba(0, 62, 88, 0.1), rgba(19, 168, 232, 0.12)),
    var(--paper);
}

.lead-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 3.3vw, 3rem);
  line-height: 1.05;
}

.lead-copy p {
  max-width: 680px;
  color: #35444f;
  font-size: 1.16rem;
}

.exam-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 650px;
  margin: 34px 0 0;
}

.exam-facts div,
.lead-card,
.question-map,
.question-panel,
.score-card,
.breakdown-card,
.review-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.exam-facts div {
  padding: 20px;
}

.exam-facts dt {
  font-size: 2rem;
  font-weight: 950;
}

.exam-facts dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.lead-card {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 38px);
}

.lead-card p {
  color: var(--muted);
}

.lead-card label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.lead-card input[type="text"],
.lead-card input:not([type]) {
  width: 100%;
}

.lead-card input {
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-label {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700 !important;
}

.check-label input {
  min-height: 18px;
  margin-top: 4px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
}

.button.primary {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 12px 24px rgba(0, 62, 88, 0.24);
}

.button.secondary {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

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

.fine-print,
.form-error {
  margin: 0;
  font-size: 0.88rem;
}

.form-error {
  min-height: 20px;
  color: var(--danger) !important;
  font-weight: 800;
}

.exam-screen,
.results-screen,
.review-screen {
  padding: 34px clamp(20px, 4vw, 56px) 56px;
}

.exam-topbar,
.review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.exam-topbar h1,
.review-heading h1,
.results-screen h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
}

.timer {
  min-width: 148px;
  padding: 14px 18px;
  color: var(--white);
  text-align: center;
  background: var(--navy);
  border-radius: 8px;
}

.timer span {
  display: block;
  font-size: 1.8rem;
  font-weight: 950;
  line-height: 1;
}

.timer small {
  color: #c9e9e7;
  font-weight: 800;
}

.exam-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.question-map,
.question-panel {
  padding: 22px;
}

.question-map {
  padding: 16px;
  box-shadow: none;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.map-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  gap: 6px;
  justify-content: start;
}

.map-button {
  min-height: 32px;
  padding: 4px 6px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
}

.map-button.current {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.map-button.answered:not(.current) {
  border-color: rgba(22, 121, 76, 0.45);
  background: #eaf7f0;
}

.map-button.flagged:not(.current) {
  border-color: rgba(154, 103, 0, 0.5);
  background: #fff6dd;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.legend span,
.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.answered {
  background: var(--success);
}

.dot.flagged {
  background: var(--warning);
}

.dot.current {
  background: var(--navy);
}

.question-meta {
  justify-content: space-between;
  margin-bottom: 18px;
}

.question-meta span {
  padding: 6px 10px;
  color: var(--navy);
  background: var(--soft);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flag-button {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--warning);
  background: #fff6dd;
  border: 1px solid #f3d48a;
  border-radius: 8px;
  font-weight: 900;
}

.flag-button.active {
  color: var(--white);
  background: var(--warning);
  border-color: var(--warning);
}

.question-panel h2 {
  max-width: 980px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.question-help {
  color: var(--muted);
  font-weight: 750;
}

.choice-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 64px;
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice:hover,
.choice.selected {
  border-color: var(--blue);
  background: #eefafa;
}

.choice-marker {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 950;
}

.choice.selected .choice-marker {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.exam-actions {
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
}

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

#submit-button {
  grid-column: 3;
  justify-self: end;
}

.submit-status,
.submit-warning {
  color: var(--danger);
  font-weight: 900;
}

.submit-status {
  min-height: 24px;
  margin: 14px 0 0;
}

.results-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 0.55fr);
  gap: 24px;
  align-items: stretch;
}

.score-card,
.breakdown-card {
  padding: clamp(24px, 4vw, 42px);
}

.score-card p {
  color: var(--muted);
  font-size: 1.08rem;
}

.score-ring {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  margin: 28px 0;
  color: var(--navy);
  background:
    radial-gradient(circle at center, var(--white) 58%, transparent 59%),
    conic-gradient(var(--blue) var(--score-angle, 0deg), #d9e3e7 0);
  border-radius: 999px;
}

.score-ring span {
  font-size: 2.2rem;
  font-weight: 950;
}

.domain-breakdown {
  display: grid;
  gap: 16px;
}

.domain-row {
  display: grid;
  gap: 8px;
}

.domain-row strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar {
  overflow: hidden;
  height: 12px;
  background: #e9eef1;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.review-screen {
  max-width: 1180px;
  margin: 0 auto;
}

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

.review-item {
  padding: 24px;
}

.review-item.correct {
  border-left: 6px solid var(--success);
}

.review-item.incorrect {
  border-left: 6px solid var(--danger);
}

.review-item h2 {
  font-size: 1.3rem;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  padding: 5px 9px;
  background: var(--soft);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pill.good {
  color: var(--success);
  background: #eaf7f0;
}

.pill.bad {
  color: var(--danger);
  background: #fff0ee;
}

.answer-review {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.answer-review div {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.answer-review .right {
  border-color: rgba(22, 121, 76, 0.45);
  background: #eaf7f0;
}

.answer-review .wrong {
  border-color: rgba(180, 35, 24, 0.38);
  background: #fff0ee;
}

.explanation {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 960px) {
  .sim-header,
  .exam-topbar,
  .review-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: 150px;
  }

  .sim-nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .lead-screen,
  .exam-layout,
  .results-screen {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {
  h1 {
    font-size: 3rem;
  }

  .exam-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lead-screen,
  .exam-screen,
  .results-screen,
  .review-screen {
    padding-top: 30px;
    padding-bottom: 38px;
  }

  .exam-actions {
    grid-template-columns: 1fr;
  }

  .step-actions {
    grid-column: 1;
  }

  #submit-button {
    grid-column: 1;
    justify-self: end;
  }

  .timer {
    width: 100%;
  }
}
