:root {
    --navy-950: #07111f;
    --navy-900: #0a1728;
    --navy-800: #10243a;
    --navy-700: #17334d;
    --blue: #59a8e8;
    --teal: #3fd1c5;
    --orange: #f3a44c;
    --white: #f8fbff;
    --muted: #9eafc2;
    --border: rgba(183, 210, 235, .16);
    --danger: #ff8f8f;
    --shadow: 0 30px 80px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy-950); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--white);
    background:
        radial-gradient(circle at 12% 12%, rgba(63, 209, 197, .1), transparent 28rem),
        radial-gradient(circle at 88% 90%, rgba(89, 168, 232, .1), transparent 30rem),
        var(--navy-950);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.page-shell {
    width: min(1120px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(390px, 520px);
    align-items: center;
    gap: clamp(48px, 8vw, 110px);
}

.brand-panel { display: flex; flex-direction: column; min-height: 600px; padding: 8px 0; }
.brand {
    color: var(--white); text-decoration: none; display: inline-flex; align-items: center;
    gap: 12px; width: fit-content; font-weight: 700; letter-spacing: .01em;
}
.brand-mark {
    width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(63, 209, 197, .5);
    border-radius: 50%; color: var(--teal); font-family: Manrope, sans-serif; font-size: 12px;
}
.brand-copy { margin: auto 0; }
.eyebrow { margin: 0 0 14px; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Manrope, sans-serif; letter-spacing: -.035em; }
h1 { max-width: 590px; margin-bottom: 22px; font-size: clamp(38px, 5vw, 64px); line-height: 1.07; }
.brand-copy > p:last-child { max-width: 510px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.time-note { margin: 0; color: var(--muted); font-size: 14px; }
.time-note span { margin-right: 7px; color: var(--orange); }

.quiz-card {
    min-height: 650px;
    padding: 34px;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(18, 42, 66, .98), rgba(9, 24, 41, .98));
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    position: relative;
}
.quiz-card::before { content: ""; position: absolute; top: 0; right: 35px; width: 54px; height: 3px; background: var(--orange); }
.quiz-header { margin-bottom: 52px; }
.quiz-header > div:first-child { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
#questionLabel { color: var(--white); }
.progress-track { height: 4px; overflow: hidden; background: rgba(255,255,255,.09); border-radius: 4px; }
.progress-track span { display: block; width: 10%; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); transition: width .35s ease; }
.question-stage { min-height: 430px; }
.question-stage.is-changing { animation: questionIn .3s ease; }
@keyframes questionIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.question-kicker { display: block; margin-bottom: 12px; color: var(--blue); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.question-stage h2 { margin-bottom: 30px; font-size: clamp(25px, 3vw, 32px); line-height: 1.25; }
.answers { display: grid; gap: 12px; }
.answer-card {
    width: 100%; min-height: 66px; padding: 13px 16px; display: flex; align-items: center; gap: 14px;
    color: var(--white); text-align: left; cursor: pointer; background: rgba(255,255,255,.025);
    border: 1px solid var(--border); border-radius: 12px; transition: border-color .18s, background .18s, transform .18s;
}
.answer-card:hover { border-color: rgba(89, 168, 232, .55); transform: translateY(-1px); }
.answer-card.selected { border-color: var(--teal); background: rgba(63, 209, 197, .09); }
.answer-letter { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 50%; font-size: 12px; font-weight: 700; }
.selected .answer-letter { color: var(--navy-950); background: var(--teal); border-color: var(--teal); }
.answer-text { font-size: 15px; line-height: 1.35; }
.quiz-actions { display: flex; justify-content: space-between; gap: 14px; padding-top: 18px; }
.button {
    min-height: 48px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border-radius: 5px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-weight: 700; transition: .2s ease;
}
.button-primary { color: var(--navy-950); background: var(--teal); }
.button-primary:hover:not(:disabled) { background: #6ce0d6; transform: translateY(-1px); }
.button-primary:disabled { cursor: not-allowed; opacity: .35; }
.button-secondary { color: var(--muted); background: transparent; border-color: var(--border); }
.button-secondary:hover { color: var(--white); border-color: var(--muted); }
.button-wide { width: 100%; margin-top: 6px; }

.screen-panel { padding: 18px 4px; animation: screenIn .4s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.screen-panel h2 { margin-bottom: 13px; font-size: clamp(30px, 5vw, 42px); }
.screen-intro { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.field-grid { display: grid; gap: 16px; }
.field-grid label { color: #c9d5e1; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.field-grid input {
    width: 100%; height: 50px; margin-top: 7px; padding: 0 14px; color: var(--white); outline: none;
    background: rgba(4, 14, 25, .42); border: 1px solid var(--border); border-radius: 5px;
}
.field-grid input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63,209,197,.08); }
.field-grid input.invalid { border-color: var(--danger); }
.form-error { min-height: 20px; margin: 10px 0; color: var(--danger); font-size: 13px; }
.privacy-note { margin: 13px 0 0; color: #71869a; font-size: 11px; text-align: center; }

.result-panel { text-align: center; }
.score-ring { width: 156px; height: 156px; margin: 10px auto 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(63,209,197,.12), transparent 67%); border: 2px solid var(--teal); border-radius: 50%; box-shadow: 0 0 40px rgba(63,209,197,.12); }
.score-ring strong { font: 800 54px/1 Manrope, sans-serif; }
.score-ring span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.recommendations { margin: 28px 0; padding: 20px; text-align: left; background: rgba(4,14,25,.35); border: 1px solid var(--border); border-radius: 12px; }
.recommendations > p { margin: 0 0 14px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.recommendations ol { margin: 0; padding: 0; list-style: none; counter-reset: areas; display: grid; gap: 10px; }
.recommendations li { counter-increment: areas; display: flex; align-items: center; gap: 12px; }
.recommendations li::before { content: "0" counter(areas); color: var(--teal); font-size: 11px; font-weight: 700; }
.text-button { margin-top: 18px; padding: 5px; color: var(--muted); cursor: pointer; background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 800px) {
    .page-shell { width: min(100% - 28px, 560px); padding: 24px 0; display: block; }
    .brand-panel { min-height: auto; padding: 0 6px; }
    .brand-copy { margin: 42px 0 28px; }
    h1 { font-size: 36px; }
    .brand-copy > p:last-child { font-size: 15px; }
    .time-note { margin-bottom: 26px; }
    .quiz-card { min-height: 630px; }
}
@media (max-width: 480px) {
    html, body { height: 100%; overflow: hidden; }
    .page-shell { width: 100%; height: var(--app-height, 100dvh); min-height: 0; padding: 0; }
    .brand-panel { height: 76px; padding: 16px 20px; justify-content: center; }
    .brand-copy, .time-note { display: none; }
    .quiz-card { height: calc(var(--app-height, 100dvh) - 76px); min-height: 0; padding: 22px 20px max(12px, env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 24px 24px 0 0; box-shadow: none; }
    #quizScreen { height: 100%; display: flex; flex-direction: column; }
    .quiz-header { flex: 0 0 auto; margin-bottom: 20px; }
    .question-stage { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
    .question-stage h2 { font-size: 21px; margin-bottom: 17px; }
    .question-kicker { margin-bottom: 7px; }
    .answers { gap: 8px; }
    .answer-card { min-height: 55px; padding: 9px 11px; }
    .answer-letter { width: 30px; height: 30px; flex-basis: 30px; }
    .answer-text { font-size: 14px; }
    .quiz-actions { flex: 0 0 auto; padding-top: 10px; }
    .screen-panel { height: 100%; padding: 6px 0; overflow-y: auto; overscroll-behavior: contain; }
    .screen-panel h2 { font-size: 29px; }
    .screen-intro { margin-bottom: 18px; line-height: 1.45; }
    .field-grid { gap: 9px; }
    .field-grid input { height: 44px; margin-top: 4px; }
    .score-ring { width: 125px; height: 125px; margin-bottom: 18px; }
    .score-ring strong { font-size: 44px; }
    .recommendations { margin: 18px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
