/*
 * Base: colour tokens (light and dark by prefers-color-scheme), type, buttons, focus rings and
 * small utilities. Every colour is a custom property on :root; app.css only uses the tokens.
 */

:root {
  color-scheme: light dark;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --text: #1d1f21;
  --muted: #5f6368;
  --faint: #8a8f94;
  --line: #e4e4e0;
  --accent: #2f5bd3;
  --accent-hover: #2549ad;
  --accent-text: #ffffff;
  --accent-soft: #e8eefc;
  --good: #17703f;
  --warn: #8f5200;
  --bad: #b3261e;
  --bad-soft: #fce8e6;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 30px rgb(0 0 0 / 0.10);
  --radius: 12px;
  --radius-small: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 48px;
  accent-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --surface: #1c1e22;
    --surface-2: #23262b;
    --text: #e8e8e6;
    --muted: #a0a4a9;
    --faint: #7b8086;
    --line: #2e3136;
    --accent: #8aa8ff;
    --accent-hover: #a9bfff;
    --accent-text: #0d1220;
    --accent-soft: #1e2840;
    --good: #7fd3a0;
    --warn: #f0be6a;
    --bad: #ff9a8f;
    --bad-soft: #3d1c1a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 15px/1.5 var(--font);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main:focus, [tabindex="-1"]:focus { outline: none; }

/* Buttons */
.btn {
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: transparent; }
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-quiet:hover, .btn-quiet[aria-expanded="true"] { color: var(--text); background: var(--surface-2); border-color: transparent; }
.btn-link {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 8px;
  min-height: 32px;
}
.btn-icon {
  width: 36px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); border-color: transparent; }
.btn-small { min-height: 30px; padding: 5px 10px; font-size: 13px; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

textarea, input[type="text"], input[type="email"] {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
