/* Reset, Fonts, Variablen - adaptiert aus ManageForstverein */
*, *::before, *::after { box-sizing: border-box; }

@font-face { font-family: 'Source Sans 3'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-300.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-400.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-600.woff2') format('woff2'); }

:root {
    /* Die Namen bleiben, damit die bestehenden Verwendungen weiterlaufen -
       die Werte kommen jetzt aus token.css. */
    --dark-bg: var(--lk-text);
    --primary-green: var(--lk-gruen);
    --hover-green: var(--lk-gruen-dunkel);
    --page-bg: var(--lk-flaeche-leise);
    --text-light: var(--lk-auf-farbe-leise);
    --text-dark: var(--lk-text);
    /* --lk-text-leise (5,4:1), NICHT --lk-text-schwach (2,6:1): der Wert
       färbt auch Tabellenköpfe und Formular-Beschriftungen, also echten
       Lesetext. Für Platzhalter und deaktivierte Felder ist er dunkel
       genug - umgekehrt wäre es ein Barrierefreiheits-Fehler. */
    --text-muted: var(--lk-text-leise);
    --card-bg: var(--lk-flaeche);
    --surface-2: var(--lk-flaeche-leise);
    --border-color: var(--lk-linie);
    --border-strong: var(--lk-linie);
    /* Getönt wird gegen --lk-mischgrund, NICHT gegen white: im Dunkelmodus
       wurde aus jeder Tönung sonst eine weiße Fläche - die überfahrene
       Listenzeile war hell mit hellem Text darauf und damit unlesbar. */
    --primary-5:  color-mix(in srgb, var(--primary-green), var(--lk-mischgrund) 95%);
    --primary-10: color-mix(in srgb, var(--primary-green), var(--lk-mischgrund) 90%);
    --primary-20: color-mix(in srgb, var(--primary-green), var(--lk-mischgrund) 80%);
    --primary-30: color-mix(in srgb, var(--primary-green), var(--lk-mischgrund) 70%);
    --primary-50: color-mix(in srgb, var(--primary-green), var(--lk-mischgrund) 50%);
    /* Apple-System-Font-Stack zuerst, Source Sans 3 als Fallback wenn keine
       System-Fonts greifen. Liefert auf macOS/iOS SF Pro, auf Windows Segoe UI. */
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", 'Source Sans 3', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", "Source Code Pro", Menlo, Consolas, monospace;
    --color-warning-bg: var(--lk-warnung-flaeche);
    --color-warning-fg: var(--lk-warnung);
    --color-danger-bg:  var(--lk-fehler-flaeche);
    --color-danger-fg:  var(--lk-fehler);
    --color-info-bg:    var(--lk-info-flaeche);
    --color-info-fg:    var(--lk-info);
    --color-success-bg: var(--lk-erfolg-flaeche);
    --color-success-fg: var(--lk-erfolg);

    /* --- Apple-Design-Tokens --- */
    /* Spacing-Skala (4-Punkt-Grid wie iOS) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Radius-Skala (Apple: 8px Standard, 12px Cards, 6px Inline) */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* Schatten: aus token.css, damit sie im Dunkelmodus mitgehen. Feste
       schwarze Schatten sind dort unsichtbar - dann trennt nichts mehr. */
    --shadow-1: var(--lk-schatten-1);
    --shadow-2: var(--lk-schatten-2);
    --shadow-3: var(--lk-schatten-3);

    /* Kontroll-Höhe (Buttons + Inputs einheitlich 40px wie iOS Standard) */
    --control-h: 40px;
    --control-h-sm: 32px;
    --control-h-lg: 48px;
    --control-px: 14px;
    --control-radius: var(--radius-md);

    /* Fokus-Ring (Apple-Style: blau-grün glow) */
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary-green), transparent 75%);
}

html, body { height: 100%; margin: 0; padding: 0; }
body {
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-dark);
    background: var(--page-bg);
    -webkit-font-smoothing: antialiased;
}

html { scrollbar-width: thin; scrollbar-color: var(--primary-30) transparent; }

a { color: var(--primary-green); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text-dark); margin: 0 0 .6em 0; font-weight: 600; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }

code, pre, textarea.code { font-family: 'JetBrains Mono', 'Source Code Pro', 'Menlo', monospace; }

.hidden { display: none !important; }
