/* Customer onboarding portal. Served as a static file so the portal can run
   under a strict Content Security Policy (no inline styles or scripts).
   Palette follows the existing customer sign-off page and emails. */

:root {
    --bg: #f7f6f1;
    --ink: #1e2620;
    --muted: #5f6a5e;
    --faint: #82887c;
    --line: #e4e0d3;
    --line-soft: #f0ede2;
    --card: #ffffff;
    --brand: #12211a;
    --brand-ink: #f4f1e8;
    --accent: #1e3327;
    --accent-hover: #274233;
    --link: #1a5aa3;
    --ok-bg: #e2f2e6; --ok: #2f6b45;
    --na-bg: #efeaf6; --na: #5f4a85;
    --out-bg: #fbe9d5; --out: #8a560c;
    --warn-bg: #fdf8ec; --warn-line: #f0d8a8; --warn: #6d5100;
    --err-bg: #fbe8e7; --err-line: #f0c4c2; --err: #8a2222;
    --info-bg: #eef4fb; --info-line: #cfe0f3; --info: #184f95;
    --focus: #1a5aa3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

/* Header */
.top { background: var(--brand); color: var(--brand-ink); }
.top-in { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--brand-ink); text-decoration: none; }
.brand .the { font-size: 10px; letter-spacing: 0.16em; color: #b5c2b1; display: block; }
.brand .nm { font-size: 15px; font-weight: 700; line-height: 1.2; display: block; }
.brand .sep { width: 1px; height: 28px; background: rgba(255,255,255,0.25); }
.brand .ctx { font-size: 14px; color: #d3dccf; }
.usermenu { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.usermenu a { color: var(--brand-ink); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-ink); text-decoration: underline; cursor: pointer; }

/* Layout */
main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }
main.narrow { max-width: 560px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; color: var(--faint); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14.5px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }

/* Project navigation */
.projhead { margin-bottom: 18px; }
.projhead .eyebrow { font-size: 13px; color: var(--faint); margin: 0 0 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 16px 0 22px; padding: 0; list-style: none; }
.tabs a { display: inline-block; padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { color: var(--ink); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }

/* Panels */
.panel { border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; border: 1px solid; }
.panel.needs { background: var(--warn-bg); border-color: var(--warn-line); }
.panel.needs h2 { color: var(--warn); }
.panel.doing { background: var(--info-bg); border-color: var(--info-line); }
.panel.doing h2 { color: var(--info); }
.panel ul { margin: 8px 0 0; padding-left: 20px; }
.panel li { margin-bottom: 6px; }

/* Stage list / timeline */
.stages { list-style: none; margin: 0; padding: 0; }
.stage { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.stage:last-child { border-bottom: 0; }
.stage .num { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: #eef1f4; color: #45505e; }
.stage.is-complete .num { background: var(--ok-bg); color: var(--ok); }
.stage.is-current .num { background: var(--accent); color: #fff; }
.stage .nm { font-weight: 700; }
.stage .desc { font-size: 14px; color: var(--muted); margin-top: 2px; }
.stage .dates { font-size: 13px; color: var(--faint); margin-top: 4px; }
.stage .reopened { font-size: 14px; margin-top: 8px; padding: 10px 12px; background: var(--info-bg); border-radius: 8px; border: 1px solid var(--info-line); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.complete { background: var(--ok-bg); color: var(--ok); }
.chip.in_progress { background: var(--info-bg); color: var(--info); }
.chip.action_needed, .chip.awaiting_confirmation { background: var(--out-bg); color: var(--out); }
.chip.not_started { background: #eef1f4; color: #45505e; }

/* Item lists */
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.items li { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; font-size: 12px; font-weight: 800; }
.mark.complete { background: var(--ok-bg); color: var(--ok); }
.mark.not_applicable { background: var(--na-bg); color: var(--na); }
.mark.outstanding { background: var(--out-bg); color: var(--out); }
.items .lbl { font-weight: 600; }
.items .why { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* Confirmation */
.assert { background: #f4f7f3; border: 1px solid #dce6d9; border-radius: 11px; padding: 16px 18px; margin-bottom: 16px; }
.assert p { margin: 0 0 10px; }
.assert p:last-child { margin: 0; }
.outblock { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 11px; padding: 16px 18px; margin-bottom: 16px; color: var(--warn); }
.acceptance { border: 2px solid var(--accent); border-radius: 11px; padding: 14px 16px; margin-bottom: 16px; font-weight: 600; }
.clauses { font-size: 13.5px; color: var(--muted); }
.clauses p { margin: 0 0 8px; }

/* Messages */
.thread { list-style: none; margin: 0 0 18px; padding: 0; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.msg.from-us { background: #f4f7f3; border-color: #dce6d9; }
.msg .meta { font-size: 13px; color: var(--faint); margin-bottom: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.msg .who { font-weight: 700; color: var(--ink); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { font-size: 11.5px; font-weight: 700; background: var(--out-bg); color: var(--out); padding: 1px 8px; border-radius: 999px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
@media (max-width: 640px) {
    table.list thead { display: none; }
    table.list tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
    table.list td { display: block; border: 0; padding: 2px 0; }
    table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--faint); font-size: 13px; }
}

/* Forms */
form.stack > * + * { margin-top: 14px; }
label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 5px; }
.hint { font-size: 13.5px; color: var(--muted); margin: -2px 0 6px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea, select, input[type=file] {
    width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid #cfc9b6; border-radius: 9px; padding: 11px 13px;
}
input[type=file] { padding: 9px; }
textarea { min-height: 130px; resize: vertical; }
input.code { font-size: 22px; letter-spacing: 0.3em; max-width: 220px; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 11px; align-items: flex-start; background: #fff; border: 1.5px solid #cfc9b6; border-radius: 10px; padding: 14px 16px; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 20px; accent-color: var(--accent); }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 13px 24px; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid #cfc9b6; }
.btn.secondary:hover { background: #f4f2ea; }
.btn.danger { background: #fff; color: var(--err); border: 1.5px solid var(--err-line); }
.btn.small { padding: 7px 12px; font-size: 13.5px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
details.concern { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.concern summary { cursor: pointer; font-weight: 700; color: #8a3b3b; }
details.concern[open] summary { margin-bottom: 12px; }

/* Notices */
.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid; font-size: 15px; }
.notice.ok { background: var(--ok-bg); border-color: #c7e3cf; color: var(--ok); }
.notice.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.field-error { color: var(--err); font-size: 14px; margin-top: 5px; font-weight: 600; }

/* Enrolment */
.qr { background: #fff; padding: 12px; display: inline-block; border: 1px solid var(--line); border-radius: 10px; }
.qr svg { display: block; width: 192px; height: 192px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: 0.08em; background: #f4f2ea; padding: 8px 12px; border-radius: 8px; display: inline-block; overflow-wrap: anywhere; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.codes li { background: #f4f2ea; padding: 8px 10px; border-radius: 8px; text-align: center; }
.steps { font-size: 13px; color: var(--faint); margin-bottom: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* Footer */
.foot { max-width: 1040px; margin: 0 auto; padding: 0 20px 40px; font-size: 13px; color: var(--faint); }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, .tabs, .foot, .actions { display: none; } body { background: #fff; } .card { border: 0; } }
