@font-face { font-family: 'Vista'; src: url('/fonts/VistaSansOT-Book.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vista'; src: url('/fonts/VistaSansOT-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vista'; src: url('/fonts/VistaSansOT-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f5f1ea; --card: #ffffff; --ink: #2b2a28; --muted: #78726a; --line: #e7e1d7;
  --accent: #3f5a48; --accent-ink: #ffffff; --accent-soft: #e5ece4; --accent-line: #b9cbb9;
  --open: #b0793a; --open-soft: #f6ead9; --missed: #a3a09a; --danger: #a8432f;
  --radius: 16px; --shadow: 0 1px 2px rgba(43, 42, 40, .04), 0 6px 24px rgba(43, 42, 40, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 'Vista', -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-weight: 500; font-size: clamp(28px, 6vw, 38px); line-height: 1.15; letter-spacing: -.01em; margin: .2em 0 .3em; }
h3 { font-weight: 500; font-size: 19px; margin: 0 0 .3em; }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.center { text-align: center; }
.loading { text-align: center; margin-top: 30vh; color: var(--muted); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; margin: 0 auto; padding: 18px 16px; }
.brand img { height: 26px; display: block; }
.top-right { display: flex; align-items: center; gap: 12px; }
.langs { display: flex; background: #ebe5db; border-radius: 999px; padding: 3px; }
.lang { border: 0; background: transparent; font: 500 13px 'Vista', sans-serif; letter-spacing: .04em; color: var(--muted); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lang.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

main { max-width: 720px; margin: 0 auto; padding: 8px 16px 120px; }
main.narrow { max-width: 460px; }
.intro { margin: 18px 0 22px; }
.eyebrow { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0; font-weight: 500; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; }

/* forms */
label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 14px; }
input[type=email], input[type=password], input[type=date], input[type=number], select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: 400 17px 'Vista', sans-serif; color: var(--ink); background: #fbfaf7; appearance: none; -webkit-appearance: none; min-height: 48px;
}
input:focus, select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); background: #fff; }
small { display: block; margin-top: 4px; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two label { margin-bottom: 0; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; gap: 0; } .two label { margin-bottom: 14px; } }
.consent { background: var(--bg); border-radius: 12px; padding: 16px; margin: 6px 0 14px; font-size: 15px; }
.consent p { color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); margin: 12px 0 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.err { color: var(--danger); font-size: 15px; min-height: 0; }
.err:empty, .ok:empty { display: none; }
.ok { color: var(--accent); font-size: 15px; }

.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 500 17px 'Vista', sans-serif; padding: 14px 22px; cursor: pointer; text-decoration: none; min-height: 50px; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.sm { width: auto; padding: 9px 18px; min-height: 0; font-size: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* journey */
.progress { height: 8px; background: #e6dfd3; border-radius: 99px; overflow: hidden; margin: 18px 0 6px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.step { position: relative; display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px 16px 48px; margin-bottom: 10px; }
.step .node { position: absolute; left: 8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); z-index: 1; }
.step.done .node { background: var(--accent); border-color: var(--accent); }
.step.done .node::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step.open .node { background: var(--open); border-color: var(--open); box-shadow: 0 0 0 5px var(--open-soft); }
.step.missed .node { background: #d9d5ce; border-color: #d9d5ce; }
.step.locked { background: rgba(255,255,255,.55); box-shadow: none; }
.step.locked strong { color: var(--muted); }
.step.today { outline: 2px solid var(--open-soft); }
.step-body { flex: 1; min-width: 0; }
.step-body p { margin: 2px 0 0; }
.step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-head strong { font-weight: 500; font-size: 17.5px; }
.meta { color: var(--open); }
.step.locked .meta { color: var(--muted); }
.step-action { flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: #eee9e1; color: var(--muted); }
.badge.done { background: var(--accent-soft); color: var(--accent); }
.badge.open { background: var(--open-soft); color: var(--open); }
.done-all { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 480px) { .step { flex-wrap: wrap; } .step-action { width: 100%; } .step-action .btn { width: 100%; } }

/* questionnaire */
.qsec h3 { margin-bottom: 0; }
.prompt { color: var(--muted); font-style: italic; margin: 2px 0 6px; }
.item { border: 0; padding: 16px 0 6px; margin: 0; border-top: 1px solid var(--line); min-width: 0; }
.qsec h3 + .item, .prompt + .item { border-top: 0; padding-top: 8px; }
.item legend { padding: 0; font-size: 17px; margin-bottom: 10px; float: left; width: 100%; }
.item legend + * { clear: both; }
.item.missing legend { color: var(--danger); }
.item.missing .scale, .item.missing .labelled, .item.missing .yesno, .item.missing .num input { box-shadow: 0 0 0 2px #e9b9ae; border-radius: 12px; }
.item[hidden] { display: none; }

.scale { display: grid; gap: 6px; }
.scale.n6 { grid-template-columns: repeat(6, 1fr); }
.scale.n11 { grid-template-columns: repeat(11, 1fr); gap: 4px; }
.pt, .opt, .pill { margin: 0; cursor: pointer; color: var(--ink); }
.pt input, .opt input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.pt span { display: flex; align-items: center; justify-content: center; height: 46px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; font-size: 16px; transition: background .15s, border-color .15s; }
.scale.n11 .pt span { height: 42px; font-size: 15px; border-radius: 10px; }
.pt input:checked + span, .opt input:checked + span, .pill input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt input:focus-visible + span, .opt input:focus-visible + span, .pill input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.anchors { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.anchors span:last-child { text-align: right; }
.labelled { display: grid; gap: 6px; }
.opt span { display: block; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; font-size: 16px; }
.yesno { display: flex; gap: 8px; }
.pill span { display: block; min-width: 92px; text-align: center; padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fbfaf7; }
.num { display: flex; align-items: center; gap: 10px; }
.num input { width: 120px; margin: 0; }
.num span { color: var(--muted); }
form.ro .pt span, form.ro .opt span, form.ro .pill span { cursor: default; }
form.ro input:not(:checked) + span { opacity: .55; }

.savebar { padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); }
.savebar .muted { text-align: center; margin-bottom: 10px; }
@media (min-width: 560px) { .btn:not(.sm) { max-width: 360px; margin: 0 auto; display: flex; } .auth .btn { max-width: none; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; transition: .3s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
