/* FireWatch — shell modelled on Inspect Point.

   Their chrome: an orange brand block, a purple application bar carrying
   the company name, and a white sidebar whose active item goes pink.
   That reads as enterprise software rather than a phone app, which is the
   point — this gets shown to building owners and AHJs.

   Inspect Point is a desktop web app. Josh is testing on a phone, so the
   sidebar collapses to a slide-out drawer under 900px rather than being
   dropped. Same information architecture, reachable with a thumb. */

:root {
  /* Brand — sampled straight off the crest */
  --orange: #FA7F08;
  --orange-2: #E06E00;
  --purple: #27699B;        /* app bar: the crest's blue */
  --purple-2: #1F5480;
  --pink: #FA7F08;          /* active nav takes the orange */
  --link: #27699B;          /* section headings and links */

  /* Surfaces */
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #F7F9FA;
  --sidebar: #FFFFFF;
  --line: #DDE3E8;
  --line-soft: #ECF0F3;

  --text: #2C3038;
  --dim: #5F6C7A;
  --faint: #8B97A4;

  /* Status — the only other saturated things on screen */
  --pass: #2E7D4F;
  --fail: #C0392B;
  --warn: #B07818;
  --na: #6B7885;

  --shadow: 0 1px 3px rgba(24, 32, 44, .08);
  --shadow-lg: 0 12px 32px rgba(24, 32, 44, .18);

  --ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --num: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --tap: 46px;
  --r: 6px;
  --side-w: 232px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171C; --surface: #1B2229; --surface-2: #232B33; --sidebar: #1B2229;
    --line: #2D3841; --line-soft: #242E36;
    --text: #E7ECF1; --dim: #9BA8B4; --faint: #6D7B87;
    --purple: #16334C; --purple-2: #102838;
    --pass: #4E9A6A; --fail: #E0574A; --warn: #D0A03C; --na: #7A8794;
    --link: #6BA6E0; --pink: #FA9333;
    --shadow: none; --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  }
}
[data-theme="dark"] {
  --bg: #12171C; --surface: #1B2229; --surface-2: #232B33; --sidebar: #1B2229;
  --line: #2D3841; --line-soft: #242E36;
  --text: #E7ECF1; --dim: #9BA8B4; --faint: #6D7B87;
  --purple: #16334C; --purple-2: #102838;
  --pass: #4E9A6A; --fail: #E0574A; --warn: #D0A03C; --na: #7A8794;
  --link: #6BA6E0; --pink: #FA9333;
  --shadow: none; --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--ui); font-size: 15px;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}

#app { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ── Sidebar ────────────────────────────────────────── */
aside {
  width: var(--side-w); flex-shrink: 0; background: var(--sidebar);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}

.brand {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 13px 14px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.brand img { width: 30px; height: auto; flex-shrink: 0; }
.brand b {
  font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--text);
  letter-spacing: .01em;
}
.brand b span { display: block; font-weight: 500; font-size: 11px; color: var(--faint); }

/* App bar carries the mark too, since the sidebar is hidden on a phone. */
.appbar .mark { width: 26px; height: auto; flex-shrink: 0; }

.side-scroll { flex: 1; overflow-y: auto; padding: 8px 0; }

.side-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
  padding: 14px 16px 5px;
}

aside a.nav {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 16px; color: var(--dim); text-decoration: none;
  font-size: 14px; border-left: 3px solid transparent;
}
aside a.nav svg { width: 17px; height: 17px; flex-shrink: 0; }
aside a.nav:hover { background: var(--surface-2); color: var(--text); }
aside a.nav.on { color: var(--pink); border-left-color: var(--pink); font-weight: 600; }
aside a.nav .badge {
  margin-left: auto; background: var(--fail); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 9px;
}
aside a.nav .badge.quiet { background: var(--line); color: var(--dim); }

