/* Look and layout carried over from the customer's Sales Package Builder. Fonts are self-hosted. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2") }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2") }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2") }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url(/fonts/source-serif-4-latin-600-normal.woff2) format("woff2") }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url(/fonts/source-serif-4-latin-700-normal.woff2) format("woff2") }
/* Typed signatures (SIL Open Font License, see fonts/LICENSE-dancing-script.txt) */
@font-face { font-family: "Dancing Script"; font-weight: 600; font-display: swap; src: url(/fonts/dancing-script-latin-600-normal.woff2) format("woff2") }
:root {
  --bg: #f4f6f9; --surface: #ffffff; --sunk: #eef1f5; --ink: #14233a; --muted: #5a6577; --line: #d9dfe8;
  --navy: #163259; --navy-ink: #ffffff; --brass: #a8752a; --ok: #2c7a4b; --warn: #9a5f12; --bad: #b13a3a;
  --ok-bg: #e6f3ec; --warn-bg: #fbf1e2; --bad-bg: #f9e7e7;
  --f-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 8px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0e141d; --surface: #161f2c; --sunk: #111924; --ink: #e5eaf1; --muted: #98a4b6; --line: #2a3546;
  --navy: #8fb2ec; --navy-ink: #0e141d; --brass: #d7a557; --ok: #6cc795; --warn: #e3a95a; --bad: #ee8585;
  --ok-bg: #16301f; --warn-bg: #33270f; --bad-bg: #3a1a1a; color-scheme: dark } }
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.5 }
a { color: var(--navy) }
.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px }
.wrap.narrow { max-width: 460px; padding-top: 8vh }
header.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 20px }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); font-weight: 600 }
h1 { font-family: var(--f-head); font-size: 28px; margin: 2px 0 0; color: var(--ink); text-wrap: balance }
h2 { font-family: var(--f-head); font-size: 19px; margin: 0; text-wrap: balance }
h3 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) }
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 10px; align-items: center }
nav.tabs a, nav.tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 7px; font: 500 14px var(--f-body); cursor: pointer; text-decoration: none }
nav.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08) }
nav.tabs form { margin: 0 }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px }
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap }
.num { font: 600 12px var(--f-body); color: var(--brass); letter-spacing: .08em; min-width: 22px }
.hint { color: var(--muted); font-size: 13px }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0 }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=password], input[type=number], input[type=url], input[type=time], input:not([type]), select, textarea {
  font: 14px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0 }
