:root {
  /* Rozmo brand, same values as the rozmotel.com theme. */
  --bg: #f5f8fc;
  --surface: #fff;
  --ink: #0d1526;
  --muted: #57687f;
  --line: #dee6f0;
  --accent: #1652ce;
  --accent-d: #0f3e9f;
  --accent-soft: #e8effc;
  --accent-ink: #fff;
  --err: #b3261e;
  --ok: #0e8a52;
  --ok-soft: #e3f4ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(13, 21, 38, .04), 0 4px 16px rgba(13, 21, 38, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131c; --surface: #161d29; --ink: #e8edf5; --muted: #9aa8bb;
    --line: #263043; --accent: #5b8dff; --accent-d: #3f74f0; --accent-soft: #1a2640;
    --err: #ef8a82; --ok: #4fc58a; --ok-soft: #15291f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #0e131c; --surface: #161d29; --ink: #e8edf5; --muted: #9aa8bb;
  --line: #263043; --accent: #5b8dff; --accent-d: #3f74f0; --accent-soft: #1a2640;
  --err: #ef8a82; --ok: #4fc58a; --ok-soft: #15291f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 740px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: baseline; gap: 12px; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); padding: 14px 0; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.045em; }
.brand b { color: var(--accent); }
.top .note { color: var(--muted); font-size: 14px; }
.foot { color: var(--muted); font-size: 13px; padding: 40px 0; }

h1 { font-size: 27px; line-height: 1.25; letter-spacing: -0.015em; margin: 18px 0 8px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
h4 { font-size: 14px; margin: 0 0 8px; color: var(--muted); }
.intro { color: var(--muted); margin: 0 0 22px; }
.step { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.crumb { margin: 16px 0 0; font-size: 14px; }
a { color: var(--accent); }

.progress { height: 4px; background: var(--line); border-radius: 99px; margin-top: 20px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); transition: width .25s ease; }

.field { margin: 0 0 22px; }
label { display: block; font-weight: 550; margin-bottom: 4px; }
.req { color: var(--accent); }
.help { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.held { color: var(--ok); font-size: 13px; margin: 0 0 6px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.has-error input, .has-error textarea { border-color: var(--err); }
.err { color: var(--err); font-size: 14px; margin: 6px 0 0; }

.choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; margin: 0;
}
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin-top: 4px; flex: none; }
.choice strong { display: block; font-weight: 550; }
.choice em { display: block; font-style: normal; color: var(--muted); font-size: 14px; margin-top: 2px; }

.repeater { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; background: var(--surface); }
.repeater legend { font-weight: 600; padding: 0 6px; }
.row-item { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.row-item:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 14px; }

button, .secondary {
  font: inherit; font-weight: 550; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none; display: inline-block;
}
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: 14px; }
.actions { display: flex; gap: 10px; align-items: center; margin: 28px 0 8px; }
.actions button { margin-left: auto; }
.saved { color: var(--muted); font-size: 13px; }

.banner { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface);
  padding: 12px 14px; border-radius: var(--radius); margin: 16px 0; }
.banner.error { border-left-color: var(--err); }
.banner.info { border-left-color: var(--ok); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.linkbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }

