/* Müllklar Grundlage für Website und Admin. Gleiche CI wie die App (android/.../ui/Theme.kt):
   Waldgrün als einzige Akzentfarbe, Outfit, Pillen-Knöpfe, Karten mit 20px Rundung, Felder mit 14px. */
@font-face {
  font-family: "Outfit";
  src: url("/statisch/outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* v3: ruhiger. Fast weiße Flächen, feine Linien, Grün nur als Akzent (Knöpfe, Links, Karte). */
  --bg: #fafbf9;
  --flaeche: #ffffff;
  --flaeche-2: #f2f4f1;
  --flaeche-3: #e8ece7;
  --tinte: #131a15;
  --leise: #59625c;
  --linie: #e3e7e2;
  --gruen: #1a7a4c;
  --gruen-tief: #11522f;
  --gruen-hell: #e2f2e7;
  --auf-gruen: #ffffff;
  --minze: #bff3d3;
  --warn-bg: #fff6d9;
  --warn: #5c4700;
  --fehler-bg: #fce8e5;
  --fehler: #8a1f18;
  --schatten: 0 1px 2px rgb(19 26 21 / 0.04), 0 4px 16px rgb(19 26 21 / 0.05);
  --schatten-hoch: 0 2px 4px rgb(19 26 21 / 0.04), 0 24px 48px -16px rgb(19 26 21 / 0.18);
  /* Formen: Knöpfe als Pille, Karten 16px, Felder 12px */
  --r-karte: 16px;
  --r-feld: 12px;
  --raus: cubic-bezier(0.23, 1, 0.32, 1);
  --kurz: 160ms;
  --mittel: 240ms;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --flaeche: #161c18;
    --flaeche-2: #1b221d;
    --flaeche-3: #252e28;
    --tinte: #e4ebe5;
    --leise: #a3aea6;
    --linie: #29322c;
    --gruen: #7dd6a1;
    --gruen-tief: #a8f2c3;
    --gruen-hell: #173826;
    --auf-gruen: #003920;
    --minze: #1b5e3a;
    --warn-bg: #3a3110;
    --warn: #f4dc8a;
    --fehler-bg: #4a1d19;
    --fehler: #ffb4ab;
    --schatten: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.2);
    --schatten-hoch: 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 48px -16px rgb(0 0 0 / 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tinte);
  font: 400 1.0625rem/1.6 "Outfit", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--gruen); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 620; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3, p, li, td, dd { overflow-wrap: break-word; hyphens: auto; }
.leise { color: var(--leise); }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.sprung { position: absolute; left: -9999px; }
.sprung:focus { left: 16px; top: 12px; z-index: 100; background: var(--flaeche); padding: 10px 16px; border-radius: 999px; }
:focus-visible { outline: 3px solid var(--gruen); outline-offset: 3px; border-radius: 6px; }

/* Knöpfe: Pille, Druck-Feedback 0.97, nur transform animiert */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: 600 1rem/1 "Outfit", sans-serif; text-decoration: none; white-space: nowrap;
  background: var(--gruen); color: var(--auf-gruen);
  transition: transform var(--kurz) var(--raus), background-color var(--kurz) ease;
}
.knopf:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .knopf:hover { background: var(--gruen-tief); } }
@media (prefers-color-scheme: dark) and (hover: hover) and (pointer: fine) { .knopf:hover { background: #95e2b4; } }
.knopf.zweit { background: var(--flaeche); color: var(--tinte); border-color: var(--linie); }
@media (hover: hover) and (pointer: fine) { .knopf.zweit:hover { background: var(--flaeche-2); } }
.knopf.klein { min-height: 38px; padding: 0 16px; font-size: 0.92rem; gap: 8px; }
.knopf.still { background: transparent; color: var(--leise); }
@media (hover: hover) and (pointer: fine) { .knopf.still:hover { background: var(--flaeche-2); color: var(--tinte); } }
.knopf[aria-disabled="true"] { cursor: default; }
.knopf[aria-disabled="true"]:active { transform: none; }

/* Formulare: Beschriftung oben, Hinweis darunter, Fehler unter dem Feld */
.feld { display: grid; gap: 6px; }
.feld > span { font-weight: 600; font-size: 0.95rem; }
.feld small { color: var(--leise); font-size: 0.88rem; }
.feld .fehlertext { color: var(--fehler); font-size: 0.9rem; font-weight: 500; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=search], select, textarea {
  font: 400 1rem "Outfit", sans-serif; color: var(--tinte); background: var(--flaeche);
  min-height: 48px; padding: 12px 14px; border-radius: var(--r-feld); border: 1.5px solid var(--linie); width: 100%;
  transition: border-color var(--kurz) ease;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--leise) 80%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gruen) 25%, transparent); }
[aria-invalid="true"] { border-color: var(--fehler) !important; }
.haken { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.haken input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--gruen); flex: none; }
.versteckt { position: absolute !important; left: -9999px !important; }
.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-feld); background: var(--gruen-hell); }
.hinweis.warn { background: var(--warn-bg); color: var(--warn); }
.hinweis.fehler { background: var(--fehler-bg); color: var(--fehler); }

/* Einblenden beim Scrollen, ohne JavaScript (scroll-gesteuerte Animation). Browser ohne Unterstützung
   und reduzierte Bewegung zeigen alles sofort. Nur transform/opacity. */
@keyframes einblenden { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .einblenden { animation: einblenden linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
  }
}
/* Beim Laden: kurze Staffel für den ersten Bildschirm */
@keyframes auftauchen { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .auftauchen { animation: auftauchen 520ms var(--raus) both; }
  .auftauchen.v1 { animation-delay: 70ms; } .auftauchen.v2 { animation-delay: 140ms; }
  .auftauchen.v3 { animation-delay: 210ms; } .auftauchen.v4 { animation-delay: 300ms; }
}
