/* Auto Apply gateway pages (landing, sign-in pages, admin). Light only. Strict CSP: every style lives here (no
   inline styles), fonts are self-hosted (/_gw/fonts/, the app's own URW Gothic), nothing is loaded from elsewhere.
   Colors follow the app (autoapply/web/static/style.css). */

@font-face {
  font-family: "AA Gothic";
  src: url("/_gw/fonts/urwgothic-book.woff2") format("woff2");
  font-weight: 100 550; font-style: normal; font-display: swap;
  ascent-override: 83%; descent-override: 17%;
}
@font-face {
  font-family: "AA Gothic";
  src: url("/_gw/fonts/urwgothic-demi.woff2") format("woff2");
  font-weight: 551 900; font-style: normal; font-display: swap;
  ascent-override: 83%; descent-override: 17%;
}

:root {
  color-scheme: light;
  --font: "Century Gothic", CenturyGothic, "AA Gothic", "Helvetica Neue", Helvetica, -apple-system, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --canvas: #f9fafb;
  --surface: #ffffff;
  --text: #101828;
  --text-2: #364153;
  --muted: #4a5565;
  --line: #e5e7eb;
  --line-strong: #d1d5dc;
  --brand: #15362b;
  --brand-hover: #2c4a40;
  --brand-fg: #fafafa;
  --mint: #e7f0ea;
  --mint-fg: #15362b;
  --focus: var(--brand); /* solid: 12.6:1 on white, over 3:1 on every background here (WCAG 1.4.11) */
  --ok-bg: #ecfdf5; --ok-fg: #046c4e; --ok-line: #a4f4cf;
  --warn-bg: #fffbeb; --warn-fg: #92400e; --warn-line: #fde68a;
  --bad-bg: #fef2f2; --bad-fg: #b91c1c; --bad-line: #ffc9c9;
  --r: 12px;
  --r-lg: 18px;
  --wrap: 1040px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.1px;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--brand); color: var(--brand-fg); padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); font-size: 0.92em; word-break: break-all; }
.small { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

/* ---- top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 18px; }
.brand:hover { color: var(--text); }
.brand-mark { display: inline-flex; }
.brand-tile { fill: var(--brand); }
.brand-check { fill: none; stroke: #ffffff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.top-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.link { font-size: 14px; }
.inline-form { margin: 0; }

/* ---- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { background: var(--brand-hover); color: var(--brand-fg); }
.btn-quiet { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--canvas); color: var(--text); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 17px; }

/* ---- main */
.main { flex: 1; padding-top: 48px; padding-bottom: 64px; }
.main-landing { flex: 1; padding: 0 0 48px; }
.main-wide { max-width: 1200px; }
.page-title { font-size: 28px; }

/* ---- landing */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-inner { padding-top: 72px; padding-bottom: 72px; max-width: 820px; margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block; margin-bottom: 18px; padding: 4px 12px; border-radius: 999px;
  background: var(--mint); color: var(--mint-fg); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.hero-title { font-size: clamp(32px, 5vw, 48px); margin-bottom: 18px; }
.lead { font-size: clamp(17px, 2.2vw, 19px); color: var(--text-2); max-width: 680px; margin: 0 auto 28px; }
.cta-row { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cta-note { font-size: 14px; color: var(--muted); }

.band { padding-top: 56px; }
.section-title { font-size: 24px; margin-bottom: 20px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card-title { font-size: 18px; }
.card p { color: var(--text-2); margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.step-num {
  flex: none; width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-fg); font-weight: 600;
}
.step-title { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--text-2); margin: 0; }

.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--mint); border-radius: var(--r-lg); padding: 28px;
}
.invite p { margin: 0; color: var(--text-2); max-width: 640px; }
.invite .section-title { margin-bottom: 8px; }

/* ---- message panels */
.panel {
  max-width: 620px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px;
}
.panel-kicker { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.panel-title { font-size: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }

/* ---- admin */
.notice { padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); margin: 16px 0; }
.notice-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.table-wrap { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--canvas); }
.table tbody tr:last-child td { border-bottom: 0; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--canvas);
}
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.pill-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }

/* ---- footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 18px; font-size: 14px; color: var(--muted); }

/* ---- small screens */
@media (max-width: 820px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .invite { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero-inner { padding-top: 48px; padding-bottom: 48px; }
  .main { padding-top: 24px; }
  .panel { padding: 24px 20px; }
  .who { display: none; }
  .btn-lg { width: 100%; }
  .step { padding: 18px; gap: 14px; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 6px 16px; }
  .table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* /admin: the AI meter's alerts under the users table */
.admin-alerts { margin-top: 28px; }
.admin-sub { font-size: 18px; margin-bottom: 8px; }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
