/* Satoshi — self-hosted (Fontshare), so Max has no external font dependency.
   Weights 400/500/700/900 per the guide's "weights in use" slot; the exact set is
   still an <!-- EXTRACT --> in the handoff copy, so confirm against BRN's tokens. */
@font-face{font-family:Satoshi;src:url(/assets/fonts/satoshi-1.woff2) format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Satoshi;src:url(/assets/fonts/satoshi-2.woff2) format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:Satoshi;src:url(/assets/fonts/satoshi-3.woff2) format('woff2');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:Satoshi;src:url(/assets/fonts/satoshi-4.woff2) format('woff2');font-weight:900;font-style:normal;font-display:swap}

/* ============================================================================
   BRN Design System — token layer
   Source: "BRN Style Guide — Agent Handoff (.md)", Paymentix Notion workspace.
   Rule #2 of that guide is architectural: NEVER hardcode a colour in a component.
   Every colour, space and radius below is a token; components reference tokens only.
   BRN is white-label — resellers re-skin by overriding these variables and nothing else.

   ⚠️ VALUES BELOW ARE PLACEHOLDERS, NOT BRN's REAL PALETTE.
   Every `<!-- EXTRACT: ... -->` marker in the handoff .md is still unfilled — it ships
   with no hex values, no font weights, no type scale, no spacing/radius/elevation scale.
   The filled copy lives at ~/brn-platform/docs/design/STYLE-GUIDE.md on Mitch's side.
   These are dark-leaning stand-ins chosen to hit WCAG AA; swap them wholesale when the
   real tokens arrive — that swap should touch this block ONLY.
   ============================================================================ */

:root {
  /* -- typography: Satoshi is non-negotiable per guide §1 -------------------- */
  --font-sans: Satoshi, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* -- brand / accent ------------------------------------------------------- */
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --accent: var(--brand-primary);

  /* -- surface layers ------------------------------------------------------- */
  --surface-base: #0b1120;
  --surface-raised: #131c31;
  --surface-overlay: #1b2540;

  /* -- text ----------------------------------------------------------------- */
  --text-primary: #e8edf7;
  --text-secondary: #b4c0d4;
  --text-muted: #94a3b8;
  --text-on-brand: #ffffff;

  /* -- border --------------------------------------------------------------- */
  --border-default: #26324f;
  --border-strong: #38456b;

  /* -- semantic ------------------------------------------------------------- */
  --semantic-success: #34d399;
  --semantic-warning: #fbbf24;
  --semantic-danger: #f87171;
  --semantic-info: #60a5fa;

  /* -- spacing (4px base grid) ---------------------------------------------- */
  --space-1: .25rem; --space-2: .5rem;  --space-3: .75rem;
  --space-4: 1rem;   --space-5: 1.5rem; --space-6: 2rem;

  /* -- radius / elevation --------------------------------------------------- */
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-pill: 999px;
  --elevation-1: 0 1px 2px rgba(0,0,0,.28);
  --elevation-2: 0 4px 12px rgba(0,0,0,.34);

  /* -- legacy aliases: existing rules still reference these ------------------
     Kept so this token layer could land without rewriting every rule at once. */
  --bg: var(--surface-base);
  --surface: var(--surface-raised);
  --surface-2: var(--surface-overlay);
  --border: var(--border-default);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --accent-hover: var(--brand-primary-hover);
  --green: var(--semantic-success);
  --amber: var(--semantic-warning);
  --red: var(--semantic-danger);
  --radius: var(--radius-lg);
}

/* Guide §4: prefers-reduced-motion must be respected on every animation. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Guide §6: every interactive component needs a visible focus ring. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Max — Paymentix partner app. Lane A (frontend) owns this file.
   Placeholder visual direction; a brand pass against the Paymentix
   design direction brief is step 6 in SPEC.md. */


* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Mock banner ---------- */
.mock-banner {
  background: var(--amber);
  color: #422006;
  text-align: center;
  padding: .55rem 1rem;
  font-size: .875rem;
  font-weight: 600;
}
.mock-banner[hidden] { display: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.brand { text-align: center; margin-bottom: 1.75rem; }
.brand h1 { margin: 0; font-size: 2rem; letter-spacing: -.02em; }
.brand p { margin: .35rem 0 0; color: var(--muted); font-size: .875rem; }

label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .375rem;
}
input {
  width: 100%;
  padding: .7rem .85rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

button {
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: .6; cursor: not-allowed; }

.error {
  background: rgba(248, 113, 113, .12);
  border: 1px solid var(--red);
  color: var(--red);
  padding: .65rem .85rem;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.error[hidden] { display: none; }
.hint { text-align: center; color: var(--muted); font-size: .8125rem; margin: 1rem 0 0; }

/* ---------- App shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.topbar .who { color: var(--muted); font-size: .875rem; }
.topbar button { width: auto; padding: .45rem .9rem; font-size: .8125rem; background: var(--surface-2); }
.topbar button:hover { background: var(--border); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ---------- Stat tiles ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.stat .label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .4rem;
}
.stat .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }

/* ---------- Table ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel h2 {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .8rem 1.25rem; text-align: left; white-space: nowrap; }
th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge.active  { background: rgba(52, 211, 153, .15); color: var(--green); }
.badge.pending { background: rgba(251, 191, 36, .15); color: var(--amber); }
.badge.closed  { background: rgba(148, 163, 184, .15); color: var(--muted); }

.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .stat .value { font-size: 1.5rem; }
}

/* ---------- OTP login additions ---------- */
.notice {
  background: rgba(59, 130, 246, .12);
  border: 1px solid var(--accent);
  color: #bfdbfe;
  padding: .65rem .85rem;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.notice[hidden] { display: none; }

/* The 6-digit code field: wide, spaced, unmistakably a code. */
#code {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: .4em;
  text-indent: .4em; /* offsets the trailing letter-space so digits look centred */
  font-variant-numeric: tabular-nums;
}

.linklike {
  width: auto;
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}
.linklike:hover { background: none; color: var(--accent-hover); }

/* Role banner — makes a whole-book (admin/demo) view impossible to mistake
   for a personal portfolio. */
.role-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: .55rem 1rem;
  font-size: .875rem;
  font-weight: 600;
}
.role-banner[hidden] { display: none; }

/* ---------- App shell: nav + forms ---------- */
.mainnav { display: flex; gap: .25rem; flex: 1; }
.mainnav a {
  padding: .4rem .75rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: var(--surface-2); color: var(--text); }

main.narrow { max-width: 640px; }
.page-title { margin: 0 0 .35rem; font-size: 1.5rem; letter-spacing: -.02em; }
.page-sub { margin: 0 0 1.5rem; color: var(--muted); font-size: .9375rem; }

.form-panel { padding: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend {
  padding: 0; margin-bottom: .85rem;
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}
.row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; }
.row label { margin-top: 0; }
.req { color: var(--accent); }

.pii-note {
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .35);
  color: #fde68a;
  padding: .8rem .9rem;
  border-radius: 8px;
  font-size: .8125rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.notice a { color: #bfdbfe; }
.notice code {
  background: rgba(0,0,0,.25);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .9em;
}
.empty a { color: var(--accent); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .row { grid-template-columns: 1fr; }
}
