:root {
    --ink: #1c2530;
    --muted: #5b6672;
    --line: #d9dee4;
    --paper: #ffffff;
    --page: #f3f5f7;
    --brand: #1f4e5f;
    --brand-ink: #ffffff;
    --ok: #1e7a4c;
    --ok-bg: #e7f4ec;
    --warn: #9a5b00;
    --bad: #a3261f;
    --bad-bg: #fbeceb;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    padding-bottom: 110px;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--brand); color: var(--brand-ink); padding: 28px 0 24px; }
.top .firm { margin: 0; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.top h1 { margin: 4px 0 0; font-size: 28px; font-weight: 600; }
.top .client { margin: 6px 0 0; font-size: 17px; opacity: .95; }

main { padding-top: 20px; }
.loading { color: var(--muted); }

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0 0 16px;
}
.card h2 { margin: 0 0 4px; font-size: 19px; }
.card > p { margin: 6px 0; }
.note { color: var(--muted); font-size: 14.5px; }
.intro ul { margin: 8px 0 0; padding-left: 20px; }
.intro li { margin: 3px 0; }

a { color: var(--brand); }

.message { text-align: center; padding: 40px 20px; }
.message h2 { font-size: 22px; }
.message.done h2 { color: var(--ok); }

/* The questions */
.questions { display: grid; gap: 16px; margin-top: 14px; }
.q label, .q legend { display: block; font-weight: 600; margin-bottom: 4px; padding: 0; }
.q .note { margin: 0 0 6px; }
fieldset.q { border: 0; margin: 0; padding: 0; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--brand); background: #eef4f6; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

input[type="number"], input[type="text"], input[type="email"], select {
    font: inherit;
    color: inherit;
    border: 1px solid #b9c1ca;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    width: 100%;
}
input[type="number"] { max-width: 110px; }
input[aria-invalid="true"] { border-color: var(--bad); }
.error { color: var(--bad); font-size: 14.5px; margin: 4px 0 0; }
.person .note { margin: 0 0 4px; }
input:focus-visible, select:focus-visible, button:focus-visible, .choice:focus-within {
    outline: 3px solid #8fc1d0;
    outline-offset: 1px;
}

/* A person or the company */
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.badge { font-size: 13px; border-radius: 999px; padding: 2px 10px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.person { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 12px 0 4px; }
.person .full { grid-column: 1 / -1; }
.person label { font-weight: 600; font-size: 14.5px; display: block; margin-bottom: 3px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400 !important; }
.check input { margin-top: 5px; }
@media (max-width: 600px) { .person { grid-template-columns: 1fr; } }

.slots { margin-top: 12px; border-top: 1px solid var(--line); }
.slot { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 10px; align-items: start; }
.slot:last-child { border-bottom: 0; padding-bottom: 0; }
.slot.drag { background: #eef4f6; outline: 2px dashed var(--brand); outline-offset: 4px; border-radius: 6px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b9c1ca; margin-top: 2px; display: grid; place-items: center; font-size: 13px; color: #fff; }
.slot.has .dot { background: var(--ok); border-color: var(--ok); }
.slot.has .dot::after { content: "✓"; }
.slot h3 { margin: 0; font-size: 16px; font-weight: 600; }
.slot .note { margin: 2px 0 0; }
.files { list-style: none; margin: 8px 0 0; padding: 0; grid-column: 2 / -1; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--page); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 14.5px; }
.files .fname { overflow-wrap: anywhere; }
.files .size { color: var(--muted); white-space: nowrap; }
.files li.busy { color: var(--muted); font-style: italic; }

button { font: inherit; cursor: pointer; border-radius: 8px; }
button.upload { border: 1px solid var(--brand); background: #fff; color: var(--brand); padding: 7px 14px; white-space: nowrap; }
button.upload:hover { background: #eef4f6; }
button.link { border: 0; background: none; color: var(--bad); padding: 2px 4px; text-decoration: underline; }
button.primary { border: 0; background: var(--brand); color: var(--brand-ink); padding: 12px 22px; font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
a.button { display: inline-block; text-decoration: none; border-radius: 8px; background: var(--brand); color: var(--brand-ink); padding: 12px 22px; font-weight: 600; }
.card.step { border-color: var(--brand); border-width: 2px; }

/* The bar at the foot */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); padding: 12px 0; }
.bar-in { display: flex; align-items: center; gap: 18px; }
.progress { flex: 1; min-width: 0; }
.progress p { margin: 5px 0 0; font-size: 14.5px; color: var(--muted); }
.progress p.attention { color: var(--bad); font-weight: 600; }
fieldset.q.needs { border-left: 3px solid var(--bad); padding-left: 12px; }
.track { height: 8px; background: #e3e7ec; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--ok); transition: width .25s; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; background: var(--bad); color: #fff; padding: 10px 16px; border-radius: 8px; max-width: min(92vw, 640px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }

[hidden] { display: none !important; }
