/* SIPI Designsystem: Tokens
   Zwei Ebenen: Grundwerte (Skalen) und semantische Rollen (--surface, --text, --accent ...).
   Komponenten benutzen nur semantische Tokens. Dunkelmodus = zweiter Satz semantischer Tokens,
   gesetzt über html[data-theme="dark"]. Alle Textpaare sind auf WCAG AA (4,5:1) geprüft,
   Feldrahmen und Fokus auf 3:1 (Werte in NOTIZ.md). */

/* Inter (SIL OFL 1.1, Lizenztext in fonts/), variable Gewichte, lokal ausgeliefert */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  /* Schrift */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-15: 0.9375rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-30: 1.875rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --lh-tight: 1.25;
  --lh-base: 1.5;

  /* Abstände (4-px-Raster) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Form */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  /* Layout */
  --sidebar-w: 256px;
  --header-h: 56px;
  --content-max: 1240px;
  --tap: 40px;

  /* Bewegung */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 140ms;
}

/* ---------- Hell ---------- */
:root,
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f6f8;            /* Seitenhintergrund */
  --surface: #ffffff;       /* Karten, Tabellen, Dialoge */
  --surface-2: #f1f3f6;     /* zurückgenommene Flächen, Tabellenkopf */
  --surface-hover: #ebeef3;
  --overlay: rgba(14, 18, 28, 0.5);

  --text: #1a1f2b;
  --text-muted: #566072;
  --text-subtle: #626c7e;

  --border: #dde1e8;        /* Trennlinien, Kartenrand */
  --border-input: #7c8698;  /* Feldrahmen, 3,7:1 */

  --accent: #2f5bea;
  --accent-hover: #2449c8;
  --accent-soft: #eaeffd;
  --accent-text: #2449c8;
  --on-accent: #ffffff;
  --focus: #2f5bea;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, 0.1), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-3: 0 16px 48px rgba(16, 24, 40, 0.2);

  /* Status: Hintergrund + Text, immer zusammen mit Symbol und Wort */
  --st-info-bg: #e8effe;    --st-info-fg: #1e40af;
  --st-violet-bg: #f0ebfd;  --st-violet-fg: #5b32b5;
  --st-warn-bg: #fdf1d8;    --st-warn-fg: #7a4a00;
  --st-ok-bg: #ddf4e6;      --st-ok-fg: #14683b;
  --st-bad-bg: #fce6e6;     --st-bad-fg: #a61b1b;
  --st-neutral-bg: #eceff3; --st-neutral-fg: #3f495a;

  --danger: #a61b1b;
  --danger-soft: #fce6e6;

  /* Meter / Balken */
  --bar-track: #e3e7ee;
  --bar-fill: #2f5bea;
  --bar-over: #a61b1b;
}

/* ---------- Dunkel ---------- */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1c222b;
  --surface-hover: #232a35;
  --overlay: rgba(0, 0, 0, 0.62);

  --text: #e8ecf2;
  --text-muted: #a5aebd;
  --text-subtle: #98a2b3;

  --border: #2a323d;
  --border-input: #6f7a8e;

  --accent: #8aa2ff;
  --accent-hover: #a3b6ff;
  --accent-soft: #1e2740;
  --accent-text: #a9bbff;
  --on-accent: #0b1020;
  --focus: #a9bbff;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 56px rgba(0, 0, 0, 0.7);

  --st-info-bg: #1c2745;    --st-info-fg: #b7c8ff;
  --st-violet-bg: #2a2145;  --st-violet-fg: #cdbbff;
  --st-warn-bg: #3a2c0e;    --st-warn-fg: #f5cc73;
  --st-ok-bg: #12301f;      --st-ok-fg: #8fddae;
  --st-bad-bg: #3d1a1a;     --st-bad-fg: #ffb4b4;
  --st-neutral-bg: #252c37; --st-neutral-fg: #c6cedb;

  --danger: #ff9c9c;
  --danger-soft: #3d1a1a;

  --bar-track: #2a323d;
  --bar-fill: #8aa2ff;
  --bar-over: #ff9c9c;
}
