:root {
  --ink: #151515;
  --muted: #77736e;
  --paper: #f4f1eb;
  --panel: #fffdf9;
  --accent: #c4f05d;
  --line: #dfdbd2;
  --shadow: 0 24px 80px rgba(30, 28, 22, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .36;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 44px 44px;
}

.quiz-shell { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 26px; }
.brand-mark { font: 700 27px/1 "Space Grotesk", sans-serif; letter-spacing: -.08em; }
.brand-mark span { color: #96c92e; }
.quiz-panel { min-height: 650px; margin: 36px auto 22px; padding: clamp(28px, 6vw, 76px) clamp(24px, 9vw, 106px) 48px; background: var(--panel); box-shadow: var(--shadow); }
.quiz-header, .form-actions, .quiz-footer { display: flex; align-items: center; justify-content: space-between; }
.quiz-header { margin-bottom: 18px; }
.eyebrow, .step-count, .step-kicker, .question-hint, .field > span, .answer-field > span, .reference { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.step-count { letter-spacing: .04em; }
.step-divider { padding: 0 5px; color: var(--line); }
.progress-track { height: 4px; margin-bottom: 58px; overflow: hidden; background: #e8e4dc; }
.progress-value { width: 8%; height: 100%; background: var(--ink); transition: width .55s cubic-bezier(.2,.8,.2,1); }
.step-content { min-height: 360px; }
.step-enter { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.step-kicker { margin-bottom: 18px; color: #8ba92e; }
h1 { max-width: 700px; margin: 0; font: 600 clamp(34px, 5vw, 66px)/.98 "Space Grotesk", sans-serif; letter-spacing: -.065em; }
h1 em { color: #9bbc35; font-style: normal; }
.step-intro { max-width: 480px; margin: 24px 0 40px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.question-hint { margin: 22px 0 30px; letter-spacing: .06em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px 18px; max-width: 630px; margin-top: 44px; }
.field, .answer-field { display: flex; flex-direction: column; gap: 10px; }
.field > span, .answer-field > span { font-size: 10px; letter-spacing: .1em; }
input, textarea { width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: 0; padding: 11px 0 14px; color: var(--ink); background: transparent; font: 500 17px "DM Sans", sans-serif; transition: border-color .25s, box-shadow .25s; }
input:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 3px 0 var(--accent); }
textarea { resize: vertical; min-height: 100px; }
.answer-field { max-width: 620px; margin-top: 34px; }
.choice-list, .choice-grid { display: grid; max-width: 680px; gap: 12px; margin-top: 34px; }
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 17px 20px; border: 1px solid var(--line); font-size: 16px; transition: background .25s, border-color .25s, transform .25s; }
.choice-box b { color: #aaa69f; font-size: 20px; font-weight: 400; }
.choice:hover .choice-box { border-color: var(--ink); transform: translateY(-2px); }
.choice input:checked + .choice-box { border-color: var(--ink); background: var(--accent); }
.choice input:checked + .choice-box b { color: var(--ink); }
.form-actions { min-height: 54px; margin-top: 18px; }
.button { border: 0; padding: 17px 23px; cursor: pointer; font: 700 13px "DM Sans", sans-serif; letter-spacing: .02em; transition: transform .25s, background .25s; }
.button span { padding-left: 17px; font-size: 18px; }
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .55; }
.button-accent { background: var(--accent); }
.button-dark { color: white; background: var(--ink); }
.back-button { border: 0; padding: 14px 0; color: var(--muted); cursor: pointer; background: none; font: 600 13px "DM Sans", sans-serif; }
.back-button span { padding-right: 10px; font-size: 18px; }
.validation-message { min-height: 18px; margin: 18px 0 0; color: #bd4c35; font-size: 13px; }
.quiz-footer { color: #8c8880; font-size: 12px; letter-spacing: .02em; }
.quiz-footer strong { color: var(--ink); }
.footer-lock span { color: #9bbc35; padding-left: 5px; }
.state-view { display: flex; min-height: 390px; flex-direction: column; align-items: flex-start; justify-content: center; }
.state-view h1 { font-size: clamp(34px, 5vw, 56px); }
.state-view p { max-width: 400px; color: var(--muted); line-height: 1.6; }
.loader-ring { width: 36px; height: 36px; margin-bottom: 20px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-icon, .success-mark { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 27px; color: var(--ink); background: var(--accent); font-size: 28px; font-weight: 700; }
.state-view .button { margin-top: 20px; }
.success-mark { font-size: 32px; animation: pop .55s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
.reference { margin-top: 28px; }
.reference strong { color: var(--ink); }
.is-hidden { display: none !important; }

@media (max-width: 640px) {
  .quiz-shell { width: calc(100% - 24px); padding-top: 22px; }
  .quiz-panel { min-height: calc(100vh - 110px); margin-top: 22px; padding: 26px 22px 32px; }
  .progress-track { margin-bottom: 42px; }
  .field-grid, .choice-list { grid-template-columns: 1fr; gap: 20px; }
  .choice-grid { gap: 9px; }
  .choice-box { min-height: 58px; padding: 14px; }
  .step-content { min-height: 420px; }
  .quiz-footer { padding: 0 4px; }
  .footer-lock { display: none; }
}