:root {
  --ink: #172033;
  --muted: #5c667a;
  --line: #d8deea;
  --soft: #f5f7fb;
  --brand: #2759a5;
  --brand-dark: #173d7a;
  --accent: #eef4ff;
  --success: #23653b;
  --danger: #a33131;
  --shadow: 0 16px 44px rgba(23, 32, 51, .09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f2f5f9;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: linear-gradient(180deg, #f8faff 0, #f2f5f9 320px); line-height: 1.55; }
button, input, select { font: inherit; }
button, label, input[type="radio"], input[type="checkbox"] { cursor: pointer; }
a { color: var(--brand); }

.site-header { border-bottom: 1px solid rgba(216, 222, 234, .9); background: rgba(255, 255, 255, .92); }
.header-inner { width: min(1120px, calc(100% - 32px)); margin: auto; min-height: 88px; display: flex; align-items: center; gap: 14px; }
.study-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--brand); font-size: 22px; }
.eyebrow { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.site-title { margin: 2px 0 0; font-size: 1.2rem; font-weight: 720; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 42px auto 72px; }
.page-shell:focus { outline: none; }
.card { width: min(780px, 100%); margin: auto; padding: clamp(26px, 5vw, 54px); background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card.wide { width: 100%; }
.loading-card { min-height: 220px; display: grid; place-items: center; align-content: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #dbe3ef; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

h1 { margin: 0 0 18px; font-size: clamp(1.65rem, 4vw, 2.2rem); line-height: 1.22; }
h2 { margin: 32px 0 10px; font-size: 1.18rem; }
p { margin: 0 0 15px; }
.lede { font-size: 1.06rem; color: #3d485c; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.notice { padding: 15px 17px; border: 1px solid #bdd0ef; border-radius: 10px; background: var(--accent); }
.notice.error { color: var(--danger); border-color: #efc3c3; background: #fff5f5; }
.notice.success { color: var(--success); border-color: #bddfc7; background: #f2fbf5; }
.approval { color: var(--muted); font-size: .87rem; margin-top: 24px; }

.consent-box { margin: 30px 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; font-weight: 600; }
.check-row input { width: 19px; height: 19px; margin: 3px 0 0; }
.actions { margin-top: 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.button { appearance: none; border: 1px solid var(--brand); border-radius: 9px; padding: 11px 20px; background: var(--brand); color: white; font-weight: 700; text-decoration: none; transition: background .15s, transform .15s; }
.button:hover { background: var(--brand-dark); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.secondary { color: var(--brand); background: white; }
.button.danger { border-color: var(--danger); background: var(--danger); }

.progress-wrap { margin-bottom: 22px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .85rem; font-weight: 650; }
.progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e8edf5; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--brand); transition: width .25s; }

.stimulus-frame { width: 100%; overflow: auto; border: 1px solid #cbd3df; border-radius: 9px; background: white; }
.stimulus { display: block; width: 100%; max-width: 1280px; height: auto; margin: 0 auto; }
.countdown { margin-top: 16px; color: var(--muted); font-weight: 650; }

.question-list { display: grid; gap: 26px; margin-top: 26px; }
.question { border: 0; padding: 0 0 25px; margin: 0; border-bottom: 1px solid #e5e9f0; }
.question:last-child { border-bottom: 0; padding-bottom: 0; }
.question legend { width: 100%; margin-bottom: 14px; padding: 0; font-weight: 650; }
.required { color: var(--danger); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(62px, 1fr)); gap: 8px; }
.scale-option, .choice-option { position: relative; }
.scale-option input, .choice-option input { position: absolute; opacity: 0; pointer-events: none; }
.scale-option label { min-height: 64px; display: grid; place-items: center; gap: 1px; padding: 8px 4px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
.scale-option .number { font-size: 1.08rem; font-weight: 750; }
.scale-option .anchor { color: var(--muted); font-size: .69rem; line-height: 1.2; }
.scale-option input:checked + label, .choice-option input:checked + label { border-color: var(--brand); background: var(--accent); box-shadow: 0 0 0 2px rgba(39, 89, 165, .12); }
.scale-option input:focus-visible + label, .choice-option input:focus-visible + label { outline: 3px solid rgba(39, 89, 165, .28); outline-offset: 2px; }
.choices { display: flex; flex-wrap: wrap; gap: 9px; }
.choice-option label { display: block; min-width: 90px; padding: 10px 15px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
.validation { min-height: 23px; margin: 18px 0 -8px; color: var(--danger); font-weight: 650; }

.result-icon { width: 54px; height: 54px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; background: #edf7f0; color: var(--success); font-size: 27px; font-weight: 800; }
.claim-form { margin-top: 26px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.field-label { display: block; margin-bottom: 7px; font-weight: 700; }
input[type="email"], input[type="password"], input[type="text"], select { width: 100%; padding: 11px 12px; border: 1px solid #bfc8d6; border-radius: 8px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(39, 89, 165, .2); border-color: var(--brand); }

.site-footer { width: min(1120px, calc(100% - 32px)); margin: 0 auto 34px; color: var(--muted); text-align: center; font-size: .82rem; }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 30px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.stat strong { display: block; margin-top: 5px; font-size: 1.4rem; }
.admin-form { display: grid; gap: 18px; }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #e8edf5; font-size: .8rem; font-weight: 750; text-transform: uppercase; }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.preview-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.preview-card .actions { margin-top: 10px; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 20px, 1120px); margin-top: 22px; }
  .card { padding: 24px 18px; border-radius: 13px; }
  .header-inner { width: calc(100% - 24px); min-height: 74px; }
  .scale { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .scale-option label { min-height: 58px; padding: 6px 2px; }
  .scale-option .anchor { display: none; }
  .scale-option:first-child .anchor, .scale-option:last-child .anchor { display: block; font-size: .6rem; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
