/* ============================================================
   BASE: Reset, Variablen, Typografie, Fokus
   - WCAG-AA-Kontraste
   - rem-basiert, browserzoom-freundlich
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:root {
  /* Farben – ruhig, kontrastreich */
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-alt: #eef1f5;
  --color-text: #1a1d23;
  --color-text-muted: #4a5160;
  --color-border: #cdd3dc;
  --color-border-strong: #8a92a1;

  --color-primary: #1f5fb0;       /* genug Kontrast auf weiß */
  --color-primary-hover: #174a8c;
  --color-primary-text: #ffffff;

  --color-danger: #b3261e;
  --color-danger-hover: #8a1d17;
  --color-warning-bg: #fff4d6;
  --color-warning-border: #c89200;
  --color-warning-text: #5c4300;

  --color-success-bg: #e1f3e4;
  --color-success-border: #2e7d32;
  --color-success-text: #1b4d1f;

  --color-sunday-bg: #fdecec;
  --color-sunday-border: #b3261e;
  --color-holiday-bg: #e8e3f7;
  --color-holiday-border: #5b3da8;

  --color-locked-bg: #fff8e1;

  /* Abstände */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Radien & Schatten */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Fokus */
  --focus-ring: 0 0 0 3px #ffbf47;

  /* Typografie */
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3) 0;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

p { margin: 0 0 var(--space-3) 0; }

a {
  color: var(--color-primary);
}
a:hover {
  color: var(--color-primary-hover);
}

/* Fokus-Stil — gut sichtbar, gilt für ALLE fokussierbaren Elemente */
:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip-Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

/* Screenreader-only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bewegungsreduzierung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
