/* ============================================================
   Design-Tokens: Farben, Abstände, Radien, Schatten, Schriftgrößen.
   Die Werte stammen aus dem Designsystem des Output Managements (Septeo.OM.Web, wwwroot/css/app.css): Navy als
   Markenfarbe, Orange als Akzent, Slate-Grautöne. Die Namen sind die eigenen dieser App; die Zuordnung steht je Gruppe.

   Hell und dunkel: Das dunkle Thema folgt der Einstellung des Geräts (prefers-color-scheme), es gibt keinen
   Schalter. Es überschreibt unten nur Farben und Schatten; alles andere gilt für beide Themen.

   Schrift: Figtree (fonts.css, selbst ausgeliefert, Gewichte 400 bis 600 – fetter gibt es nicht). Es wird nichts aus dem
   Internet geladen. Für Code und Kennungen gilt die Monospace-Schrift des Systems.
   ============================================================ */

:root {
  /* Auch Eingabefelder, Auswahllisten und Rollbalken des Browsers folgen dem Thema. */
  color-scheme: light dark;

  --font-ui: 'Figtree', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Marke (--color-primary*, --color-accent) */
  --brand-primary-500: #2e3861;
  --brand-primary-soft: #eef0f7;
  --brand-primary-ring: rgba(46, 56, 97, 0.22);
  --brand-accent: #ec613f;

  /* Fläche des Primärknopfs (--color-btn-primary-*). Im dunklen Thema dunkler als --brand-primary-500, sonst reicht der
     Kontrast zur weißen Schrift nicht. */
  --btn-primary-bg: #2e3861;
  --btn-primary-hover: #232b4d;

  /* Fokusrahmen (--color-focus). Links sind Text auf der Fläche, Schaltflächen sind Fläche mit weißer Schrift: im dunklen
     Thema zwei Farben. */
  --focus: #2e3861;
  --link: #2e3861;
  --link-hover: #232b4d;

  /* Flächen */
  --bg-app: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text. --text-muted-on-subtle nur für Text auf --bg-subtle (Tabellenkopf): --text-muted reicht dort nicht für AA. */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-muted-on-subtle: #475569;
  --text-faint: #94a3b8;

  /* Meldungen: --*-fg = --color-<art>, --*-bg = --color-<art>-bg, --*-text = --color-<art>-text */
  --success-bg: #d8efe1;
  --success-text: #0f5436;
  --warning-fg: #d97706;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger-fg: #dc2626;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info-fg: #2563eb;
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --neutral-bg: #f1f5f9;
  --neutral-text: #475569;

  /* Abstände */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-16: 32px;

  /* Radien und Schatten */
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-btn: 8px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);

  /* Schrift */
  --type-body: 400 14px/1.5 var(--font-ui);
  --type-label: 500 12px/1.3 var(--font-ui);
  --type-input: 400 13px/1.4 var(--font-ui);
  --type-btn: 500 13px/1 var(--font-ui);
  --type-badge: 500 12px/1 var(--font-ui);
  --type-page-title: 600 22px/1.25 var(--font-ui);
  --type-page-subtitle: 400 14px/1.5 var(--font-ui);
  --type-card-header: 600 14px/1.3 var(--font-ui);
  --type-note: 400 12.5px/1.4 var(--font-ui);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Marke: aufgehellt für Text, Symbole und Rahmen auf dunklem Grund. */
    --brand-primary-500: #6e7aae;
    --brand-primary-soft: rgba(110, 122, 174, 0.16);
    --brand-primary-ring: rgba(110, 122, 174, 0.32);
    --brand-accent: #ff8b69;

    --btn-primary-bg: #565f88;
    --btn-primary-hover: #454e78;

    --focus: #8a96c4;
    --link: #8a96c4;
    --link-hover: #aab3d6;

    /* Flächen */
    --bg-app: #0a0f14;
    --bg-subtle: #0f172a;
    --surface: #111827;
    --surface-hover: #1f2937;
    --border: #1f2937;
    --border-strong: #334155;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-muted-on-subtle: #94a3b8;
    --text-faint: #64748b;

    /* Meldungen */
    --success-bg: rgba(16, 185, 129, 0.14);
    --success-text: #6ee7b7;
    --warning-fg: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.14);
    --warning-text: #fcd34d;
    --danger-fg: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.14);
    --danger-text: #fca5a5;
    --info-fg: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.14);
    --info-text: #93c5fd;
    --neutral-bg: rgba(148, 163, 184, 0.12);
    --neutral-text: #cbd5e1;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  }
}