.side-foot {
  border-top: 1px solid var(--line); padding: 11px 16px;
  display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--dim);
  flex-shrink: 0;
}
.side-foot .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--purple);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ── Content column ─────────────────────────────────── */
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.appbar {
  background: var(--purple); color: #fff;
  padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.appbar .hamburger {
  display: none; background: none; border: 0; color: #fff;
  font-size: 21px; cursor: pointer; padding: 2px 4px; line-height: 1;
}
.appbar .company { font-size: 14.5px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar button, .appbar a {
  background: none; border: 0; color: #fff; font-family: var(--ui);
  font-size: 14px; cursor: pointer; text-decoration: none; padding: 5px 4px;
}
.appbar .strong { font-weight: 700; }

.crumbs {
  padding: 13px 18px 0; font-size: 12.5px; color: var(--dim);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.crumbs .sep { color: var(--faint); }

h1.page {
  font-size: 25px; font-weight: 400; color: var(--link);
  margin: 6px 18px 4px; letter-spacing: -.2px;
}
.page-sub { color: var(--dim); font-size: 13px; margin: 0 18px 8px; }

main { flex: 1; padding: 8px 0 96px; overflow-y: auto; }
.pad { padding: 0 18px; }

/* ── Mobile: sidebar becomes a drawer ───────────────── */
@media (max-width: 899px) {
  aside {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg); height: 100dvh;
  }
  body.nav-open aside { transform: translateX(0); }
  body.nav-open .scrim {
    position: fixed; inset: 0; background: rgba(16,22,28,.5); z-index: 55;
  }
  .appbar .hamburger { display: block; }
  h1.page { font-size: 21px; }
  main { padding-bottom: 110px; }
}

/* ── Dashboard tiles ────────────────────────────────── */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; padding: 12px 18px 0;
}
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; box-shadow: var(--shadow); text-align: left;
  color: inherit; text-decoration: none; display: block; cursor: pointer;
  font: inherit; width: 100%;
}
.tile .n { font-size: 30px; font-weight: 300; line-height: 1.05; letter-spacing: -1px; }
.tile .l { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.tile.bad .n { color: var(--fail); }
.tile.warn .n { color: var(--warn); }
.tile.good .n { color: var(--pass); }

/* ── Section headers and grouped rows ───────────────── */
.sec {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--dim);
  padding: 22px 18px 7px; display: flex; align-items: center; gap: 8px;
}
.sec .count {
  text-transform: none; letter-spacing: 0; font-weight: 600;
  background: var(--surface); color: var(--dim); border: 1px solid var(--line);
  padding: 0 6px; border-radius: 9px; font-size: 11px;
}

.group {
  background: var(--surface); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 600px) {
  .group { border: 1px solid var(--line); border-radius: var(--r); margin: 0 18px; box-shadow: var(--shadow); }
}

.row-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  padding: 12px 16px; min-height: var(--tap);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.group > .row-link:last-child { border-bottom: 0; }
.row-link:hover { background: var(--surface-2); }
.row-link .chev { color: var(--faint); font-size: 18px; line-height: 1; }
.row-link .title { font-size: 15px; font-weight: 500; }
.row-link .sub { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.row-link .grow { flex: 1; min-width: 0; }

.statusbar { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.dev-no { font-family: var(--num); font-size: 12.5px; font-weight: 600; }
.dev-kind { color: var(--dim); font-size: 12.5px; }
.dev-due { font-size: 12px; margin-top: 3px; color: var(--dim); }
.dev-due.overdue { color: var(--fail); font-weight: 500; }

.chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 11px; border: 1px solid; white-space: nowrap; }
.chip.fail { color: var(--fail); border-color: var(--fail); }
.chip.warn { color: var(--warn); border-color: var(--warn); }
.chip.pass { color: var(--pass); border-color: var(--pass); }
.chip.info { color: var(--link); border-color: var(--link); }

/* ── Question rows ──────────────────────────────────── */
.q { background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 12px 16px; }
.group > .q:last-of-type { border-bottom: 0; }
.q-head { display: flex; align-items: flex-start; gap: 10px; }
.q-text { flex: 1; font-size: 14.5px; line-height: 1.4; min-width: 0; }
.q-ref { color: var(--faint); font-size: 11.5px; font-family: var(--num); padding-top: 2px; white-space: nowrap; }
.q-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button {
  background: var(--surface); border: 0; border-right: 1px solid var(--line);
  color: var(--dim); font-family: var(--ui); font-size: 13.5px; font-weight: 500;
  padding: 0 13px; min-height: 38px; cursor: pointer; white-space: nowrap;
}
.seg button:last-child { border-right: 0; }
.seg button.on { color: #fff; font-weight: 600; }
.seg button.on.pass { background: var(--pass); }
.seg button.on.fail { background: var(--fail); }
.seg button.on.impaired { background: var(--warn); }
.seg button.on.na { background: var(--na); }

.details {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--link); font-family: var(--ui); font-size: 13.5px; font-weight: 600;
  padding: 8px 2px; display: flex; align-items: center; gap: 5px;
}
.details .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--link); }

.q-details { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.q-details label { display: block; margin-bottom: 10px; }
.q-details label > span, .field > span {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--dim);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 5px;
}

.reading { display: flex; align-items: center; gap: 10px; }
.reading input { flex: 1; font-family: var(--num); }
.reading .unit { color: var(--dim); font-size: 13.5px; width: 46px; }

