:root {
  --blue: #004268;
  --blue-strong: #002f4c;
  --blue-soft: #e9f3f7;
  --blue-tint: #f4f9fb;
  --gold: #c9a652;
  --gold-strong: #aa842d;
  --gold-soft: #fbf3dc;
  --ink: #101c25;
  --muted: #546774;
  --line: #cddbe3;
  --paper: #ffffff;
  --mist: #f3f7f9;
  --success: #2f745d;
  --danger: #9f3030;
  --shadow: 0 24px 70px rgba(0, 47, 76, 0.14);
  --shadow-soft: 0 14px 34px rgba(0, 47, 76, 0.10);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 247, 249, 0.96) 100%),
    radial-gradient(circle at top left, rgba(201, 166, 82, 0.12), transparent 34%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

a {
  color: var(--blue);
}

.topbar {
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand img {
  display: block;
  width: min(190px, 52vw);
  height: auto;
}

.quiz {
  width: 100%;
  min-height: calc(100vh - 70px);
  margin: 0;
  padding: 18px 16px 24px;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.progress {
  margin-bottom: clamp(26px, 7vw, 46px);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.progress-rail {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: #e9f0f3;
  border-radius: 999px;
}

#progressFill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: inherit;
  transition: width 260ms ease;
}

.question-stage {
  position: relative;
  flex: 1;
  will-change: transform, opacity;
}

.question-stage.stage-forward {
  animation: pageForward 540ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

.question-stage.stage-back {
  animation: pageBack 540ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

@keyframes pageForward {
  from {
    opacity: 0;
    transform: translateX(54px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pageBack {
  from {
    opacity: 0;
    transform: translateX(-54px) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-strong);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2 {
  max-width: 820px;
  margin: 0;
  color: var(--blue);
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.55rem, 11vw, 4.25rem);
}

h2 {
  font-size: clamp(2rem, 8vw, 3.1rem);
}

.hero-start {
  display: grid;
  gap: 22px;
  align-content: start;
  min-height: 0;
}

.hero-start .eyebrow {
  color: var(--gold-strong);
  font-size: clamp(0.94rem, 2.5vw, 1.12rem);
  letter-spacing: 0.13em;
}

.hero-start h1 {
  max-width: 780px;
}

.lead {
  max-width: 770px;
  margin: 0;
  color: #172936;
  font-size: clamp(1.04rem, 4.4vw, 1.28rem);
  line-height: 1.55;
}

.small-copy {
  max-width: 740px;
  color: var(--muted);
  line-height: 1.5;
}

.step-guide {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 0;
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px solid rgba(201, 166, 82, 0.34);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(251, 243, 220, 0.9), rgba(244, 249, 251, 0.86));
  color: #203240;
  line-height: 1.45;
  transition: min-height 320ms ease, padding 320ms ease, box-shadow 320ms ease, background-color 320ms ease;
}

.step-guide:focus {
  outline: 3px solid rgba(0, 96, 151, 0.22);
  outline-offset: 3px;
}

.step-guide-body {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
}

.step-guide-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(201, 166, 82, 0.65);
}

.step-guide-icon svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-guide-copy {
  display: grid;
  gap: 5px;
}

.step-guide-text {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 5px;
  border-radius: calc(var(--radius) - 2px);
}

.step-guide-text strong,
.step-guide-text span {
  position: relative;
  z-index: 1;
}

.step-guide-text strong {
  color: var(--blue-strong);
  font-size: 1.06rem;
  line-height: 1.18;
}

.step-guide-text span,
.step-guide-text b {
  color: var(--muted);
  font-size: 0.98rem;
}

.step-guide-text b {
  color: var(--blue-strong);
}

.step-guide-ok {
  display: none;
  justify-self: start;
  min-height: 0;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  padding: 0 20px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  max-height: 0;
  overflow: hidden;
  white-space: normal;
  transition: opacity 180ms ease, transform 180ms ease, max-height 220ms ease, margin-top 220ms ease;
}

.step-guide-ok:focus-visible {
  outline: 3px solid rgba(201, 166, 82, 0.52);
  outline-offset: 3px;
}

.step-guide-attention {
  transform-origin: 50% 50%;
  animation: guideAttention 360ms ease-out 80ms both;
}

@keyframes guideAttention {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.gold-mark {
  color: var(--blue-strong);
  background: linear-gradient(transparent 58%, var(--gold-soft) 58%);
  font-weight: 900;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 2px;
}

.hero-proof span {
  border: 1px solid rgba(170, 132, 45, 0.42);
  border-radius: 999px;
  background: #fff8e8;
  color: #4a390f;
  padding: 8px 11px;
  font-size: 0.85rem;
  font-weight: 900;
}

.field-grid,
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin-top: 26px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--ink);
  font-weight: 900;
}

.field-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.field-control {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid #b9ccd6;
  border-bottom: 3px solid rgba(201, 166, 82, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  box-shadow: 0 8px 24px rgba(0, 47, 76, 0.06);
  padding: 9px 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field-control:focus-within {
  border-color: var(--blue);
  border-bottom-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(0, 66, 104, 0.12), 0 14px 30px rgba(0, 47, 76, 0.10);
  transform: translateY(-1px);
}

.field-control-textarea {
  align-items: start;
}

.field-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(201, 166, 82, 0.72);
}

.field-icon svg,
.choice-icon svg,
.life-category-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 4px 0;
  outline: none;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  padding-top: 7px;
}

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

.choice-intro-locked .step-guide-attention {
  min-height: clamp(168px, 22vw, 214px);
  align-content: center;
  padding: 30px 24px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.96), rgba(236, 248, 253, 0.98));
  box-shadow: 0 0 0 6px rgba(0, 66, 104, 0.08), 0 18px 40px rgba(0, 47, 76, 0.10);
}

.choice-intro-locked .step-guide-body {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
}

.choice-intro-locked .step-guide-icon {
  width: 48px;
  height: 48px;
}

.choice-intro-locked .step-guide-icon svg {
  width: 23px;
  height: 23px;
}

.choice-intro-locked .step-guide-copy {
  gap: 8px;
}

.choice-intro-locked .step-guide-text {
  gap: 8px;
}

.choice-intro-locked .step-guide-text strong {
  font-size: clamp(1.22rem, 2.5vw, 1.38rem);
}

.choice-intro-locked .step-guide-text span,
.choice-intro-locked .step-guide-text b {
  font-size: clamp(1.08rem, 2vw, 1.18rem);
  line-height: 1.48;
}

.choice-intro-locked .step-guide-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: fit-content;
  border-color: var(--blue);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  max-height: 48px;
  margin-top: 12px;
  margin-left: 0;
}

.choice-intro-locked .step-guide-attention ~ .choice-grid,
.choice-intro-locked .step-guide-attention ~ .life-category-tabs,
.choice-intro-locked .step-guide-attention ~ .selected-life-summary,
.choice-intro-locked .step-guide-attention ~ .field-grid {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.choice-intro-revealed .step-guide-attention ~ .choice-grid,
.choice-intro-revealed .step-guide-attention ~ .life-category-tabs,
.choice-intro-revealed .step-guide-attention ~ .selected-life-summary,
.choice-intro-revealed .step-guide-attention ~ .field-grid {
  animation: choicesRevealAfterOk 420ms ease both;
}

@media (max-width: 719px) {
  .step-guide-body,
  .choice-intro-locked .step-guide-body {
    grid-template-columns: 1fr;
  }

  .choice-intro-locked .step-guide-ok {
    margin-left: 0;
  }
}

@keyframes choicesRevealAfterOk {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.choice {
  position: relative;
  min-height: 78px;
  border: 1px solid #bfd0d9;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(201, 166, 82, 0.09), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  color: var(--ink);
  padding: 15px 15px 15px 62px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 8px 20px rgba(0, 47, 76, 0.055);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.choice-icon {
  position: absolute;
  left: 16px;
  top: 17px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 66, 104, 0.13);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.choice-title {
  font-weight: 900;
  line-height: 1.22;
  color: #101b24;
}

.choice-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

@media (hover: hover) {
  .choice:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-soft);
    transform: translateY(-3px);
  }

  .choice:hover .choice-icon {
    background: var(--blue);
    color: #fff;
    transform: scale(1.05);
  }
}

.choice:focus-visible,
.life-category-tab:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(201, 166, 82, 0.52);
  outline-offset: 3px;
}

.choice.is-selected {
  border-color: var(--blue);
  background:
    linear-gradient(90deg, rgba(201, 166, 82, 0.22), rgba(233, 243, 247, 0.96)),
    var(--paper);
  box-shadow: inset 4px 0 0 var(--gold), var(--shadow-soft);
}

.choice.is-selected .choice-icon {
  background: var(--blue);
  color: #fff;
}

.life-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.life-category-tab {
  min-height: 48px;
  border: 1px solid #b8ccd6;
  border-radius: 999px;
  background: #fff;
  color: var(--blue-strong);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.life-category-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.life-category-tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.life-category-tab.is-active .life-category-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.life-category-tab:hover {
  transform: translateY(-1px);
}

.selected-life-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.selected-life-summary span {
  border: 1px solid rgba(0, 66, 104, 0.18);
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--blue-strong);
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 900;
}

.notice {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--gold-soft);
  color: var(--ink);
  line-height: 1.5;
}

.summary {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.summary-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.summary-section h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 1rem;
}

.summary-section p {
  margin: 5px 0;
  color: var(--ink);
  line-height: 1.45;
}

.summary-muted {
  color: var(--muted);
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  line-height: 1.45;
}

.checkline input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.error-message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--danger);
  font-weight: 900;
}

