/* TurnWise — shared tokens and primitives
   Palette: navy ink (brand), cool invoice paper, highlighter yellow, red pen, saved green. */
:root {
  --navy: #050816;
  --navy-2: #0c1233;
  --navy-3: #18205a;
  --ink: #111633;
  --ink-2: #464c6b;
  --ink-3: #7a8099;
  --paper: #f4f6fa;
  --sheet: #ffffff;
  --rule: #dfe3ec;
  --rule-2: #eef1f6;
  --indigo: #4338ca;
  --indigo-2: #6366f1;
  --indigo-tint: #eceafd;
  --highlight: #ffe247;
  --highlight-soft: #fff6bf;
  --pen: #d3263e;
  --pen-tint: #fde8eb;
  --saved: #0b8f5a;
  --saved-tint: #e2f5ec;
  --amber: #b45309;
  --amber-tint: #fdf1dc;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--body); color: var(--ink); background: var(--paper); }
img, svg { max-width: 100%; }
a { color: var(--indigo); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; margin: 0 0 .45em; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0 0 1em; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: var(--r); }
.skip:focus { left: 12px; }
[hidden] { display: none !important; }

/* Buttons */
.btn { --bg: var(--indigo); --fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--r); background: var(--bg); color: var(--fg);
  font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.secondary { --bg: transparent; --fg: var(--ink); border-color: var(--rule); background: var(--sheet); }
.btn.secondary:hover { border-color: var(--ink-3); filter: none; }
.btn.saved { --bg: var(--saved); }
.btn.highlight { --bg: var(--highlight); --fg: var(--navy); }
.btn.danger { --bg: var(--pen); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--indigo); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--indigo-2); outline-offset: 2px; border-radius: 4px; }

/* Forms */
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.field .hint { font-weight: 400; color: var(--ink-3); font-size: 13px; }
input, select, textarea { font: 16px/1.3 var(--body); color: var(--ink); background: var(--sheet); width: 100%;
  border: 1px solid #c9cfdc; border-radius: var(--r); padding: 11px 12px; min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(99,102,241,.35); outline-offset: 0; border-color: var(--indigo-2); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--indigo); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.error-text { color: var(--pen); font-size: 14px; font-weight: 600; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 15px; max-width: calc(100% - 32px);
  box-shadow: 0 12px 30px rgba(5,8,22,.25); transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--pen); }
#toast.info { background: var(--navy-3); }

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