:root {
  color-scheme: light;
  --ink: #2d2d2d;
  --muted: #6e6e77;
  --red: #d31145;
  --red-dark: #b40e3a;
  --red-soft: #fce9f0;
  --navy: #a11042;
  --navy-dark: #7a0c30;
  --gold: #d31145;
  --cream: #f4f4f6;
  --paper: #ffffff;
  --white: #ffffff;
  --line: #ececf0;
  --line-strong: #d8c6ce;
  --focus: #d31145;
  --success: #1d6b46;
  --error: #b42318;
  --shadow: 0 12px 40px rgb(122 12 48 / 10%);
  --radius: 12px;
  --radius-large: 20px;
  font-family: "Sarabun", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
label,
input {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

[tabindex="-1"]:focus {
  outline: none;
}

.site-header {
  display: flex;
  align-items: center;
  width: min(100% - 2rem, 760px);
  min-height: 68px;
  margin-inline: auto;
  border-bottom: 1px solid rgb(161 16 66 / 18%);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.48rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand__name {
  color: var(--navy);
  font-family: "Prompt", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__product {
  color: var(--red);
  font-family: "Prompt", sans-serif;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.header-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-shell {
  width: min(100% - 2rem, 720px);
  min-height: calc(100vh - 170px);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.75rem) 0 4rem;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.45rem, 5vw, 2.25rem);
  border-radius: var(--radius-large);
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--white);
  box-shadow: var(--shadow);
}

.landing-hero::after {
  position: absolute;
  top: -4rem;
  right: -3rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 16%), transparent 70%);
  content: "";
}

.landing-hero > * {
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  color: var(--white);
}

.landing-hero .lead,
.landing-hero .cta-note {
  color: #ffd9e4;
}

.landing-hero .eyebrow {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--red);
  letter-spacing: 0.04em;
}

.landing-hero #start-button {
  background: var(--white);
  color: var(--navy);
}

.landing-hero #start-button:hover {
  background: var(--red-soft);
}

.landing-hero .resume-panel {
  color: var(--ink);
}

.screen {
  animation: enter 180ms ease-out;
}

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

h1,
h2 {
  font-family: "Prompt", sans-serif;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 21ch;
  margin-bottom: 1rem;
  color: var(--navy);
  font-size: clamp(2rem, 8vw, 3.5rem);
}

h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.18rem, 4vw, 1.45rem);
}

.eyebrow {
  margin-bottom: 0.6rem;
  color: var(--red);
  font-size: 0.76rem;
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.lead {
  max-width: 52ch;
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 3.4vw, 1.22rem);
}

.risk-preview {
  display: grid;
  gap: 0.7rem;
  margin: 1.5rem 0;
}

.risk-preview article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.05rem 0.75rem;
  align-items: center;
  min-height: 76px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.risk-preview__number {
  grid-row: 1 / span 2;
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.risk-preview strong {
  line-height: 1.35;
}

.risk-preview article > span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.question-pivot {
  margin: 1.5rem 0;
  padding: clamp(1.1rem, 4vw, 1.45rem);
  border-left: 5px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.question-pivot p {
  margin-bottom: 0.5rem;
}

.question-pivot p:last-child {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 1.08rem;
}

del {
  color: var(--muted);
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.78rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.button--primary {
  background: var(--navy);
  color: var(--white);
}

.button--primary:hover:not(:disabled) {
  background: var(--navy-dark);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--navy);
}

.button--ghost {
  border-color: rgb(255 255 255 / 55%);
  background: transparent;
  color: var(--white);
}

.button--line {
  background: #06c755;
  color: #103621;
}

.button--line:hover {
  background: #04b94d;
}

.button--full {
  width: 100%;
}

.button-row,
.question-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.75rem;
}

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

.cta-note,
.privacy-line,
.budget-note,
.copy-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.cta-note {
  margin: 0.65rem 0 0;
  text-align: center;
}

.scope-note,
.resume-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.scope-note h2 {
  font-size: 1rem;
}

.scope-note p,
.resume-panel p {
  margin-bottom: 0.65rem;
}

.scope-note p:last-child,
.resume-panel p:last-child {
  margin-bottom: 0;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.save-status,
.education-badge {
  color: var(--success);
  font-size: 0.78rem;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--line);
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--line);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--navy);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--navy);
}