input.code { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums }
textarea { resize: vertical; min-height: 70px; line-height: 1.4 }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .choice:focus-within { outline: 2px solid var(--brass); outline-offset: 1px }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.stack { display: flex; flex-direction: column; gap: 12px }
.settings > p { margin: 0 }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.spread { justify-content: space-between }
.btn { font: 600 14px var(--f-body); border-radius: 7px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; display: inline-block; white-space: nowrap; text-align: center }
.btn.primary { background: var(--navy); color: var(--navy-ink); border-color: var(--navy) }
.btn.danger { color: var(--bad); border-color: var(--bad) }
.btn.small { padding: 5px 10px; font-size: 13px }
.btn:disabled { opacity: .5; cursor: not-allowed }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) }
.choice { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start }
.choice input { margin-top: 3px; accent-color: var(--navy) }
.choice b { display: block; font-size: 14px }
.choice span { color: var(--muted); font-size: 12.5px }
.choice:has(input:checked) { border-color: var(--navy); background: var(--sunk) }
.ticks { display: flex; flex-wrap: wrap; gap: 6px 14px }
.ticks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; cursor: pointer }
.ticks input { accent-color: var(--navy); width: 16px; height: 16px }
.ticks.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) }
.drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--sunk) }
.drop.over { border-color: var(--navy); color: var(--ink) }
.drop input { display: block; margin: 10px auto 0; max-width: 100% }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px }
.files li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 0 }
.files .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--sunk); color: var(--muted) }
.pill.ok { background: var(--ok-bg); color: var(--ok) } .pill.warn { background: var(--warn-bg); color: var(--warn) } .pill.bad { background: var(--bad-bg); color: var(--bad) }
.note { border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; margin: 10px 0 }
.note.warn { background: var(--warn-bg); color: var(--warn) } .note.bad { background: var(--bad-bg); color: var(--bad) } .note.ok { background: var(--ok-bg); color: var(--ok) }
.progress { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--muted) }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: sp 0.9s linear infinite }
@keyframes sp { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s } }
.summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px }
.summary div { background: var(--sunk); border-radius: 6px; padding: 10px 12px; min-width: 0 }
.summary small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em }
.summary strong { display: block; overflow-wrap: anywhere }
.todo { margin: 6px 0 0; padding-left: 20px } .todo li { margin: 3px 0 }
details.sec { border: 1px solid var(--line); border-radius: 6px; margin-top: 8px }
details.sec > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px }
details.sec > div { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px }
.frow { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 10px; align-items: start }
.frow .lab { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; padding-top: 7px }
.frow .lab code { display: block; font-size: 11px; color: var(--muted); opacity: .8 }
.frow .src { grid-column: 2; font-size: 12px; color: var(--muted); margin-top: -4px; overflow-wrap: anywhere }
.frow .src.flag { color: var(--warn) }
.frow.flagged { background: var(--warn-bg); border-radius: 6px; padding: 6px }
@media (max-width: 560px) { .frow { grid-template-columns: 1fr } .frow .lab { padding-top: 0 } .frow .src { grid-column: 1 } }
.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px }
.item { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); text-decoration: none; color: inherit }
a.item:hover { border-color: var(--navy) }
.item .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere }
.empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0 }
.qr { background: #fff; padding: 10px; border-radius: 8px; width: 220px; height: 220px; display: block }
.secret { font: 600 15px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; background: var(--sunk); padding: 8px 10px; border-radius: 6px }
table.data { width: 100%; border-collapse: collapse; font-size: 13px }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap }
table.data td.actions { text-align: right; width: 1%; vertical-align: middle; padding-block: 3px }
table.data td.who { min-width: 170px; overflow-wrap: anywhere }
table.data td.who .sub { display: block; color: var(--muted); font-size: 12.5px }
/* A table never spills out of its card: if it is still too wide, it scrolls sideways inside it. */
.step:has(> table.data) { overflow-x: auto }
.nw { white-space: nowrap }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
/* Tablets and phones: each row of a wide table becomes a labelled card (labels come from data-label). */
@media (max-width: 960px) {
  table.data.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: auto }
  table.data.cards tr { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin-bottom: 10px; background: var(--surface) }
  table.data.cards tr:last-child { margin-bottom: 0 }
  .step:has(> table.data.cards) { border: 0; padding: 0; background: transparent; overflow: visible }
  table.data.cards td { border: 0; padding: 3px 0 3px 118px; position: relative; min-height: 26px; overflow-wrap: anywhere }
  table.data.cards td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 108px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; overflow-wrap: normal }
  table.data.cards td.card-title, table.data.cards td.actions { padding-left: 0; font-size: 15px; font-weight: 600 }
  table.data.cards td.who .sub { font-weight: 400; font-size: 13px; margin-bottom: 4px }
  table.data.cards td.actions { text-align: left; width: auto; padding-top: 8px }
  table.data.cards td.actions:empty { display: none }
}
.tabular { font-variant-numeric: tabular-nums }
/* Signing */
.doc-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk) }
.sigpad { display: flex; flex-direction: column; gap: 10px }
.sigcanvas { width: 100%; height: 160px; background: #fff; border: 1.5px dashed var(--line); border-radius: 6px; touch-action: none; display: block }
.sigpreview { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; max-width: 320px; max-height: 110px; display: block }
.sig-font, .sigpad input[name=sig_text] { font-family: "Dancing Script", "Segoe Script", cursive; font-weight: 600; font-size: 28px; color: #14233a }
.sigpreview.sig-font { padding: 8px 14px; font-size: 32px; line-height: 1.3 }
.sigpad input[name=sig_text] { background: #fff; padding: 6px 12px }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--navy) }
.doc-open { display: flex; flex-direction: column; gap: 6px; align-items: flex-start }
/* Phones can't show a PDF inside the page: show the "open" button only. */
@media (max-width: 560px) { .doc-frame { display: none } .doc-open .btn { width: 100%; text-align: center; padding: 14px } .sigcanvas { height: 150px } }

/* The admin panel gets a distinct header colour so it is never mistaken for the advisor panel. */
body.admin header.top { border-bottom-color: var(--brass) }
body.admin .eyebrow { color: var(--navy) }
/* Admin pages hold wide tables: give them more room on laptops. */
body.admin .wrap { max-width: 1180px }
.mt { margin-top: 14px } .mb { margin-bottom: 14px } .nowrap { flex-wrap: nowrap }

/* Phones: a little less padding, a smaller page title, and 16px inputs so iPhones don't zoom in on focus. */
@media (max-width: 560px) {
  .wrap { padding: 14px 12px 48px }
  .step { padding: 14px }
  h1 { font-size: 23px }
  input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=password], input[type=number], input[type=url], input[type=time], input:not([type]), select, textarea { font-size: 16px }
  input.code { font-size: 22px }
  /* a long button label may wrap on a small phone; small buttons (Delete, Cancel) never do */
  .btn { white-space: normal } .btn.small { white-space: nowrap }
  nav.tabs { width: 100% }
  nav.tabs a, nav.tabs button { padding: 8px 11px }
}
