/* ============================================================
   Design-System - LiquidGlass (@ybouane/liquidglass, vendored)
   ------------------------------------------------------------
   Die Glasoptik kommt aus dem WebGL-Shader der Lib, NICHT aus CSS.
   Was hier steht, ist nur:
     - Layout, Typografie, Farben
     - die Geometrie, die der Shader spiegeln muss (border-radius!)
     - ein CSS-Fallback fuer den Fall, dass WebGL fehlt

   Regeln, die nicht gebrochen werden duerfen:
     - Glasflaechen brauchen position:relative + z-index:0. Die Lib
       injiziert ein <canvas> mit z-index:-1 als erstes Kind; ohne
       eigenen Stacking-Kontext rutscht das Canvas hinter die Seite.
     - Kein overflow:hidden auf Vorfahren von Glasflaechen - das
       schneidet den Schattenhof des Shaders ab.
     - border-radius im CSS muss zu cornerRadius im data-config passen,
       sonst sitzt die Brechungskante neben der sichtbaren Kante.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #05060e;
  --text: #f3f4fb;
  --text-dim: rgba(243, 244, 251, 0.62);
  --text-faint: rgba(243, 244, 251, 0.40);

  /* Neutrale, kuehle Palette - bewusst keine Lila/Pink-Verlaeufe.
     Akzent ist eine einzelne Farbe, kein Gradient. */
  --accent: #8fa6c4;
  --accent-strong: #cfdcea;
  --danger: #ff5f7e;
  --success: #3ddc97;

  --r-sm: 18px;
  --r-md: 22px;
  --r-lg: 30px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 0.85, 0.28, 1);
  --flip-dur: 0.75s;
}

* { box-sizing: border-box; }

/* Muss VOR allen display-Regeln stehen und !important sein: das
   hidden-Attribut kommt nur aus dem UA-Stylesheet und wird sonst von
   jedem eigenen display:flex/grid ueberstimmt - versteckte Felder
   waeren dann sichtbar. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* ------------------------------------------------------------
   Hintergrund
   Bewusst STATISCH: die Lib rastert nicht-dynamische Kinder einmalig.
   Ein animierter Hintergrund wuerde in der Brechung einfrieren und
   gegenueber dem echten DOM verrutschen. Ihn als data-dynamic zu
   markieren wuerde html-to-image pro Frame ausfuehren - unbezahlbar.
   Die Lebendigkeit kommt jetzt aus Refraktion und Specular.
   ------------------------------------------------------------ */
/* Ebenen bewusst explizit (siehe auch #lg-root > * in app.css):
     z-index 0 = .bg,  z-index 1 = alle Inhalte
   Zwei Fallstricke, die hier schon zugeschlagen haben:
   - z-index:-1 schiebt die Flaeche hinter den opaken body-Hintergrund,
     dann ist die Seite schwarz und das Glas hat nichts zu brechen.
   - gar kein z-index macht es zwar sichtbar, aber .bg ist position:fixed
     und uebermalt damit jeden statischen Inhalt (Ueberschriften waren weg). */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(60vmax 48vmax at 18% -6%, #2b3444 0%, transparent 64%),
    radial-gradient(54vmax 46vmax at 88% 6%, #333c4c 0%, transparent 62%),
    radial-gradient(48vmax 42vmax at 76% 98%, #202a38 0%, transparent 64%),
    var(--bg);
}
/* Nur Helligkeitsabstufungen, keine Buntheit: der Shader braucht Kontrast
   zum Brechen, aber die Flaeche soll neutral bleiben. */
.bg i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.30;
}
.bg i:nth-child(1) {
  width: 42vmax; height: 42vmax; top: 6%; left: 2%;
  background: radial-gradient(circle, #7c8798, transparent 70%);
}
.bg i:nth-child(2) {
  width: 36vmax; height: 36vmax; bottom: 4%; right: 0%;
  background: radial-gradient(circle, #5d6878, transparent 72%);
}
.bg i:nth-child(3) {
  width: 32vmax; height: 32vmax; top: 46%; left: 44%;
  background: radial-gradient(circle, #46505f, transparent 74%);
}

/* ------------------------------------------------------------
   Glasflaechen
   ------------------------------------------------------------ */
[data-glass] {
  position: relative;
  z-index: 1;           /* eigener Stacking-Kontext fuer das -1-Canvas */
  border-radius: var(--r-md);
  color: var(--text);
}

/* Fallback, solange der Shader nicht laeuft (oder gar kein WebGL da ist).
   Sobald glass-ready gesetzt ist, wird er entfernt - sonst liegt eine
   CSS-Flaeche unter dem Shader-Ergebnis und truebt es ein. */
[data-glass] {
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
body.glass-ready [data-glass] {
  background: transparent;
  box-shadow: none;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Primaer hebt sich ueber Helligkeit ab, nicht ueber Farbe - so bleibt
   die wichtigste Aktion erkennbar, ohne Farbverlauf. */
.btn--primary {
  background: rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
}
body.glass-ready .btn--primary[data-glass] {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}
.btn--sm { padding: 11px 14px; font-size: 0.88rem; border-radius: 14px; }

.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

.link {
  background: none; border: none;
  color: var(--text-dim);
  font: inherit; font-size: 0.85rem;
  text-decoration: underline; cursor: pointer;
  padding: 6px; align-self: center;
}

/* ------------------------------------------------------------
   Eingabefelder
   Bleiben bewusst klassisch: sie liegen INNERHALB einer Glasflaeche,
   sind also echtes DOM ueber dem Canvas (z-index:-1) und voll bedienbar.
   ------------------------------------------------------------ */
.input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit; font-size: 1rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  border-color: rgba(207, 220, 234, 0.75);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 0 3px rgba(207, 220, 234, 0.20);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 0.88rem; color: var(--text-dim); }

/* ------------------------------------------------------------
   Chips / Badges
   ------------------------------------------------------------ */
.chip {
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font: inherit; font-size: 0.85rem;
  cursor: pointer; user-select: none;
  transition: all 0.18s var(--ease);
}
.chip[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.badge {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid transparent;
}
.badge--ok {
  background: rgba(61, 220, 151, 0.16);
  border-color: rgba(61, 220, 151, 0.34);
  color: var(--success);
}
.badge--bad {
  background: rgba(255, 95, 126, 0.16);
  border-color: rgba(255, 95, 126, 0.34);
  color: var(--danger);
}

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