/* Shared design system for the website and the portal. Brand colors come from firm.js at runtime
   (setBrand in brand.js) so the same CSS works for any rep firm. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --brand: #12358C;
  --brand-ink: #0B2463;
  --accent: #D7261E;
  --flame: #F28C1B;
  --ice: #2EA3DD;
  --brand-50: #EEF3FC;
  --brand-100: #DCE6F8;

  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-2: #F1F4F9;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;

  --ok: #15803D; --ok-bg: #E7F6EC;
  --warn: #B45309; --warn-bg: #FEF3E2;
  --bad: #B91C1C; --bad-bg: #FDECEC;
  --info: #1D4ED8; --info-bg: #E8EFFD;
  --why: #6D28D9; --why-bg: #F3EEFE; --why-line: #DDD0FB;

  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 26px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --sh-2: 0 4px 14px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-3: 0 18px 50px rgba(15, 23, 42, .16), 0 4px 12px rgba(15, 23, 42, .08);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 650; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--sh-1); }
.btn.primary:hover { background: var(--brand-ink); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(.94); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.quiet { background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Inputs */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* Cards, chips, badges */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-50); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 750; color: #fff; background: var(--brand); flex: none; }

/* "Why this helps" notes: the proposal layer, toggled off for a clean view */
.why { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--why-bg); border: 1px solid var(--why-line); color: #3B1C7A; font-size: 13.5px; line-height: 1.5; }
.why b { color: var(--why); }
.why .why-ic { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--why); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.why .why-pain { display: block; font-weight: 700; color: var(--why); margin-bottom: 2px; }
body.no-why .why { display: none !important; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--brand-50); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Toasts and modals */
#toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-3); font-size: 14px; font-weight: 550; opacity: 0; transform: translateY(10px); transition: all .25s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast.ok { background: #14532D; }
.modal-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal-wrap.in { opacity: 1; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 20px; padding: 26px; box-shadow: var(--sh-3); transform: translateY(8px) scale(.99); transition: transform .25s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-wrap.in .modal { transform: none; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface-2); font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal h3 { font-size: 20px; margin-bottom: 6px; padding-right: 36px; }

/* Demo banner */
.demo-bar { background: var(--ink); color: #CBD5E1; font-size: 12.5px; text-align: center; padding: 7px 16px; }
.demo-bar b { color: #fff; }
.demo-bar a { color: #fff; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
