/* TFP brand: orange #f16b41 on cream #faf8f5, Inter. See memory: tfp-brand-style-guide. */
:root {
  --orange: #f16b41; --orange-dark: #d85a35; --rust: #a84224;
  --ink: #1f2937; --cream: #faf8f5; --white: #fff; --panel: #f5f1ec; --line: #e8e2db;
  --body: rgba(31,41,55,.72); --muted: rgba(31,41,55,.55);
  --tint: rgba(241,107,65,.08); --tint-line: rgba(241,107,65,.30);
  --shadow: 0 8px 30px rgba(31,41,55,.06);
  --r-card: 1rem; --r-ctl: .75rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream); color: var(--ink); line-height: 1.65;
  display: flex; flex-direction: column; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.progress { position: fixed; inset: 0 0 auto 0; height: 4px; background: var(--line); z-index: 10; }
.progress-bar { height: 100%; width: 0; background: var(--orange); transition: width .35s ease; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 0; max-width: 1120px; width: 100%; margin: 0 auto; }
.logo { height: 44px; width: auto; }
.count { font-size: .85rem; color: var(--muted); font-weight: 500; }

.stage { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 20px 24px; display: flex; align-items: center; position: relative; }
.panel { width: 100%; animation: in .3s ease both; }
.panel.back { animation-name: inBack; }
@keyframes in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--orange); margin: 0 0 14px; }
h1, h2 { font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
.accent { color: var(--orange); }
.lead { font-size: 1.1rem; color: var(--body); margin: 0 0 26px; }
.small { font-size: .85rem; color: var(--muted); }

/* fields */
.fields { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; }
.field input { height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--white); font-size: 1rem; }
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--tint-line); }
.err { color: var(--rust); font-size: .9rem; min-height: 1.4em; margin: 6px 0 0; }

/* answer options */
.opts { display: grid; gap: 10px; margin-top: 22px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 16px; min-height: 56px; transition: border-color .15s, background .15s, transform .15s;
}
.opt:hover { border-color: var(--tint-line); transform: translateY(-1px); }
.opt .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--cream);
}
.opt[aria-checked="true"] { border: 1.5px solid var(--orange); background: var(--tint); padding: 13.5px 15.5px; }
.opt[aria-checked="true"] .key { background: var(--orange); border-color: var(--orange); color: #fff; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px;
  background: var(--orange); color: #fff; border: 0; border-radius: var(--r-ctl); font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--orange-dark); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
kbd { font: inherit; font-size: .8rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--white); }

/* footer nav */
.nav { display: flex; align-items: center; justify-content: space-between; max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 20px calc(18px + env(safe-area-inset-bottom)); }
.hint { font-size: .85rem; color: var(--muted); }
.nav-btns { display: flex; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover:not([disabled]) { border-color: var(--orange); color: var(--orange); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.nav.hidden { visibility: hidden; }

/* results */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px; margin: 22px 0; }
.bars { display: grid; gap: 14px; }
.bar-row .lbl { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.track { height: 12px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; background: var(--orange); border-radius: 99px; width: 0; transition: width .8s ease; }
.fill.people { background: var(--rust); }
.split { display: flex; height: 44px; border-radius: var(--r-ctl); overflow: hidden; margin-top: 6px; font-size: .85rem; font-weight: 600; color: #fff; }
.split div { display: flex; align-items: center; padding: 0 14px; white-space: nowrap; transition: width .8s ease; }
.split .t { background: var(--orange); } .split .p { background: var(--rust); justify-content: flex-end; }
.split-lbl { display: flex; justify-content: space-between; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.callout { background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--r-card); padding: 18px 20px; margin: 22px 0; }
.callout p { margin: 0; }
.callout strong { display: block; margin-bottom: 4px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; margin-top: 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--orange); flex: none; }
.saved { color: var(--muted); font-size: .85rem; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-ctl); font-size: .9rem; z-index: 20; max-width: calc(100% - 40px); }

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .hint { display: none; }
  .nav { justify-content: flex-end; }
  .logo { height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .panel.back { animation: none; }
  .progress-bar, .fill, .split div, .opt { transition: none; }
}