.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { text-align: left; color: var(--muted); font-weight: 550; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px; border-bottom: 1px solid var(--line); }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--line); color: var(--muted); }
.pill.submitted { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.pill.reviewed { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

.newclient { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 26px; }
.newclient input { flex: 1 1 180px; width: auto; }

/* Irreversible and it takes real client files with it, so it should not look
   like the buttons next to it. */
.panel.danger { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); margin-top: 36px; }
.panel.danger h2 { color: var(--err); }
button.destructive { background: var(--err); color: #fff; }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; }
.row-actions button { padding: 6px 12px; font-size: 14px; }

.answers { margin: 0; }
.answers dt { font-weight: 550; margin-top: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
/* pre-wrap belongs on the value itself, not the container - on the container
   it renders the template's own indentation as blank lines. */
.answers dd { margin: 3px 0 0; color: var(--ink); }
.val { white-space: pre-wrap; }
.lands { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.subrow { border-left: 2px solid var(--line); padding-left: 12px; margin: 10px 0; }
.kv { display: flex; gap: 10px; font-size: 14px; padding: 2px 0; }
.kv .k { color: var(--muted); min-width: 190px; flex: none; }
.masked { color: var(--muted); }

.done { padding: 20px 0 40px; }
.next { color: var(--muted); padding-left: 20px; }
.next li { margin: 8px 0; }
.note-block { border-left: 3px solid var(--err); padding: 10px 14px; background: var(--surface); border-radius: var(--radius); }

/* Letter of authorization — the on-screen view is also the printed one. */
.loa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.loa h1 { font-size: 22px; margin-top: 0; }
.loa-date { color: var(--muted); }
.loa-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.loa-table th { text-align: left; width: 38%; vertical-align: top; padding: 7px 10px 7px 0; font-weight: 550; border-bottom: 1px solid var(--line); }
.loa-table td { padding: 7px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; }
.tiny { font-weight: 400; font-size: 12px; color: var(--muted); }
.loa-numbers { columns: 3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.loa-warn { border-left: 3px solid var(--err); padding: 8px 12px; }
.loa-sign { display: flex; gap: 40px; margin: 40px 0 10px; }
.loa-sign div { flex: 1; }
.loa-sign .line { display: block; border-bottom: 1px solid var(--ink); height: 34px; }
.loa-sign label { font-size: 12px; color: var(--muted); margin-top: 4px; }

@media print {
  .top, .foot, .noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .loa { border: 0; padding: 0; }
  .wrap { max-width: none; padding: 0; }
}

@media (max-width: 560px) {
  .kv { display: block; }
  .kv .k { min-width: 0; display: block; }
  .loa-numbers { columns: 2; }
  .loa { padding: 18px; }
}

/* Prospect vs client */
.pill.prospect { background: color-mix(in srgb, #b7791f 18%, transparent); color: #b7791f; }
.pill.client   { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.banner .quote { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--line); color: var(--muted); }

/* ------------------------------------------------------------------
   Client form (body.intake). One long page, so the job of the styling
   is to make it feel short: each section is its own card, a sticky
   header shows how far along they are, and on a wide screen a section
   list down the side ticks itself off.
   ------------------------------------------------------------------ */
body.intake .wrap { max-width: 1014px; }
body.intake main.wrap { padding-bottom: 8px; }

/* Sticky header with the progress line along its bottom edge. */
body.intake .top { position: sticky; top: 0; z-index: 20; padding: 0; }
body.intake .top .row { align-items: center; padding: 13px 16px; }
body.intake .top .note { padding-left: 12px; border-left: 1px solid var(--line); }
.top-progress { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.top-progress .pct { font-weight: 700; color: var(--ink); }
.progress-line { height: 3px; background: var(--line); }
.progress-line .bar { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.progress-line .bar.full { background: var(--ok); }

/* Hero */
.hero { max-width: 720px; padding: 34px 0 6px; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(28px, 4.2vw, 38px); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 12px; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 16px; max-width: 62ch; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; }
.chips li {
  font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 5px 12px 5px 26px; position: relative;
}
.chips li::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--ok);
}
body.intake .banner { max-width: 720px; box-shadow: var(--shadow); }

/* Two columns on a wide screen: section list + form. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 22px; }
.toc { display: none; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: 230px minmax(0, 720px); }
  .toc { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; }
}
.toc-title { margin: 4px 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li:not([hidden]) { counter-increment: toc; }
.toc li[hidden] { display: none; }
.toc a {
  display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.3;
}
.toc a:hover { background: var(--surface); color: var(--ink); }
.toc .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface);
}
.toc .dot::before { content: counter(toc); }
.toc li.is-current a { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.toc li.is-current .dot { border-color: var(--accent); color: var(--accent); }
.toc li.is-done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.toc li.is-done .dot::before { content: "\2713"; }

/* Sections as cards, numbered by CSS so hidden ones don't leave gaps. */
form.onepage { counter-reset: sec; min-width: 0; }
.section {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 26px 28px 8px; margin: 0 0 18px; scroll-margin-top: 80px;
}
.section:not([hidden]) { counter-increment: sec; }
.sec-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.sec-head > div { flex: 1; min-width: 0; }
.sec-head h2 { font-size: 20px; letter-spacing: -0.015em; margin: 1px 0 4px; }
.sec-head .intro { margin: 0; font-size: 15px; }
.badge {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 14px;
  transition: background .2s, color .2s;
}
.badge::before { content: counter(sec); }
.section.is-done .badge { background: var(--ok); color: #fff; }
.section.is-done .badge::before { content: "\2713"; }
.sec-state { flex: none; font-size: 12px; font-weight: 650; color: var(--ok); padding-top: 7px; }
.q { scroll-margin-top: 96px; }
.q[hidden], .section[hidden] { display: none; }

/* Fields */
body.intake .field { margin: 0 0 24px; }
body.intake label { font-weight: 600; margin-bottom: 6px; }
body.intake .req { color: var(--err); font-weight: 600; }
body.intake .help { margin: -2px 0 9px; line-height: 1.5; }
body.intake input[type=text], body.intake input[type=email], body.intake input[type=tel],
body.intake input[type=number], body.intake input[type=date], body.intake input[type=password],
body.intake textarea, body.intake select {
  min-height: 46px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
body.intake input:hover, body.intake textarea:hover, body.intake select:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
body.intake input:focus, body.intake textarea:focus, body.intake select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
body.intake input[type=file] {
  width: 100%; padding: 16px; border: 1.5px dashed var(--line); border-radius: 10px;
  background: var(--bg); color: var(--muted); font-size: 14px; cursor: pointer;
}
body.intake input[type=file]:hover { border-color: var(--accent); }
body.intake input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 12px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
body.intake .held { display: inline-block; background: var(--ok-soft); padding: 3px 10px; border-radius: 99px; margin-bottom: 8px; }
body.intake .has-error input, body.intake .has-error textarea, body.intake .has-error select { border-color: var(--err); }
body.intake .has-error .choice { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); }

/* Radio and checkbox cards with our own indicator. */
body.intake .choices { gap: 10px; }
body.intake .choice {
  align-items: flex-start; padding: 14px 16px; border-radius: 12px; transition: border-color .15s, background .15s;
}
body.intake .choice:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
body.intake .choice:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
body.intake .choice:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
body.intake .choice input {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 1px 0 0;
  border: 1.5px solid color-mix(in srgb, var(--muted) 60%, var(--line)); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s;
}
body.intake .choice input[type=radio] { border-radius: 50%; }
body.intake .choice input[type=checkbox] { border-radius: 6px; }
body.intake .choice input:checked { border-color: var(--accent); background: var(--accent); }
body.intake .choice input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
body.intake .choice input[type=checkbox]:checked::after { content: "\2713"; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
body.intake .choice strong { font-weight: 600; }

/* Repeating groups (locations, carriers, people...) */
body.intake .repeater { border: 0; padding: 0; background: none; }
body.intake .repeater legend { font-weight: 600; padding: 0; margin-bottom: 10px; }
body.intake .rows { display: grid; gap: 12px; margin-bottom: 12px; }
body.intake .row-item, body.intake .row-item:first-child {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 0; margin: 0; background: var(--bg);
}
body.intake .row-head { font-weight: 650; color: var(--ink); font-size: 14px; }
body.intake .remove-row { color: var(--err); }
body.intake .add-row {
  width: 100%; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: none;
  color: var(--accent); padding: 12px; border-radius: 12px;
}
body.intake .add-row::before { content: "+ "; font-weight: 700; }
body.intake .add-row:hover { background: var(--accent-soft); }

/* Buttons */
body.intake button { transition: background .15s, border-color .15s, transform .05s; }
body.intake button:not(.link):not(.secondary):hover { background: var(--accent-d); }
body.intake button:active { transform: translateY(1px); }
body.intake .secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Submit bar: always reachable on a long page. */
.submitbar {
  position: sticky; bottom: 12px; z-index: 10; display: flex; gap: 10px; align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(13, 21, 38, .12);
  padding: 12px 12px 12px 18px; margin: 8px 0 20px;
}
.submitbar button { padding: 11px 20px; }
.autosave { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-right: auto; min-width: 0; }
.autosave .pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.autosave.saving .pulse { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.autosave.failed .pulse { background: var(--err); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .autosave.saving .pulse { animation: none; } }
ul.missing { margin: 8px 0 0; padding-left: 18px; }
ul.missing li { margin: 3px 0; }

/* Thank-you page */
body.intake .done {
  max-width: 720px; margin: 34px 0 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 30px 32px;
}
body.intake .done h1 { margin-top: 0; letter-spacing: -0.025em; }

@media (max-width: 640px) {
  .hero { padding-top: 22px; }
  .section { padding: 20px 16px 4px; border-radius: 12px; }
  .sec-head { gap: 12px; }
  .badge { width: 28px; height: 28px; font-size: 13px; }
  body.intake .row-item, body.intake .row-item:first-child { padding: 14px 12px 0; }
  body.intake .top .note { display: none; }
  .submitbar { flex-wrap: wrap; bottom: 8px; padding: 10px; }
  .submitbar .autosave { flex-basis: 100%; padding: 0 4px; }
  .submitbar button { flex: 1; }
  body.intake .done { padding: 22px 18px; }
}

/* Public sign-up page (/intake/start) */
.start { display: grid; gap: 28px; padding: 36px 0 20px; align-items: start; }
@media (min-width: 900px) { .start { grid-template-columns: minmax(0, 1fr) 420px; gap: 56px; padding-top: 64px; } }
.start h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 14px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: "\2713"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.start-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(13, 21, 38, .08); padding: 28px;
}
.start-card h2 { margin: 0 0 18px; font-size: 20px; letter-spacing: -0.015em; }
.start-card .field { margin-bottom: 16px; }
.start-card .banner { margin: 0 0 16px; }
.start-card .opt { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.start-card .cf-turnstile { margin: 4px 0 14px; min-height: 65px; }
.start-card .go { width: 100%; padding: 14px; font-size: 17px; border-radius: 12px; }
.start-card .fine { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .start-card { padding: 20px 16px; } }

.welcome .copyrow { display: flex; gap: 8px; margin-top: 10px; }
.welcome .copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 40px; padding: 8px 10px; }
.welcome .copyrow button { padding: 8px 14px; }

.pill.web { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
