:root {
  --blue: #183B5B;
  --red: #B8433C;
  --green: #5D7C5B;
  --beige: #F5F1EB;
  --gray: #F7F8FA;
  --ink: #18232E;
  --muted: #66717B;
  --line: rgba(24, 59, 91, 0.14);
  --white: #FFFFFF;
  --blue-soft: #EEF5FB;
  --red-soft: #F9EBE9;
  --green-soft: #EDF3EC;
  --shadow: 0 22px 60px rgba(24, 35, 46, 0.12);
  --soft-shadow: 0 14px 36px rgba(24, 35, 46, 0.08);
  --container: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(245, 241, 235, 0.98) 0%, rgba(247, 248, 250, 0.98) 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(184, 67, 60, 0.58);
  outline-offset: 4px;
}

.test-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 8px max(18px, calc((100vw - var(--container)) / 2));
  border-bottom: 1px solid rgba(24, 59, 91, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.test-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.test-brand img {
  width: min(300px, 58vw);
  height: 78px;
  object-fit: contain;
  object-position: left center;
}

.site-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: var(--white);
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(24, 59, 91, 0.08);
}

.site-return svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-main {
  padding: 30px 16px 56px;
}

.test-shell {
  width: min(100%, var(--container));
  margin: 0 auto;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.test-shell.is-fading {
  opacity: 0;
  transform: translateY(8px);
}

.screen-card,
.activity-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.screen-card {
  padding: clamp(24px, 5vw, 48px);
}

.intro-card {
  overflow: hidden;
  position: relative;
}

.intro-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--green));
}

.intro-logo {
  width: min(300px, 78vw);
  margin-bottom: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 14px;
  color: var(--red);
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: clamp(2.15rem, 8vw, 4.45rem);
}

h2 {
  color: var(--blue);
  font-size: clamp(1.75rem, 5vw, 2.9rem);
}

h3 {
  color: var(--ink);
  font-size: clamp(1.18rem, 3vw, 1.55rem);
}

p {
  margin-top: 0;
}

.lead-text {
  max-width: 760px;
  margin-bottom: 24px;
  color: #3D4A56;
  font-size: clamp(1rem, 2.5vw, 1.16rem);
}

.benefit-grid {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}

.benefit-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(93, 124, 91, 0.18);
  border-radius: 18px;
  background: var(--green-soft);
  color: #263B2B;
  font-weight: 700;
}

.benefit-card span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
}

.integrity-note {
  margin: 28px 0;
  padding: 18px;
  border-left: 5px solid var(--red);
  border-radius: 14px;
  background: var(--red-soft);
  color: #51322F;
  font-weight: 650;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

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

.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, #B8433C 0%, #A93B35 100%);
  box-shadow: 0 18px 38px rgba(184, 67, 60, 0.24);
}

.btn-secondary {
  color: var(--white);
  background: linear-gradient(135deg, #183B5B 0%, #123049 100%);
  box-shadow: 0 18px 38px rgba(24, 59, 91, 0.2);
}

.btn-tertiary {
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(24, 59, 91, 0.08);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label,
.field-label,
.fieldset-label {
  color: #263543;
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.field-group input,
.field-group select,
.field-group textarea {
  min-height: 54px;
  width: 100%;
  border: 1px solid rgba(24, 59, 91, 0.18);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group textarea {
  min-height: 108px;
  padding-block: 14px;
  resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(24, 59, 91, 0.1);
  outline: none;
}

.student-grid {
  display: grid;
  gap: 18px;
}

.choice-fieldset,
.question-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 59, 91, 0.16);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.choice-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.choice-card:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(24, 59, 91, 0.08);
}

.conditional-fields {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(93, 124, 91, 0.2);
  border-radius: 18px;
  background: rgba(237, 243, 236, 0.78);
}

.screen-actions,
.activity-actions,
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.activity-card {
  overflow: hidden;
}

.activity-header {
  padding: clamp(20px, 4vw, 34px);
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(24, 59, 91, 0.98), rgba(24, 59, 91, 0.9)),
    var(--blue);
}

.activity-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.skill-label {
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-count {
  font-weight: 700;
}

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

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #D9A95F, var(--green));
  transition: width 0.28s ease;
}

.activity-body {
  display: grid;
  gap: 24px;
  padding: clamp(20px, 4vw, 36px);
}

.instruction {
  margin: 0;
  color: #354454;
  font-size: 1.04rem;
  font-weight: 700;
}

.reading-card {
  display: grid;
  gap: 14px;
  max-width: 850px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid rgba(24, 59, 91, 0.1);
  border-radius: 20px;
  background: var(--gray);
}

.reading-card h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.reading-card p {
  margin-bottom: 0;
  color: #2F3F4D;
  font-size: clamp(1.03rem, 2.7vw, 1.13rem);
  line-height: 1.86;
}

.questions-list {
  display: grid;
  gap: 20px;
}

.question-card {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid rgba(24, 59, 91, 0.12);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.question-title {
  color: var(--ink);
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: clamp(1rem, 2.8vw, 1.1rem);
  font-weight: 700;
}

.answer-grid {
  display: grid;
  gap: 10px;
}

.answer-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 59, 91, 0.14);
  border-radius: 16px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.answer-option:hover {
  border-color: rgba(24, 59, 91, 0.4);
  transform: translateY(-1px);
}

.answer-option.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(24, 59, 91, 0.09);
}

.answer-key {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  color: var(--blue);
  background: rgba(24, 59, 91, 0.1);
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.answer-option.is-selected .answer-key {
  color: var(--white);
  background: var(--blue);
}

.answer-check {
  margin-left: auto;
  color: var(--green);
  font-weight: 800;
  opacity: 0;
}

.answer-option.is-selected .answer-check {
  opacity: 1;
}

.activity-alert,
.submit-alert {
  min-height: 26px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.summary-grid {
  display: grid;
  gap: 14px;
  margin: 26px 0;
}

.summary-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--gray);
}

.summary-card strong {
  display: block;
  color: var(--blue);
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  line-height: 1;
}

.summary-card span {
  color: var(--muted);
  font-weight: 700;
}

.next-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.next-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  background: var(--green-soft);
  color: #273B2C;
  font-weight: 700;
}

.next-list span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
  font-family: Poppins, Inter, system-ui, sans-serif;
  font-size: 0.86rem;
}

.submit-alert {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--red-soft);
}

.submit-alert:empty {
  display: none;
}

.privacy-note {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: var(--white);
  border-radius: 50%;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.resume-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 35, 46, 0.58);
}

.resume-modal-backdrop[hidden] {
  display: none;
}

.resume-modal {
  width: min(100%, 520px);
  padding: clamp(24px, 5vw, 34px);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
}

.resume-modal h2 {
  margin-bottom: 12px;
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

.resume-modal p {
  color: var(--muted);
}

@media (min-width: 680px) {
  .test-main {
    padding-top: 48px;
  }

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

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

  .field-group.full,
  .choice-fieldset,
  .conditional-fields {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 560px) {
  .test-header {
    min-height: 82px;
  }

  .test-brand img {
    width: min(220px, 54vw);
    height: 62px;
  }

  .site-return span {
    display: none;
  }

  .screen-actions,
  .activity-actions,
  .resume-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .test-shell.is-fading {
    transform: none;
  }
}
