/* ===========================
   BASE.CSS
   - Design Tokens (CSS-Variablen)
   - Typografie & Grundlayout
   - Utilities (A11y, Spacing, Display)
   - Dark Mode & Reduced Motion
   - Print-Styles
   =========================== */

/* Design Tokens */
:root {
  /* Farben */
  --bg: #ffffff;
  --fg: #0b1220;
  --muted: #5b6472;
  --card: #f5f7fb;
  --border: rgba(0,0,0,.06);
  --accent: #2563eb;

  /* Abstände & Radius */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 24px;

  /* Typo */
  --font-sans: system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  --font-mono: ui-monospace,SFMono-Regular,Menlo,monospace;

  /* Max-Content-Breite */
  --container: 920px;

  /* Z-Ebenen */
  --z-modal: 9999;
  --z-sticky: 1000;

  /* Focus */
  --focus: 0 0 0 3px rgba(37,99,235,.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --fg: #e6eaf2;
    --muted: #9aa3af;
    --card: #121a2a;
    --border: #1f2a44;
    --accent: #60a5fa;
  }
}

/* Farbmodus-Hinweis für Browser */
:root { color-scheme: light dark; }

/* CSS-Reset (sanft) */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bilder & Medien responsiv */
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* Container-Zentrierung */
.container { max-width: var(--container); margin: 0 auto; padding: var(--space-5); }

/* Links */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Überschriften */
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 8px 0 12px; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); margin: 0 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }

/* Text-Hilfen */
.lead { color: var(--muted); }
.muted { color: var(--muted); }

/* Code/KBD */
code, kbd, pre { font-family: var(--font-mono); }
.kbd {
  font: 12px/1.4 var(--font-mono);
  background: rgba(125,125,125,.12);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Utilities: Layout */
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.hide { display: none !important; }

/* Utilities: Abstände */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }

/* Forms – neutrale Basis */
input[type="date"],
input[type="text"],
select, button {
  font: inherit;
}
input[type="date"],
input[type="text"],
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: inherit;
}
@media (prefers-color-scheme: dark){
  input[type="date"],
  input[type="text"],
  select { background: #0e1626; border-color: var(--border); }
}

/* Fokus sichtbar für Tastatur-User */
:where(a, button, input, select):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* Reduced Motion: Animationen reduzieren */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Print (einfach) */
@media print {
  header, footer, .btn { display: none !important; }
  .card { border: 1px solid #ccc; }
}