.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shots img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.addshot {
  width: 72px; height: 72px; border: 1px dashed var(--line); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 22px; cursor: pointer; background: var(--surface-2);
}

/* ── Forms ──────────────────────────────────────────── */
.field { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.group > .field:last-child { border-bottom: 0; }
.field .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }

input, select, textarea {
  width: 100%; min-height: 40px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 11px;
  color: var(--text); font-family: var(--ui); font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--link); outline-offset: 1px;
}
select { appearance: none; }
input[type=date] { font-family: var(--num); font-size: 15px; }

.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; min-width: 0; }

.date-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.date-row .lbl { flex: 1; min-width: 0; }
.date-row .lbl b { font-size: 14.5px; font-weight: 500; display: block; }
.date-row .lbl small { color: var(--faint); font-size: 11.5px; }
.date-row input { width: 150px; flex: none; min-height: 38px; }
.date-row button {
  min-height: 38px; padding: 0 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r); color: var(--dim);
  font-family: var(--ui); font-size: 13px; cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); width: 100%;
  background: var(--purple); color: #fff; border: 1px solid var(--purple);
  border-radius: var(--r); font-family: var(--ui); font-weight: 600;
  font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--purple-2); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.accent { background: var(--pink); border-color: var(--pink); }
.btn.danger { background: var(--surface); color: var(--fail); border-color: var(--fail); }
.btn[disabled] { opacity: .45; cursor: default; }

.actions {
  position: sticky; bottom: 0; display: flex; gap: 10px;
  padding: 14px 58px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 30;
}
@media (min-width: 600px) { .actions { padding: 14px 18px; } }
.actions .icon-btn { flex: 0 0 var(--tap); }

.progress { height: 3px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; margin-top: 7px; }
.progress > div { height: 3px; background: #7ED4A0; transition: width .2s; }

/* ── Tabs ───────────────────────────────────────────── */
.tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); margin-top: 8px; }
.tabs button {
  flex: 1; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--dim); font-family: var(--ui); font-size: 13.5px; font-weight: 600;
  padding: 12px 0; cursor: pointer;
}
.tabs button.on { color: var(--pink); border-bottom-color: var(--pink); }

/* ── Due rows and toggles ───────────────────────────── */
.due-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 11px 16px; }
.group > .due-row:last-child { border-bottom: 0; }
.due-row .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.due-row .lbl { flex: 1; min-width: 0; }
.due-row .lbl b { font-size: 14.5px; font-weight: 500; display: block; }
.due-row .lbl span { color: var(--dim); font-size: 12.5px; }
.due-row .lbl small { color: var(--faint); font-size: 11.5px; font-family: var(--num); display: block; margin-top: 2px; }
.due-row button {
  min-height: 36px; padding: 0 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); color: var(--pass);
  font-family: var(--ui); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.due-row.muted { opacity: .48; }

.toggle { display: flex; align-items: center; gap: 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 10px 16px; min-height: var(--tap); cursor: pointer; }
.group > .toggle:last-child { border-bottom: 0; }
.toggle > div { flex: 1; min-width: 0; }
.toggle b { font-size: 15px; font-weight: 500; display: block; }
.toggle small { color: var(--faint); font-size: 12px; }
.toggle input[type=checkbox] {
  appearance: none; flex: 0 0 44px; width: 44px; height: 26px; min-height: 26px;
  border-radius: 13px; background: var(--line); border: 0; padding: 0;
  position: relative; cursor: pointer; transition: background .15s;
}
.toggle input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.toggle input[type=checkbox]:checked { background: var(--pass); }
.toggle input[type=checkbox]:checked::after { transform: translateX(18px); }

.themepick { display: flex; gap: 8px; padding: 12px 16px; }
.themepick button {
  flex: 1; min-height: 42px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--dim);
  font-family: var(--ui); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.themepick button.on { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── Empty, notices ─────────────────────────────────── */
.empty { text-align: center; padding: 56px 28px 24px; }
.empty h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.empty p { color: var(--dim); font-size: 13.5px; line-height: 1.55; margin: 0; }

.notice {
  border-left: 3px solid var(--link); background: var(--surface);
  padding: 12px 14px; margin: 14px 18px; border-radius: 0 var(--r) var(--r) 0;
  color: var(--dim); font-size: 12.5px; line-height: 1.55; box-shadow: var(--shadow);
}
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--fail); }

.hint-p { color: var(--faint); font-size: 12.5px; line-height: 1.55; padding: 0 18px 6px; margin: 0; }

