/* ==========================================================================
   Nexform — one stylesheet for marketing, organiser dashboard and public forms
   ========================================================================== */
:root {
  --brand: #2b4acb;
  --brand-2: #213a9f;
  --brand-soft: #e8ecfb;
  --accent: var(--brand);          /* overridden per event on public pages */
  --ink: #16181d;
  --ink-2: #3b3f48;
  --muted: #6b707b;
  --line: #e3e0d8;
  --line-2: #efece5;
  --bg: #f7f5f0;
  --paper: #ffffff;
  --ok: #217a4b;  --ok-soft: #e3f4ea;
  --warn: #9a5b00; --warn-soft: #fdf1dc;
  --err: #b42318; --err-soft: #fdeceb;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(22,24,29,.06);
  --shadow: 0 1px 2px rgba(22,24,29,.05), 0 10px 30px -12px rgba(22,24,29,.18);
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0 0 .45em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; line-height: 1.2;
  border: 1.5px solid transparent; border-radius: 10px; padding: 11px 18px; min-height: 44px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9c5bb; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-ghost { background: var(--paper); color: var(--err); border-color: #f1c4bf; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: .875rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink-2); cursor: pointer; font-size: 1rem; }
.icon-btn:hover { border-color: #c9c5bb; color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field .label { font-weight: 600; font-size: .92rem; }
.field .help { font-size: .82rem; color: var(--muted); }
.errorlist { list-style: none; margin: 2px 0 0; padding: 0; color: var(--err); font-size: .85rem; }
.req { color: var(--err); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local],
input[type=password], input[type=search], input[type=url], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 13px; min-height: 46px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b707b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.has-error input, .has-error textarea, .has-error select { border-color: var(--err); }
.form-stack { display: grid; gap: 18px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 500; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: #d5d2ca; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

/* Colour picker radios */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches > div { display: contents; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches .sw { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatches input:checked + .sw { box-shadow: 0 0 0 2.5px var(--ink); }
.swatches input:focus-visible + .sw { outline: 3px solid #9aa9ee; outline-offset: 2px; }

/* ---------- Notices ---------- */
.notice { padding: 12px 14px; border-radius: 10px; font-size: .92rem; margin: 0 0 16px; border: 1px solid transparent; }
.notice-ok { background: var(--ok-soft); color: #14532d; border-color: #c4e6d1; }
.notice-err { background: var(--err-soft); color: #7a1c13; border-color: #f4c9c4; }
.notice-warn { background: var(--warn-soft); color: #6b3f00; border-color: #f2dcb2; }
.notice-info { background: var(--brand-soft); color: #1b2e7a; border-color: #cfd8f7; }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
@media (min-width: 640px) { .card { padding: 28px; } }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }

/* ---------- App shell ---------- */
.topnav { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topnav-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.topnav .spacer { flex: 1; }
.topnav nav { display: flex; align-items: center; gap: 6px; }
.topnav nav a.navlink { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .92rem; padding: 8px 10px; border-radius: 8px; }
.topnav nav a.navlink:hover { background: var(--line-2); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 99px; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; }
.usermenu .menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--line-2); }

.container { max-width: 1160px; margin: 0 auto; padding: 28px 16px 64px; }
.container-narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.crumb { font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

/* Event header + tabs */
.event-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 8px; }
.event-head h1 { margin: 0 0 6px; word-break: break-word; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 11px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .94rem; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); font-size: .78rem; margin-left: 4px; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-open { background: var(--ok-soft); color: var(--ok); }
.badge-closed, .badge-ended, .badge-full { background: #eeece6; color: #5d6068; }
.badge-empty { background: var(--warn-soft); color: var(--warn); }

/* Dashboard event list */
.event-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .event-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .event-grid { grid-template-columns: repeat(3, 1fr); } }
.event-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: border-color .15s, box-shadow .15s; }
.event-card:hover { border-color: #cdc9bf; box-shadow: var(--shadow); }
.event-card .stripe { position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; }
.event-card h3 { margin: 0; font-size: 1.12rem; word-break: break-word; }
.event-card h3 a { color: inherit; text-decoration: none; }
.event-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.event-card .meta { font-size: .85rem; color: var(--muted); display: grid; gap: 2px; }
.event-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }
.event-card .big { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.empty-state { text-align: center; padding: 56px 20px; background: var(--paper); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty-state .ill { width: 64px; height: 64px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-family: var(--display); font-size: 1.7rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .8rem; color: var(--muted); }

/* Toolbar + table */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 240px; max-width: 460px; }
.toolbar input[type=search] { min-height: 40px; padding: 8px 12px; }
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fbfaf7; font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
table.data td { max-width: 280px; overflow-wrap: break-word; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #faf9f5; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { font-family: var(--mono); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
table.data .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-size: .9rem; }

/* Detail list */
.dl { display: grid; gap: 0; margin: 0; }
.dl > div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (min-width: 640px) { .dl > div { grid-template-columns: 240px 1fr; gap: 16px; } }

/* Summary bars */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .9rem; }
.bar-row .track { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.bar-row .v { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 140px; }
.cols .c { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: .68rem; color: var(--muted); }
.cols .stick { width: 100%; max-width: 22px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .cnt { font-weight: 700; color: var(--ink); font-size: .72rem; }
.summary-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .summary-grid { grid-template-columns: 1fr 1fr; } }

/* Share */
.share-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .share-grid { grid-template-columns: 1.4fr 1fr; } }
.linkbox { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 220px; font-family: var(--mono); font-size: .92rem; background: #fbfaf7; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; place-items: center; }
.qr svg { width: 100%; max-width: 240px; height: auto; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: .92rem; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }

/* ==========================================================================
   Form builder
   ========================================================================== */
.builder { display: grid; gap: 20px; }
@media (min-width: 1000px) { .builder { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.builder-side { display: grid; gap: 14px; }
@media (min-width: 1000px) { .builder-side { position: sticky; top: 80px; } }
.savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.savebar .state { font-size: .85rem; color: var(--muted); }
.savebar .state.dirty { color: var(--warn); font-weight: 600; }
.qlist { display: grid; gap: 12px; }
.qcard { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; transition: border-color .15s, box-shadow .15s; }
.qcard:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.qcard.invalid { border-color: var(--err); }
.qcard .qtop { display: flex; gap: 10px; align-items: center; }
.qcard .qnum { font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--line-2); border-radius: 7px; padding: 4px 8px; flex: none; }
.qcard .qtype { flex: 1; min-width: 0; max-width: 260px; min-height: 38px; padding: 6px 34px 6px 10px; font-size: .9rem; }
.qcard .qtools { display: flex; gap: 6px; margin-left: auto; }
.qcard .qlabel { font-size: 1.05rem; font-weight: 600; }
.qcard .qhelp { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.qcard .qerr { color: var(--err); font-size: .85rem; margin: -4px 0 0; }
.qcard .qfoot { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--line-2); }
.qcard .answered { font-size: .8rem; color: var(--muted); margin-left: auto; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 8px; align-items: center; }
.opt .dot { width: 16px; height: 16px; border: 2px solid #c3c0b8; border-radius: 50%; flex: none; }
.opt .dot.sq { border-radius: 4px; }
.opt input { min-height: 38px; padding: 7px 11px; }
.addq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.addq button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font: inherit; font-size: .86rem; font-weight: 500; cursor: pointer; color: var(--ink); min-height: 44px; }
.addq button:hover { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }
.addq .ico { width: 22px; text-align: center; flex: none; }

/* ==========================================================================
   Public registration form (one question per page)
   ========================================================================== */
.pub { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background:
  radial-gradient(900px 400px at 100% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); }
.pub-top { height: 4px; background: color-mix(in srgb, var(--accent) 15%, #e7e4dc); position: sticky; top: 0; z-index: 5; }
.pub-top .progress { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.pub-head { max-width: 680px; width: 100%; margin: 0 auto; padding: 16px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; }
.pub-head .evname { font-weight: 600; font-size: .88rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-head .stepcount { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pub-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 20px 16px 40px; }
@media (min-height: 700px) and (min-width: 640px) { .pub-main { align-items: center; } }
.pub-form { width: 100%; max-width: 680px; }
.owner-bar { background: var(--ink); color: #fff; font-size: .85rem; text-align: center; padding: 8px 12px; }
.owner-bar a { color: #fff; font-weight: 600; }

.step { animation: stepIn .28s ease both; }
.js .step { display: none; }
.js .step.active { display: block; }
.step + .step { margin-top: 28px; }
.js .step + .step { margin-top: 0; }
.step.back { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } .pub-top .progress { transition: none; } }

.intro .chip-accent { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.intro h1 { font-size: clamp(2rem, 7vw, 3rem); margin-bottom: 14px; }
.intro .desc { font-size: 1.05rem; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.facts { display: grid; gap: 10px; margin: 22px 0 28px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.fact { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.fact svg { flex: none; color: var(--accent); margin-top: 2px; }
.fact b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.intro .start-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.q-count { font-size: .85rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.q-label { display: block; font-family: var(--display); font-size: clamp(1.45rem, 5vw, 2rem); font-weight: 700; line-height: 1.18; letter-spacing: -.02em; margin-bottom: 8px; overflow-wrap: anywhere; }
.q-label .req { font-size: .8em; }
.q-help { color: var(--muted); margin-bottom: 18px; font-size: .98rem; }
.q-input { margin-top: 18px; }
.q-input input[type=text], .q-input input[type=email], .q-input input[type=tel], .q-input input[type=number], .q-input input[type=date], .q-input textarea, .q-input select {
  font-size: 1.15rem; padding: 14px 16px; min-height: 56px; border-radius: 12px; border-width: 2px; background: #fff; }
.q-input textarea { min-height: 140px; }
.q-error { color: var(--err); font-size: .92rem; margin: 10px 0 0; display: flex; gap: 6px; align-items: center; min-height: 0; }
.q-error:empty { display: none; }
.step.has-error .q-input input, .step.has-error .q-input textarea, .step.has-error .q-input select { border-color: var(--err); }
.q-optional { font-size: .8rem; color: var(--muted); font-weight: 500; }

.choices { display: grid; gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 1.05rem; font-weight: 500; transition: border-color .12s, background .12s; }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #bdb9b0; flex: none; display: grid; place-items: center; background: #fff; transition: all .12s; }
.choice.multi .mark { border-radius: 6px; }
.choice .key { margin-left: auto; font-family: var(--mono); font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; display: none; }
@media (hover: hover) { .choice .key { display: inline-block; } }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.choice:has(input:checked) .mark { border-color: var(--accent); background: var(--accent); }
.choice:has(input:checked) .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.choice.multi:has(input:checked) .mark::after { width: 10px; height: 6px; border-radius: 0; background: none; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.yesno { grid-template-columns: 1fr 1fr; }

.step-nav { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.step-nav .hint { font-size: .82rem; color: var(--muted); display: none; }
@media (hover: hover) and (pointer: fine) { .step-nav .hint { display: inline; } }
.step-nav .back-btn { margin-right: auto; }
.js .nojs-only { display: none !important; }
.nojs-only { margin-top: 28px; }
.no-js .js-only { display: none !important; }

.review-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 18px 0 8px; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); align-items: start; }
.review-item:last-child { border-bottom: 0; }
.review-item .rq { font-size: .82rem; color: var(--muted); font-weight: 600; }
.review-item .ra { grid-column: 1; white-space: pre-line; overflow-wrap: anywhere; }
.review-item .ra.empty { color: var(--muted); font-style: italic; }
.review-item .edit { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

.thanks { text-align: center; padding: 20px 0; }
.thanks .tick { width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); display: grid; place-items: center; margin: 0 auto 18px; }
.thanks .refno { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 1.5rem; padding: 10px 18px; border: 2px dashed color-mix(in srgb, var(--accent) 55%, #fff); border-radius: 12px; background: #fff; margin: 4px 0 16px; letter-spacing: .04em; }
.thanks .msg { white-space: pre-line; color: var(--ink-2); max-width: 520px; margin: 0 auto 18px; overflow-wrap: anywhere; }
.pub-foot { text-align: center; padding: 18px 16px 26px; font-size: .8rem; color: var(--muted); }
.pub-foot a { color: var(--muted); }

/* ==========================================================================
   Marketing home + auth pages
   ========================================================================== */
.hero { max-width: 1160px; margin: 0 auto; padding: 56px 16px 40px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr 1fr; padding-top: 80px; } }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 540px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 10px; }
.mock { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px; max-width: 460px; justify-self: center; width: 100%; }
.mock .bar { height: 5px; border-radius: 99px; background: var(--line-2); margin-bottom: 26px; overflow: hidden; }
.mock .bar span { display: block; height: 100%; width: 60%; background: var(--brand); }
.mock .mq { font-size: .82rem; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.mock .ml { font-family: var(--display); font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -.02em; }
.mock .mi { border: 2px solid var(--brand); border-radius: 12px; padding: 13px 15px; font-size: 1.05rem; color: var(--ink-2); margin-bottom: 16px; }
.mock .mi::after { content: "|"; color: var(--brand); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.mock .mb { display: inline-flex; background: var(--brand); color: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: .95rem; }
.how { max-width: 1160px; margin: 0 auto; padding: 24px 16px 72px; }
.how-grid { display: grid; gap: 14px; margin-top: 20px; }
@media (min-width: 800px) { .how-grid { grid-template-columns: repeat(3, 1fr); } }
.how-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.how-card .n { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; font-family: var(--display); }
.features { display: grid; gap: 10px 24px; margin-top: 28px; padding: 0; list-style: none; }
@media (min-width: 700px) { .features { grid-template-columns: repeat(2, 1fr); } }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.site-foot { border-top: 1px solid var(--line); padding: 22px 16px; text-align: center; color: var(--muted); font-size: .85rem; }

.auth { min-height: calc(100vh - 61px); display: grid; place-items: center; padding: 32px 16px; }
.auth .card { width: 100%; max-width: 420px; }
.auth h1 { font-size: 1.7rem; }
.auth .alt { text-align: center; margin-top: 18px; font-size: .92rem; color: var(--muted); }

/* Danger zone */
.danger-zone { border-color: #f1c4bf; }

@media print {
  .topnav, .tabs, .event-actions, .toolbar, .pager, .owner-bar, .pub-top { display: none !important; }
  body { background: #fff; }
}
.fine-only { display: none; }
@media (hover: hover) and (pointer: fine) { .fine-only { display: block; } }
.thanks .facts { text-align: left; max-width: 520px; margin: 8px auto 22px; }

/* Builder on phones/tablets: type picker on its own row, Save pinned to the bottom */
.savecard { padding: 18px; }
@media (max-width: 640px) {
  .qcard .qtop { flex-wrap: wrap; }
  .qcard .qtype { order: 3; flex-basis: 100%; max-width: none; }
}
@media (max-width: 999px) {
  .builder { padding-bottom: 84px; }
  .savecard { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; border-radius: 0; border-width: 1px 0 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(22,24,29,.10); }
  .savecard .savebar { flex-wrap: nowrap; justify-content: space-between; }
  .savecard .savebar .btn { width: auto; order: 2; }
  .savecard #previewBtn { display: none; }
}
