/* Zentrale – neutrales Grundgerüst. Alle Farben/Abstände als Variablen: Design-Varianten später nur hier tauschen. */
:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5e59;
  --border: #dddbd5;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --danger-bg: #fbe9e7;
  --danger-text: #8a1f11;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
  --radius: 10px;
  --space: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515;
    --surface: #1f1f1e;
    --text: #ecebe7;
    --muted: #a3a19b;
    --border: #34332f;
    --accent: #6fb0e0;
    --accent-text: #0b1a26;
    --danger-bg: #3a1a15;
    --danger-text: #f4b3a8;
    --warn-bg: #3a2f10;
    --warn-text: #f1d58a;
  }
}

/* ---- Hintergrundbild-Thema „Netz“ (Test 2026-09-29): dunkles Farbschema + Glas-Kacheln ----
   Abschalten: in views.js das Attribut data-bild am <html> entfernen. */
:root[data-bild] {
  --bg: #040a17;
  --surface: rgba(8, 20, 40, 0.62);
  --text: #e9f2ff;
  --muted: #a8bdd8;
  --border: rgba(110, 170, 235, 0.28);
  --accent: #5cc8ff;
  --accent-text: #021320;
  --danger-bg: rgba(120, 25, 20, 0.55);
  --danger-text: #ffd0c8;
  --warn-bg: rgba(110, 85, 10, 0.55);
  --warn-text: #ffe9a8;
  color-scheme: dark;
}
:root[data-bild] body { background: var(--bg); }
:root[data-bild] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 8, 20, 0.55) 0%, rgba(3, 8, 20, 0.35) 45%, rgba(3, 8, 20, 0.8) 100%),
    url("/static/bg/netz-quer.webp") 72% 50% / cover no-repeat;
}
@media (max-aspect-ratio: 4/5) {
  :root[data-bild] body::before {
    background:
      linear-gradient(180deg, rgba(3, 8, 20, 0.6) 0%, rgba(3, 8, 20, 0.45) 50%, rgba(3, 8, 20, 0.85) 100%),
      url("/static/bg/netz-hoch.webp") 50% 30% / cover no-repeat;
  }
}
:root[data-bild] .topnav { background: rgba(4, 12, 28, 0.7); border-bottom-color: var(--border); }
:root[data-bild] .tile,
:root[data-bild] .topnav { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
:root[data-bild] .tile-soon { opacity: 0.75; }
:root[data-bild] a.tile:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(92, 200, 255, 0.25); }
:root[data-bild] input:not([type=checkbox]) { background: rgba(255, 255, 255, 0.07); }
:root[data-bild] .greeting { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }

.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--text); text-decoration: none; }
.logout { margin: 0; }

main { padding: 1.5rem 1rem 3rem; margin: 0 auto; }
main.narrow { max-width: 26rem; }
main.wide { max-width: 64rem; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.35rem; }
.hint { color: var(--muted); }
.mono { font-family: var(--mono); letter-spacing: 0.05em; }

.stack { display: grid; gap: 0.9rem; margin: 1rem 0; }
label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
input[type=text], input:not([type]), input[type=password] {
  font: inherit; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); width: 100%;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: var(--radius);
  padding: 0.75rem 1rem; background: var(--accent); color: var(--accent-text); text-decoration: none;
  display: inline-block; text-align: center; min-height: 44px;
}
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0.5rem; min-height: 44px; }

.alert { padding: 0.75rem 0.9rem; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger-text); }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }

.fallback { margin: 1.25rem 0; }
.fallback summary { cursor: pointer; color: var(--accent); }

.qr { display: block; margin: 1rem auto; background: #fff; padding: 8px; border-radius: var(--radius); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem 1.5rem; padding-left: 1.5rem; font-size: 1.05rem; }

.greeting { margin-bottom: 1.25rem; }
.tiles { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tile {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; color: var(--text); text-decoration: none; min-height: 7.5rem;
}
a.tile:hover { border-color: var(--accent); }
.tile p { margin: 0; color: var(--muted); }
.tile-links ul { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.tile-links a { color: var(--accent); font-weight: 600; }
.tile-soon { opacity: 0.6; border-style: dashed; }
.back { color: var(--accent); text-decoration: none; }

@media print {
  .topnav, form, .btn, .fallback { display: none !important; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