.question-card {
  padding: clamp(1.1rem, 4vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--paper);
  box-shadow: var(--shadow);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  display: block;
  width: 100%;
  margin-bottom: 0.55rem;
  color: var(--navy);
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.question-hint {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.answer-options {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}

.answer-option {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0.2rem 0.75rem;
  min-height: 58px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}

.answer-option:hover {
  border-color: var(--red);
}

.answer-option:has(input:checked) {
  border: 2px solid var(--navy);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgb(161 16 66 / 8%);
}

.answer-option input {
  grid-row: 1 / span 2;
  width: 21px;
  height: 21px;
  margin: 0.15rem 0 0;
  accent-color: var(--navy);
}

.answer-option__label {
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  line-height: 1.45;
}

.answer-option__detail {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.field-error {
  margin: -0.45rem 0 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #fef3f2;
  color: var(--error);
  font-weight: 700;
}

#education-title {
  max-width: 23ch;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
}

.education-grid {
  display: grid;
  gap: 0.85rem;
  margin: 1.35rem 0;
}

.education-card {
  padding: clamp(1.1rem, 4vw, 1.45rem);
  border: 1px solid var(--line);
  border-top: 5px solid var(--navy);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.education-card:nth-child(2) {
  border-top-color: var(--gold);
}

.education-card__label {
  margin-bottom: 0.25rem;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.education-card p:last-child,
.education-card ul:last-child {
  margin-bottom: 0;
}

.education-card ul {
  padding-left: 1.25rem;
}

.education-highlight {
  margin: 1rem 0 1.3rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 850;
  text-align: center;
}

.result-hero {
  margin-bottom: 1rem;
  padding: clamp(1.35rem, 5vw, 2rem);
  border-radius: var(--radius-large);
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--white);
  box-shadow: var(--shadow);
}

.result-hero h1,
.result-hero .eyebrow {
  color: var(--white);
}

.result-hero h1 {
  font-size: clamp(1.9rem, 7vw, 3rem);
}

.result-summary {
  margin-bottom: 1rem;
  font-size: clamp(1.08rem, 3.6vw, 1.28rem);
}

.confidence-badge {
  display: inline-flex;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  font-size: 0.83rem;
  font-weight: 750;
}

.result-stack {
  display: grid;
  gap: 0.85rem;
}

.result-section {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.85rem;
  padding: clamp(1.1rem, 4vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.result-section__number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 900;
}

.result-section p:last-child,
.result-section ul:last-child,
.result-section ol:last-child {
  margin-bottom: 0;
}

.result-list {
  margin: 0;
  padding-left: 1.2rem;
}

.result-list li + li {
  margin-top: 0.5rem;
}

.result-section--accent {
  border-color: rgb(211 17 69 / 38%);
  background: #fff5f8;
}

.result-section--cta {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--white);
}

.result-section--cta h2 {
  color: var(--white);
}

.result-section--cta .result-section__number {
  background: var(--white);
}

.result-section--cta .button + .button {
  margin-top: 0.7rem;
}

.result-section--cta .cta-note,
.result-section--cta .copy-status {
  color: rgb(255 255 255 / 86%);
}

.advisor {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.85rem;
  align-items: center;
  margin: 0.25rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 9%);
}

.advisor__photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.advisor p {
  margin: 0;
}

.advisor strong,
.advisor span {
  display: block;
}

.advisor strong {
  color: var(--white);
  font-family: "Prompt", sans-serif;
  font-size: 1.05rem;
}

.advisor span {
  color: rgb(255 255 255 / 86%);
  font-size: 0.9rem;
}

.result-disclaimer {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
}

.text-button {
  display: block;
  min-height: 48px;
  margin: 1.25rem auto 0;
  padding: 0.6rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.site-footer {
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--navy);
  font-family: "Prompt", sans-serif;
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 30;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--error);
  color: var(--white);
  text-align: center;
}

@media (min-width: 640px) {
  .risk-preview,
  .education-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .risk-preview article {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .risk-preview__number {
    grid-row: auto;
  }

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

@media (max-width: 639px) {
  .question-screen--multi {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .question-screen--multi #multi-actions {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgb(244 244 246 / 96%);
    box-shadow: 0 -10px 30px rgb(122 12 48 / 10%);
    backdrop-filter: blur(8px);
  }

  .question-screen--multi #confirm-multi-button {
    width: min(100% - 1.25rem, 680px);
    margin-inline: auto;
  }
}

@media (max-width: 390px) {
  .site-header {
    width: min(100% - 1.25rem, 760px);
  }

  .header-note {
    font-size: 0.7rem;
  }

  .page-shell {
    width: min(100% - 1.25rem, 720px);
  }

  .question-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .brand__product {
    display: none;
  }
}

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

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}
