/* Layout: a single centred working column (form) / two-pane console (admin). Ledger-like: verified data set in mono. */
/* Layout: single working column under the Brewing Brands masthead (dashed rule + sun dot), black footer bar.
   Cream field fills echo the paper form. */
:root {
  --bg: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #111111;
  --muted: #5F5A50;
  --line: #E4DCCB;
  --brand: #111111;
  --brand-ink: #FFFFFF;
  --brand-soft: #F3E3C0;
  --field: #FBF3E2;
  --accent: #EED9A8;
  --ok: #1E7A4C; --ok-soft: #E1F2E8;
  --warn: #8F5B00; --warn-soft: #FBF0D9;
  --bad: #B03A2E; --bad-soft: #F8E3E0;
  --focus: #111111;
  --f-display: "Fira Sans", "Segoe UI", system-ui, sans-serif;
  --f-body: "Fira Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110F; --surface: #1C1A17; --ink: #F2EEE6; --muted: #A9A193; --line: #34302A;
    --brand: #F3E3C0; --brand-ink: #12110F; --brand-soft: #3A3122; --field: #24211C; --accent: #D9BE80;
    --ok: #6FD39F; --ok-soft: #173326; --warn: #E9B95C; --warn-soft: #3A2D12; --bad: #F08A7E; --bad-soft: #3D1D19; --focus: #F3E3C0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110F; --surface: #1C1A17; --ink: #F2EEE6; --muted: #A9A193; --line: #34302A;
  --brand: #F3E3C0; --brand-ink: #12110F; --brand-soft: #3A3122; --field: #24211C; --accent: #D9BE80;
  --ok: #6FD39F; --ok-soft: #173326; --warn: #E9B95C; --warn-soft: #3A2D12; --bad: #F08A7E; --bad-soft: #3D1D19; --focus: #F3E3C0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.mark { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; }
.mark .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 0.8rem; }

.wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 80px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 620px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.span2 { grid-column: 1 / -1; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
@media (max-width: 520px) { .panel { padding: 16px; } }

/* form controls */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 0.86rem; font-weight: 600; }
.field > span em { font-style: normal; color: var(--muted); font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 80px; }
textarea[readonly], input[readonly] { opacity: .7; cursor: not-allowed; }
input:focus, select:focus, textarea:focus, button:focus-visible, .chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
input.invalid, select.invalid { border-color: var(--bad); background: var(--bad-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }

.btn { font: 600 0.92rem var(--f-body); border-radius: 8px; padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; font-size: 0.82rem; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.neutral { color: var(--muted); background: var(--brand-soft); }

.notice { border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.err { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.chip { font: 500 0.8rem var(--f-mono); background: var(--surface); border: 1px dashed var(--line); padding: 3px 8px; border-radius: 6px; cursor: pointer; color: var(--ink); }

/* stepper */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0 22px; padding: 0; list-style: none; }
.steps li { border-top: 3px solid var(--line); padding-top: 8px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.steps li b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 0.72rem; }
.steps li.done { border-color: var(--brand); color: var(--ink); }
.steps li.on { border-color: var(--accent); color: var(--ink); }
@media (max-width: 520px) { .steps li span { display: none; } }

/* ABN search */
.search { position: relative; }
.results { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.results button { all: unset; display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; width: 100%; box-sizing: border-box; cursor: pointer; border-bottom: 1px solid var(--line); }
.results button:last-child { border-bottom: 0; }
.results button:hover, .results button:focus-visible { background: var(--brand-soft); }
.results .r-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.verified { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.verified header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; background: var(--brand-soft); flex-wrap: wrap; }
.verified dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.verified dl div { padding: 10px 16px; border-top: 1px solid var(--line); min-width: 0; }
.verified dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.verified dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 620px) { .verified dl { grid-template-columns: 1fr 1fr; } }

.person { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.person > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.terms { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-size: 0.86rem; background: var(--bg); }
.terms h4 { margin: 10px 0 2px; font-size: 0.86rem; }
.terms h4:first-child { margin-top: 0; }

.sigpad { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #FFFFFF; height: 150px; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; border-radius: 8px; cursor: crosshair; }
.sigpad .hint { position: absolute; left: 14px; bottom: 34px; right: 14px; border-bottom: 1px solid #C9D1CB; color: #8A968F; font-size: 0.78rem; pointer-events: none; padding-bottom: 2px; }
.sigpad .clear { position: absolute; top: 6px; right: 6px; }

.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.review dl { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
.review dt { color: var(--muted); font-size: 0.86rem; }
.review dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .review dl { grid-template-columns: 1fr; } .review dd { margin-bottom: 6px; } }

@media (prefers-reduced-motion: no-preference) { .fade { animation: fade .25s ease-out; } @keyframes fade { from { opacity: .4; transform: translateY(4px); } } }
#form { display: flex; flex-direction: column; gap: 16px; }
#form > .nav { margin-top: 6px; }
#form > #formErr { margin-top: 0 !important; }

/* ---- Brewing Brands masthead / footer ---- */
.bb-head { background: var(--surface); padding: 28px 16px 18px; }
.bb-head-inner { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.bb-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 600; letter-spacing: -0.01em; }
.wordmark { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.wordmark b { font: 600 1.25rem var(--f-display); letter-spacing: -0.01em; }
.wordmark small { font-size: 0.5rem; letter-spacing: 0.12em; margin-top: 3px; }
.dashes { max-width: 760px; margin: 18px auto 0; display: flex; align-items: center; gap: 10px; }
.dashes span { flex: 1; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 18px, transparent 18px 30px); }
.dashes i { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); flex: none; }
.lead { margin-bottom: 4px; }
.bb-foot { background: #111111; color: #FFFFFF; padding: 18px 16px; text-align: center; font-size: 0.85rem; font-weight: 500; }
.req { font-style: normal; color: var(--bad); }
.field small { font-size: 0.78rem; }
.sec-head { display: flex; flex-direction: column; gap: 4px; }
.sec-head h2 { font-size: 1.15rem; font-weight: 600; }
.days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day { display: inline-flex; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span { border: 1px solid var(--line); background: var(--field); border-radius: 6px; padding: 6px 10px; font-size: 0.85rem; font-weight: 500; cursor: pointer; }
.day input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.day input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.day input:disabled + span { opacity: 0.7; cursor: default; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: inline-flex; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 8px 16px; font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.terms p { margin: 0 0 6px; }
.terms .num { font-weight: 600; }
.terms .sub { padding-left: 22px; }
.terms.tall { max-height: 380px; }
.decl { font-size: 0.88rem; display: flex; flex-direction: column; gap: 6px; background: var(--field); border-radius: 8px; padding: 12px 14px; }
.steps li.on { border-color: var(--ink); }
.steps li.done { border-color: var(--accent); }
.btn.primary:hover { filter: none; opacity: 0.88; }
