/* C3A onboarding. Garnet, gold, navy, white. No external fonts: banks often block them. */
:root {
  --navy: #14213d; --navy-2: #22335a; --garnet: #7a1f2b; --gold: #c9a227; --gold-soft: #f6ecc9;
  --white: #ffffff; --paper: #f4f5f8; --ink: #1b2233; --muted: #5d6578; --line: #d9dde6; --ok: #1f6b45;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 520px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: 13px; } .muted { color: var(--muted); } .mono { font-family: var(--mono); }

/* masthead */
.mast { background: var(--navy); color: var(--white); padding: 22px 0 20px; border-bottom: 4px solid var(--gold); }
.brand { font-size: 13px; letter-spacing: .04em; color: var(--gold); }
.mast h1 { font: 600 30px/1.15 var(--serif); margin: 4px 0 6px; }
.mastsub { margin: 0; color: #c9d1e3; max-width: 70ch; }
.mastnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mastnav a { color: var(--white); text-decoration: none; border: 1px solid #45557d; padding: 6px 12px; border-radius: 4px; font-size: 14px; }
.mastnav a:hover { border-color: var(--gold); }

/* cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; margin: 20px 0; }
.card h2 { font: 600 22px/1.2 var(--serif); margin: 0 0 6px; color: var(--navy); }
.card h3 { font: 600 16px/1.3 var(--sans); margin: 18px 0 8px; color: var(--navy); }
.intro { color: var(--muted); margin: 0 0 16px; max-width: 75ch; }
.notice { border-left: 6px solid var(--gold); }
.err { color: var(--garnet); font-weight: 600; }
.empty { color: var(--muted); }

/* intake layout */
.sections { min-width: 0; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 16px; padding-top: 20px; }
.toc-progress { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.toc-progress progress { width: 100%; display: block; margin-bottom: 4px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 22px; text-decoration: none; color: var(--ink); font-size: 14px; position: relative; margin-left: -2px; border-left: 2px solid transparent; }
.toc a::before { content: ""; position: absolute; left: 7px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.toc a.partial::before { background: var(--gold); }
.toc a.done::before { background: var(--navy); }
.toc a[aria-current] { border-left-color: var(--garnet); font-weight: 600; }
progress { height: 8px; accent-color: var(--gold); width: 120px; vertical-align: middle; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.saved { margin: 0; font-size: 13px; color: var(--muted); }
.cross { border-left: 6px solid var(--garnet); }
.cross ul, .issues ul, .warn { margin: 6px 0 0; padding-left: 20px; }
.cross li, .warn li { color: var(--garnet); }

/* fields */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide, .multi, .grid-field, .agree { grid-column: 1 / -1; }
label, legend { font-weight: 600; font-size: 14px; }
.req { font-weight: 500; font-size: 12px; color: var(--garnet); margin-left: 8px; }
.src { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.star { color: var(--garnet); }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #b9c0cf; border-radius: 4px; padding: 8px 10px; background: var(--white); width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:invalid:not(:placeholder-shown) { border-color: var(--garnet); }
.money { display: flex; align-items: center; border: 1px solid #b9c0cf; border-radius: 4px; background: var(--white); }
.money span { padding-left: 10px; color: var(--muted); }
.money input { border: 0; padding-left: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.money:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.money input:focus-visible { outline: none; }
fieldset.multi, fieldset.countries { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 16px; margin-top: 6px; }
.checks label, .agree { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.checks input, .agree input { width: auto; margin-top: 4px; accent-color: var(--navy); }

/* grids */
.grid-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.grid-head h3 { margin: 6px 0; }
.hint { font-size: 13px; color: var(--muted); }
.tablewrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; }
.grid th, .list th { background: #eef0f5; color: var(--navy); font-size: 12.5px; font-weight: 600; text-align: left; padding: 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.grid td { padding: 4px; border-bottom: 1px solid #eceef3; vertical-align: top; min-width: 150px; }
.grid td:has(select) { min-width: 170px; }
.grid td input, .grid td select { padding: 6px 8px; font-size: 14px; }
.grid td.n, .grid th.n { min-width: 0; width: 34px; text-align: right; color: var(--muted); font-size: 13px; padding-top: 11px; }
.grid td.act, .grid th.act { min-width: 84px; width: 84px; }
.grid tbody tr:empty { display: none; }
.raci td { min-width: 76px; text-align: center; }
.raci th[scope=row] { white-space: normal; min-width: 220px; background: var(--white); font-weight: 500; color: var(--ink); }
.raci-cell { text-align: center; }
.grid-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* buttons */
button { font: 600 14px var(--sans); background: var(--navy); color: var(--white); border: 0; border-radius: 4px; padding: 9px 16px; cursor: pointer; }
button:hover { background: var(--navy-2); }
button.ghost { background: var(--white); color: var(--navy); border: 1px solid var(--navy); }
button.ghost:hover { background: #eef0f5; }
button.quiet { border-color: var(--line); color: var(--muted); }
button.x { background: none; color: var(--garnet); padding: 6px; font-weight: 500; font-size: 13px; }
button.x:hover { text-decoration: underline; background: none; }
.sec-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); } .status.bad { color: var(--garnet); font-weight: 600; } .status.pending { color: #8a6d0b; }
.issues { margin-top: 18px; background: var(--gold-soft); border-radius: 4px; padding: 12px 16px; }
.issues h3 { margin: 0; font-size: 14px; }
.issues li { font-size: 14px; }

/* lists and pills */
.list td { padding: 8px; border-bottom: 1px solid #eceef3; vertical-align: top; font-size: 14px; }
.list .acts a { margin-right: 10px; white-space: nowrap; }
.mini { display: inline; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eceef3; color: var(--muted); }
.pill.in_review { background: var(--gold-soft); color: #6d5609; }
.pill.signed { background: #dcefe4; color: var(--ok); }
.pill.stale { background: #f6dfe2; color: var(--garnet); }
.inline-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 240px; }
.linkline { display: flex; gap: 8px; }
.linkline input { font-family: var(--mono); font-size: 13px; }
.signout { margin: 0 0 40px; text-align: right; }
.fingerprint { font-size: 13px; color: var(--muted); word-break: break-all; }
.fingerprint code { color: var(--ink); }
.signform { margin-top: 18px; }

/* document */
.doc-body { max-width: 1000px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 10px 0; }
.facts dt { font-size: 13px; color: var(--muted); } .facts dd { margin: 2px 0 0; font: 600 18px var(--serif); color: var(--navy); }
.docsec h2 .num { display: inline-block; min-width: 1.6em; color: var(--gold); }
.answers { display: grid; grid-template-columns: minmax(200px, 38%) 1fr; margin: 0; border-top: 1px solid var(--line); }
.answers > div { display: contents; }
.answers dt, .answers dd { padding: 8px 0; border-bottom: 1px solid #eceef3; margin: 0; }
.answers dt { color: var(--muted); padding-right: 16px; }
.blank { color: #9097a8; font-style: italic; }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.raci-doc td { text-align: center; } .raci-doc td.acc { background: var(--gold-soft); font-weight: 700; }
.raci-doc th[scope=row] { white-space: normal; background: var(--white); color: var(--ink); font-weight: 500; }
.foot { margin: 10px 0 40px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 10px; border: 0; }
  .toc a { padding-left: 18px; border: 0; }
  .toc a::before { left: 4px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .card { padding: 18px 16px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .mast h1 { font-size: 24px; }
  .answers { grid-template-columns: minmax(0, 1fr); }
  .answers dt { border-bottom: 0; padding-bottom: 0; }
  .linkline { flex-direction: column; }
}
@media print {
  body { background: var(--white); font-size: 11pt; }
  .mast { background: none; color: var(--ink); border-bottom: 2px solid var(--navy); padding: 0 0 8px; }
  .mastnav, .signout, button { display: none !important; }
  .mastsub { color: var(--muted); } .brand { color: var(--garnet); }
  .card { border: 0; padding: 0; margin: 14pt 0; break-inside: auto; }
  .docsec { break-before: auto; }
  .docsec h2 { break-after: avoid; }
  .tablewrap { overflow: visible; border: 0; }
  tr { break-inside: avoid; }
  .list th, .list td { font-size: 7.5pt; padding: 3px 4px; white-space: normal; word-break: break-word; }
  .answers dt, .answers dd { padding: 4px 0; }
  .doc-body { max-width: none; padding: 0; }
  .history { break-before: page; }
  h3 { break-after: avoid; }
}

/* the "i" help, format errors, country chips, address check */
.lblrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
legend { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; padding: 0; }
.grid-head { justify-content: flex-start; }
.grid-head .hint { margin-left: auto; }
button.info { flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: var(--white); color: var(--navy);
  border: 1.5px solid var(--navy); font: italic 700 13px/1 var(--serif); cursor: pointer; }
button.info:hover, button.info[aria-expanded="true"] { background: var(--navy); color: var(--white); }
.help { background: #eef2fa; border-left: 3px solid var(--navy); border-radius: 4px; padding: 10px 12px; margin: 2px 0 6px; font-size: 13.5px; color: var(--ink); }
.help p { margin: 0; }
.help dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.help dt { font-weight: 600; } .help dd { margin: 0; }
.fielderr { font-size: 12.5px; color: var(--garnet); min-height: 0; }
.fielderr:empty { display: none; }
[aria-invalid="true"], .money:has([aria-invalid="true"]) { border-color: var(--garnet) !important; box-shadow: 0 0 0 1px var(--garnet); }
.money [aria-invalid="true"] { box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips:empty::before { content: "None chosen yet"; color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef0f5; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13.5px; }
.chip .x { padding: 0 6px; font-size: 16px; line-height: 1; }
.addrow select { max-width: 320px; }
.derived p { margin: 4px 0 0; font-size: 14px; }
.okline { color: var(--ok); } .badline { color: var(--garnet); font-weight: 600; }
@media (max-width: 640px) { .help dl { grid-template-columns: 1fr; } }

/* agreements */
.sitefoot { padding: 18px 0 30px; font-size: 13px; }
.sitefoot a { color: var(--muted); margin-right: 16px; }
.steps li { margin: 6px 0; max-width: 80ch; }
.printbtn { background: var(--gold); color: var(--navy); }
.printbtn:hover { background: #d9b440; }
.paper { max-width: 820px; margin: 24px auto 40px; background: var(--white); border: 1px solid var(--line); padding: 48px 56px;
  font: 16px/1.6 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; color: #111827; }
.paper h1 { font-size: 26px; text-align: center; color: var(--navy); margin: 0 0 18px; }
.paper h2 { font: 700 16px/1.3 var(--sans); color: var(--navy); margin: 26px 0 8px; }
.paper p, .paper li { margin: 0 0 10px; }
.draft-banner { border: 2px solid var(--garnet); color: var(--garnet); font: 700 14px/1.4 var(--sans); padding: 10px 14px; text-align: center; margin-bottom: 22px !important; }
mark.ph { background: #fff1b8; color: #5c4400; padding: 0 3px; border-radius: 2px; font-family: var(--sans); font-size: .85em; }
.counsel { border-left: 4px solid var(--garnet); background: #fbf1f2; color: var(--garnet); padding: 8px 12px; font: 14px/1.5 var(--sans); }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font: 14px/1.45 var(--sans); }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 7px 9px; vertical-align: top; text-align: left; }
.doc-table th { background: #eef0f5; color: var(--navy); width: 30%; }
.doc-table.qa th { width: auto; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 34px; break-inside: avoid; }
.sig .party { font-weight: 700; margin-bottom: 14px; }
.sig .line { border-bottom: 1px solid #9aa3b5; padding: 14px 0 2px; font: 13px var(--sans); color: var(--muted); }
.ds { color: #ffffff; font-size: 1px; }
.hint-name { color: #9aa3b5; font-size: 12px; }
@media (max-width: 700px) { .paper { padding: 24px 18px; margin: 0; border: 0; } .sigs { grid-template-columns: 1fr; } }
@media print {
  .noprint { display: none !important; }
  .paper { border: 0; padding: 0; margin: 0; max-width: none; font-size: 11pt; }
  @page { margin: 0.8in; }
  mark.ph { background: #fff1b8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
