:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #111827;
    --muted: #667085;
    --border: #d8dee8;
    --accent: #03b3ff;
    --accent-soft: #eef2f7;
    --success: #177245;
    --success-bg: #edf9f2;
    --danger: #b42318;
    --danger-bg: #fff4f2;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.45;
}
button, input { font: inherit; }

.page-shell { min-height: 100vh; padding: 28px 16px 18px; }
.card {
    width: min(780px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid rgba(17, 24, 39, .06);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, .08);
    overflow: hidden;
}
.hero { padding: 32px 32px 20px; }
.eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
h1 { margin: 7px 0 10px; font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.08; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--muted); max-width: 62ch; }

.progress-wrap { padding: 0 32px 20px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.progress { height: 7px; background: #edf0f4; border-radius: 999px; overflow: hidden; }
.progress span { display: block; width: 16.6667%; height: 100%; background: var(--accent); border-radius: inherit; }

form { padding: 0 32px 32px; }
.question { border: 0; padding: 24px 0; margin: 0; border-top: 1px solid #edf0f4; }
.question legend { width: 100%; display: flex; align-items: flex-start; gap: 10px; font-size: 1.06rem; font-weight: 800; }
.question legend > span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: .82rem; }
.helper { margin: 8px 0 14px 40px; color: var(--muted); font-size: .9rem; }

.option-grid, .weight-grid, .option-list { display: grid; gap: 10px; margin-top: 14px; }
.option-grid { grid-template-columns: repeat(3, 1fr); }
.weight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-card {
    display: flex; align-items: flex-start; gap: 12px; padding: 15px;
    border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
    min-width: 0;
}
.option-card:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(17, 24, 39, .06); }
.option-card:focus-within { outline: 3px solid rgba(17,24,39,.12); outline-offset: 2px; }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot { width: 21px; height: 21px; flex: 0 0 21px; margin-top: 2px; border: 2px solid #a7afbc; border-radius: 50%; background: #fff; position: relative; }
.option-card:has(input:checked) .radio-dot { border-color: var(--accent); }
.option-card:has(input:checked) .radio-dot::after { content: ""; position: absolute; inset: 4px; background: var(--accent); border-radius: 50%; }
.option-content { min-width: 0; }
.option-content strong { display: block; font-size: .95rem; }
.option-content small { display: block; margin-top: 6px; color: var(--muted); font-size: .84rem; }
.option-card.compact { align-items: center; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.field { display: grid; gap: 7px; font-weight: 700; font-size: .92rem; }
.field > span { color: #344054; }
.input-with-suffix { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.input-with-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.input-with-suffix input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 13px 12px; background: transparent; }
.input-with-suffix > span { padding-right: 12px; color: var(--muted); font-weight: 700; }
.input-with-suffix.large input { font-size: 1.2rem; }

.form-actions { border-top: 1px solid #edf0f4; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-actions p { margin: 0; color: var(--muted); font-size: .82rem; }
button, .pdf-button {
    border: 0; border-radius: 12px; background: var(--accent); color: #fff; padding: 13px 18px;
    font-weight: 800; cursor: pointer; min-height: 48px; text-decoration: none; display: inline-flex;
    align-items: center; justify-content: center; gap: 7px;
}
button:hover, .pdf-button:hover { filter: brightness(.94); }
button:focus-visible, .pdf-button:focus-visible { outline: 3px solid rgba(17,24,39,.25); outline-offset: 3px; }

.errors { margin: 0 32px 14px; padding: 14px 16px; border-radius: 12px; color: var(--danger); background: var(--danger-bg); }
.errors ul { margin: 8px 0 0 18px; padding: 0; }
.success { margin: 0 32px 18px; display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: var(--success-bg); color: var(--success); }
.success-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: currentColor; color: #fff; font-weight: 900; }
.success p { margin: 3px 0 0; color: #3f6852; }

.result-box { margin: 0 32px 18px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #f8fafc; }
.result-code { color: var(--muted); font-size: .85rem; font-weight: 800; margin-bottom: 12px; }
.pdf-button { width: 100%; }
.result-note { margin: 12px 0 0; color: var(--muted); font-size: .8rem; }
.summary { margin: 0 32px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary > div { border: 1px solid var(--border); border-radius: 12px; padding: 13px; }
.summary span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 3px; }
.summary strong { display: block; font-size: .9rem; }
.notice { margin: 0 32px 14px; padding: 14px 16px; background: #f7f8fa; border-radius: 12px; color: #475467; font-size: .88rem; }
.secondary-action { margin: 0 32px 32px; text-align: center; }
.secondary-action a { color: var(--muted); font-size: .88rem; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
footer { width: min(780px, 100%); margin: 12px auto 0; text-align: center; color: #98a2b3; font-size: .78rem; }

@media (max-width: 720px) {
    .page-shell { padding: 12px 10px 16px; }
    .card { border-radius: 18px; }
    .hero, .progress-wrap, form { padding-left: 18px; padding-right: 18px; }
    .option-grid { grid-template-columns: 1fr; }
    .weight-grid { grid-template-columns: 1fr; }
    .input-grid { grid-template-columns: 1fr; }
    .helper { margin-left: 40px; }
    .form-actions { flex-direction: column; align-items: stretch; }
    button { width: 100%; }
    .errors, .success, .result-box, .summary, .notice, .secondary-action { margin-left: 18px; margin-right: 18px; }
    .summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