.quiz-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), var(--paper) 45%);
  z-index: 2;
}

.button {
  min-height: 54px;
  min-width: 0;
  flex: 1;
  border-radius: var(--radius);
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.button-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 66, 104, 0.18);
}

.button-primary:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--paper);
  border-color: var(--blue);
  color: var(--blue);
}

.button-secondary:hover {
  background: var(--blue-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.done-actions a {
  text-decoration: none;
}

.legal-links {
  width: min(920px, calc(100vw - 32px));
  margin: 18px auto 28px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--blue);
  text-decoration: underline;
}

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

@media (min-width: 720px) {
  .topbar {
    width: min(920px, calc(100vw - 40px));
    padding: 24px 0 12px;
  }

  .brand img {
    width: min(230px, 40vw);
  }

  .quiz {
    width: min(920px, calc(100vw - 40px));
    min-height: min(720px, calc(100vh - 128px));
    margin: 0 auto 38px;
    padding: clamp(30px, 5vw, 48px);
    border: 1px solid rgba(205, 219, 227, 0.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

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

  .life-category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-guide {
    grid-template-columns: auto 1fr;
    align-items: baseline;
  }

  .quiz-nav {
    position: static;
    margin-top: 30px;
    padding-top: 0;
    background: transparent;
  }

  .button {
    min-width: 168px;
    flex: 0 0 auto;
  }

  .legal-links {
    margin-top: -14px;
  }
}

@media (min-width: 1024px) {
  .topbar,
  .quiz {
    width: min(1080px, calc(100vw - 72px));
  }

  .quiz {
    padding: 48px 56px;
  }

  .progress {
    margin-bottom: 58px;
  }

  h1 {
    font-size: clamp(3.4rem, 5.4vw, 4.7rem);
  }

  h2 {
    font-size: clamp(2.5rem, 4vw, 3.45rem);
  }

  .hero-start {
    max-width: 880px;
  }
}
