/* copied from SungCACFA/kachiflow@8817ae539ac40dda0fe61cb95232a7c414cb9465 (app/static/css/theme.css), edit there.
   Only what gl-forecast uses: tokens (light + dark), fonts, base, buttons, logo swap, wordmark,
   sign-in card, form fields, nav. Lines kept verbatim; KachiFlow page CSS (landing, clients, tables) left out.
   Local additions live in app/static/css/app.css, never here. */

/* =========================================================
   BRAND TOKENS. Everything else reads from here.
   Sampled from the K mark (docs/brand/):
     gold mid  #E5B858   gold deep #CC8F32   charcoal #22262F (dark logo background)
   --accent      = gold FILLS (buttons, badges, underlines)
   --accent-ink  = gold TEXT. Light mode needs a darker gold: logo gold on the light
                   background is 2.6:1, too faint to read. Fills don't have that issue.
   --accent-text = text placed ON a gold fill.
   ========================================================= */
:root {
  --accent: #CC8F32;
  --accent-ink: #8F631B;
  --accent-text: #22262F;
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --hover: #e6e3da;
  --border: #e4e1d8;
  --border-strong: #cfcbc0;
  --text: #22262F;
  --text-2: #6b6b72;
  --text-3: #a3a19a;
  --tool: #0369a1;
  --check: #15803d;
  --agent: #7e22ce;
  --no: #b91c1c;
  /* hero band is charcoal in both themes */
  --hero-bg: #22262F;
  --hero-text: #ECE8DF;
  --hero-text-2: #A3A9B6;
  --hero-accent: #E5B858;
  --band-bg: #22262F;        /* charcoal bands (nav, CTA, run card) */
  --band-border: #363C49;    /* hairlines on charcoal bands */
  --band-text-2: #C9CDD6;    /* secondary text on charcoal bands */
  --band-line: #4A5162;      /* outlines of small controls on bands */
  --band-outline: #6B7280;   /* outline buttons on bands */
  --band-ok: #9ACB9A;        /* passed ticks on the approval card */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #E5B858;
  --accent-ink: #E5B858;
  --accent-text: #22262F;
  --bg: #22262F;
  --surface: #2B303B;
  --surface-2: #333946;
  --hover: #3A4150;
  --border: #363C49;
  --border-strong: #4A5162;
  --text: #ECE8DF;
  --text-2: #A3A9B6;
  --text-3: #7A8192;
  --tool: #7cc4f0;
  --check: #4ade80;
  --agent: #c4a5f5;
  --no: #f87171;
  --band-bg: #1A1D24;        /* one step darker than the dark page, so bands still read as bands */
  color-scheme: dark;
}

/* ---------- wordmark font: Fraunces SemiBold (OFL, app/static/fonts/OFL-Fraunces.txt). One weight, self-hosted, ASCII subset. */
@font-face {
  font-family: "Fraunces KF";
  src: url("../fonts/fraunces-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- body font: IBM Plex Sans 400, 500, 600 (OFL, app/static/fonts/OFL-IBM-Plex-Sans.txt). Self-hosted, latin subset. */
@font-face { font-family: "Plex Sans KF"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans KF"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans KF"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Plex Sans KF", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.theme-btn { border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--text-2); }
.theme-btn:hover { background: var(--hover); }

/* logo swaps by theme */
.logo-light, .logo-dark { height: 32px; width: auto; display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ---------- public pages */
.pnav { display: flex; align-items: center; gap: 10px; max-width: 1040px; margin: 0 auto; padding: 18px 24px; }
/* lockup: 32px mark, 20px wordmark, 10px gap (the flex gap). top: nudges the cap height onto the mark's centre. */
.pnav .name { font-family: "Fraunces KF", Georgia, serif; font-weight: 600; font-size: 20px; line-height: 1; position: relative; top: -0.0115em; white-space: nowrap; }
.pnav .name .flow { color: var(--accent-ink); }
.pnav .btn, .pnav .theme-btn { white-space: nowrap; }
.pnav .sp { flex: 1; }
/* landing page: see the LANDING block at the end */

.login-wrap { min-height: calc(100vh - 70px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.login h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.login .sub { color: var(--text-2); margin-bottom: 18px; }
.login .note { color: var(--text-2); line-height: 1.5; }


/* ---------- forms and signed-in pages */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 14px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field small { display: block; margin-top: 5px; color: var(--text-3); font-size: 12px; }
.code { font-size: 20px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.err { color: var(--no); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.btn.wide { width: 100%; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.login .note a, .page a:not(.btn) { color: var(--accent-ink); text-decoration: underline; }
.login.wide-card { max-width: 420px; }
.login .note { margin-top: 14px; }
.login p.note + .field, .login p.note + .err { margin-top: 14px; }
.qr { display: flex; justify-content: center; margin: 14px 0; }
.qr svg { display: block; border-radius: 6px; }  /* segno gives a fixed size and a white quiet zone */
.key { display: inline-block; margin-top: 6px; font-size: 14px; letter-spacing: .08em; user-select: all; }
form.inline { display: inline; }

.pnav .navlinks { display: flex; align-items: center; gap: 10px; }

/* Narrow phones: the signed-in nav becomes two deliberate rows. Row 1: mark, wordmark, theme button.
   Row 2: Clients, Users, Account, Sign out. No wrapping surprises, no menu, no JS. */
@media (max-width: 480px) {
  .pnav { flex-wrap: wrap; gap: 8px; padding: 14px 12px; }
  .pnav .theme-btn { order: 2; }
  .pnav .navlinks { order: 3; flex: 1 0 100%; gap: 6px; }
  .pnav .btn, .pnav .theme-btn { padding: 6px 9px; font-size: 12px; }
}