.defbox { background: var(--surface); border: 1px solid var(--fail); border-radius: var(--r); padding: 14px; margin: 16px 18px; }
.defbox h3 { font-size: 13.5px; font-weight: 700; color: var(--fail); margin: 0 0 8px; }
.defbox p { color: var(--dim); font-size: 12.5px; margin: 0 0 5px; line-height: 1.5; }

.hist { color: var(--dim); font-size: 12.5px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); font-family: var(--num); }

/* ── Modal ──────────────────────────────────────────── */
dialog {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 0; max-width: 460px; width: calc(100% - 28px);
  max-height: 84vh; box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(16,22,28,.55); }
dialog .dhead { display: flex; align-items: center; justify-content: space-between; background: var(--purple); color: #fff; padding: 13px 16px; }
dialog .dhead h2 { font-size: 16px; font-weight: 600; margin: 0; }
dialog .dhead button { background: none; border: 0; color: #fff; font-size: 23px; cursor: pointer; line-height: 1; }
dialog .dbody { padding: 0 0 14px; overflow-y: auto; max-height: 66vh; }

/* ── Report: always light, it gets printed ──────────── */
#report { display: none; }
@media print {
  body { background: #fff; }
  #app { display: none; }
  #report { display: block; background: #fff; color: #111; font-family: var(--ui); font-size: 10.5pt; line-height: 1.45; }
  @page { margin: 16mm 12mm; }
}
#report h2 { font-size: 13px; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #bbb; }
#report .rhead { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #111; padding-bottom: 8px; }
#report .co { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
#report .co img { width: 42px; height: auto; }
#report .co .txt { line-height: 1.2; }
#report .co small { display: block; font-size: 10px; font-weight: 400; color: #555; margin-top: 2px; }
#report .doc { text-align: right; font-size: 10px; color: #333; }
#report .doc b { display: block; font-size: 13px; color: #111; font-weight: 600; }
#report table.meta { width: 100%; margin-top: 14px; font-size: 11px; table-layout: fixed; }
#report table.meta td { padding: 3px 0; vertical-align: top; }
#report table.meta td.k { color: #555; width: 22%; }
#report .verdict { margin: 13px 0; padding: 8px 10px; border-left: 3px solid #111; background: #f4f4f4; font-weight: 600; font-size: 12px; }
#report table.items { width: 100%; border-collapse: collapse; font-size: 10.5px; table-layout: fixed; }
#report table.items td { border-bottom: 1px solid #ddd; padding: 4px 5px; vertical-align: top; }
#report .secthead td { background: #ebebeb; font-weight: 600; font-size: 11px; padding: 5px; border-bottom: 1px solid #999; }
#report td.ref { width: 13%; color: #666; }
#report td.val { width: 12%; text-align: right; }
#report td.st { width: 19%; text-align: right; }
#report .ok { color: #1d6b3d; font-weight: 600; }
#report .bad { color: #a5231a; font-weight: 700; }
#report .wrn { color: #8a6412; font-weight: 700; }
#report .cmt { color: #555; font-size: 10px; font-style: italic; margin-top: 2px; }
#report .sigs { display: flex; gap: 26px; margin-top: 26px; }
#report .sig { flex: 1; }
#report .sigline { border-bottom: 1px solid #111; height: 28px; }
#report .siglabel { font-size: 9.5px; color: #555; margin-top: 3px; }
#report footer { margin-top: 16px; padding-top: 6px; border-top: 1px solid #ccc; font-size: 8.5px; color: #666; }
#report .shots img { width: 30%; border: 1px solid #ccc; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Sign in ──────────────────────────────────────────────
   Split layout: brand on the left, the form on a raised card to the right.
   Deliberately light in both themes — this is the first thing anyone sees
   of the product, and it gets screenshotted for the Play listing. Dark
   belongs to the field, not the front door. */

.auth-wrap {
  --a-bg: #F7F8FA;
  --a-card: #FFFFFF;
  --a-ink: #1F2A36;
  --a-dim: #6B7A88;
  --a-line: #DDE3E9;
  --a-accent: #27699B;
  --a-btn: #33475B;

  position: fixed; inset: 0; display: flex; overflow-y: auto;
  background:
    radial-gradient(900px 600px at 12% 40%, #FDF1EC 0%, rgba(253,241,236,0) 60%),
    radial-gradient(800px 600px at 88% 60%, #EDF3F8 0%, rgba(237,243,248,0) 60%),
    var(--a-bg);
  color: var(--a-ink);
}

.auth-brand {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; position: relative;
}
/* The faint drafting grid behind the mark, like a set of plans. */
.auth-brand::before {
  content: ''; position: absolute; inset: 18% 14%;
  background-image:
    linear-gradient(to right, rgba(31,42,54,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31,42,54,.07) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
.auth-brand-inner { position: relative; display: flex; align-items: center; gap: 22px; }
.auth-brand img { width: 96px; height: 96px; border-radius: 20px; }
.auth-brand .word { line-height: .92; }
.auth-brand .word b {
  display: block; font-size: 46px; font-weight: 800;
  letter-spacing: -.02em; color: var(--a-ink);
}
.auth-brand .word span {
  display: block; font-size: 46px; font-weight: 800;
  letter-spacing: -.02em; color: var(--a-accent);
}

.auth-panel {
  flex: 0 0 clamp(340px, 42%, 560px);
  display: flex; align-items: center; justify-content: center; padding: 40px 32px;
}

/* The folder tab on the card's top edge, as in the reference. */
.auth-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--a-card); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(31,42,54,.13), 0 2px 6px rgba(31,42,54,.06);
  padding: 44px 36px 32px;
}
.auth-card::before {
  content: ''; position: absolute; top: -22px; left: 0; width: 46%; height: 30px;
  background: var(--a-card); border-radius: 14px 24px 0 0;
  box-shadow: 0 -6px 14px rgba(31,42,54,.05);
}

.auth-card h2 {
  margin: 0 0 6px; font-size: 27px; font-weight: 800;
  letter-spacing: -.02em; text-align: center; color: var(--a-ink);
}
.auth-card .lede {
  margin: 0 0 26px; text-align: center; color: var(--a-dim); font-size: 15px;
}

.auth-card label.f { display: block; margin-bottom: 16px; }
.auth-card input[type=text],
.auth-card input[type=email],
.auth-card input[type=password] {
  width: 100%; min-height: 52px; padding: 14px 16px;
  background: #fff; color: var(--a-ink);
  border: 1px solid var(--a-line); border-radius: 10px;
  font-size: 16px; font-family: var(--ui);
}
.auth-card input::placeholder { color: #9AA7B3; }
.auth-card input:focus {
  outline: none; border-color: var(--a-accent);
  box-shadow: 0 0 0 3px rgba(39,105,155,.14);
}

.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 22px; font-size: 14px;
}
.auth-remember { display: flex; align-items: center; gap: 9px; color: var(--a-ink); cursor: pointer; }
.auth-remember input {
  appearance: none; width: 20px; height: 20px; min-height: 20px; flex: none;
  border: 1.5px solid var(--a-accent); border-radius: 5px; background: #fff;
  cursor: pointer; position: relative;
}
.auth-remember input:checked { background: var(--a-accent); }
.auth-remember input:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-row a { color: var(--a-accent); text-decoration: none; font-weight: 600; }
.auth-row a:hover { text-decoration: underline; }

.auth-btn {
  width: 100%; min-height: 54px; border: 0; border-radius: 10px;
  background: var(--a-btn); color: #fff; cursor: pointer;
  font-family: var(--ui); font-size: 15px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.auth-btn:hover { background: #26374A; }
.auth-btn[disabled] { opacity: .55; cursor: default; }

.auth-alt {
  display: flex; align-items: center; gap: 12px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--a-line);
  font-size: 14px; color: var(--a-dim);
}
.auth-alt .circle {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--a-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.auth-alt a { color: var(--a-ink); font-weight: 600; text-decoration: underline; }

.auth-note {
  margin: 16px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--a-dim);
}
.auth-msg {
  margin: 0 0 18px; padding: 11px 13px; border-radius: 9px; font-size: 13.5px; line-height: 1.5;
  background: #FDECEA; border-left: 3px solid #C0392B; color: #7C2620;
}
.auth-msg.ok { background: #EAF4EE; border-left-color: #2E7D4F; color: #1E5636; }

.auth-foot {
  position: absolute; right: 22px; bottom: 16px; font-size: 13px;
}
.auth-foot a { color: var(--a-dim); text-decoration: underline; }

@media (max-width: 860px) {
  .auth-wrap { flex-direction: column; }
  .auth-brand { flex: none; padding: 34px 24px 6px; }
  .auth-brand::before { display: none; }
  .auth-brand img { width: 58px; height: 58px; border-radius: 13px; }
  .auth-brand .word b, .auth-brand .word span { font-size: 30px; }
  .auth-panel { flex: 1; padding: 18px 18px 64px; align-items: flex-start; }
  .auth-card { padding: 36px 24px 26px; }
  .auth-card::before { display: none; }
  .auth-foot { position: static; text-align: center; padding: 6px 0 24px; }
}
