/* dm-assistent — Designsystem „Digitaler Mitarbeiter".
   Farbwelt + Schrift wie digitalma.at (site.css): #090B0D / #4DC5E3 / Inter.
   Reihenfolge: diese Datei ZUERST, assistentin.css danach (Modul baut darauf auf). */

/* ---------- Schrift lokal (DSGVO, kein CDN) ---------- */
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-v20-latin-500.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-v20-latin-600.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-v20-latin-700.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/inter-v20-latin-800.woff2") format("woff2"); }

:root {
  /* Flächen */
  --bg: #090B0D;
  --flaeche: #0F1216;
  --flaeche-2: #151A20;
  --flaeche-3: #1B2229;
  --rand: #1E252C;
  --rand-stark: #2B343D;
  --rand-input: #2B343D;
  /* Text */
  --ink: #F2F4F6;
  --ink-hover: #ffffff;
  --ink-weich: #A8B2BC;
  --ink-leise: #78838D;
  /* Akzent (Marke digitalma) */
  --tl: #4DC5E3;
  --tl-tief: #2A9CBA;
  --tl-ink: #07161C;
  --tl-weich: rgba(77, 197, 227, 0.12);
  --tl-rand: rgba(77, 197, 227, 0.32);
  --akzent: var(--tl);
  --akzent-hell: var(--tl-weich);
  /* Signale */
  --ok: #3DD68C;
  --ok-weich: rgba(61, 214, 140, 0.12);
  --erfolg: var(--ok);
  --fehler: #FF6B6B;
  --fehler-weich: rgba(255, 107, 107, 0.12);
  --warnung: #F5A623;
  --warnung-weich: rgba(245, 166, 35, 0.12);
  /* Maße */
  --glas: rgba(9, 11, 13, 0.82);
  --tap: 44px;
  --r-xs: 8px;
  --r-s: 10px;
  --radius: 14px;
  --r-l: 18px;
  --r-xl: 24px;
  --pille: 999px;
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.32);
  --schatten-hover: 0 2px 6px rgba(0, 0, 0, 0.55), 0 18px 44px rgba(0, 0, 0, 0.45);
  --glanz: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tempo: 160ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* ⚠ overflow-wrap: „anywhere" vs. „break-word" — der Unterschied ist NICHT kosmetisch:
   „anywhere" erlaubt beim Berechnen der Mindestbreite den Bruch mitten im Wort. In einer Flex-
   oder Grid-Zeile neben Knöpfen schrumpft die Textspalte dadurch auf Buchstabenbreite, und der
   Text läuft senkrecht („Leimholzplatte / n", Daniels Bilder 19.09.2026). „break-word" bricht ein
   Wort nur, wenn es allein nicht in die Zeile passt. Faustregel hier:
     Fließtext neben anderen Elementen -> break-word
     Rohtext-Blöcke und E-Mail-Adressen, die unbedingt passen müssen -> anywhere  */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font); font-weight: 500;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Ruhiger Lichtschein am oberen Rand — gibt der App Tiefe ohne Farbe zu verbrauchen */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 100% at 50% 0%, rgba(77, 197, 227, 0.07) 0%, rgba(77, 197, 227, 0) 70%);
}
a { color: var(--tl); text-underline-offset: 2px; }
h1, h2, h3, legend { font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.5rem; line-height: 1.25; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.1875rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1rem; }
svg { display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
::selection { background: var(--tl); color: var(--tl-ink); }
:focus-visible { outline: 2px solid var(--tl); outline-offset: 2px; border-radius: 4px; }

/* Dünne, unaufdringliche Scrollbalken */
* { scrollbar-width: thin; scrollbar-color: var(--rand-stark) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--rand-stark); border-radius: var(--pille); border: 3px solid var(--bg); }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--glas); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--rand); }
.kopf-inner { max-width: 1140px; margin: 0 auto; padding: 0.75rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.marke { display: flex; align-items: center; gap: 0.75rem; color: var(--ink); text-decoration: none; min-width: 0; flex: 1; }
.marke img { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; box-shadow: var(--schatten), 0 0 0 1px var(--rand); }
.marke b { font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.marke small { display: block; color: var(--ink-leise); font-size: 0.75rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; align-items: center; gap: 0.25rem; }
.tab-link {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0.5rem 0.9375rem;
  border-radius: var(--pille); color: var(--ink-weich); text-decoration: none; font-size: 0.9375rem; font-weight: 600;
  transition: color var(--tempo), background var(--tempo);
}
.tab-link svg { width: 19px; height: 19px; stroke-width: 2; }
.tab-link:hover { color: var(--ink); background: var(--flaeche-2); }
.tab-link[aria-current="page"] { color: var(--tl); background: var(--tl-weich); box-shadow: inset 0 0 0 1px var(--tl-rand); }
#logout-btn { border-radius: var(--pille); }

@media (max-width: 720px) {
  /* ⚠ CSS-Falle, gefunden 19.09.2026 an Daniels Handy: Ein Element mit backdrop-filter wird zum
     Bezugsrahmen für position:fixed-NACHKOMMEN. Die Tab-Leiste steckt im Kopf — mit Blur am Kopf
     klebte sie deshalb OBEN am Kopf statt unten am Bildschirm und verdeckte Name und Firma.
     Am Handy braucht der Kopf kein Glas; deckende Fläche löst es ohne HTML-Umbau. */
  .kopf { backdrop-filter: none; background: var(--bg); }
  .kopf-inner { padding: 0.625rem 1rem; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; gap: 0;
    padding: 0.375rem 0.5rem calc(0.375rem + env(safe-area-inset-bottom));
    background: var(--glas); backdrop-filter: blur(14px) saturate(140%); border-top: 1px solid var(--rand);
  }
  .tab-link { flex-direction: column; gap: 0.1875rem; font-size: 0.6875rem; padding: 0.375rem 0.75rem; border-radius: var(--r-s); }
  .tab-link svg { width: 22px; height: 22px; }
  .tab-link[aria-current="page"] { background: transparent; box-shadow: none; }
  body { padding-bottom: 78px; }
}

/* ---------- Inhalt + Karten ---------- */
.inhalt { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; }
@media (max-width: 720px) { .inhalt { padding: 1rem 1rem 2rem; } }
.tab-panel { display: block; }

.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r-l);
  padding: 1.25rem; margin: 0 0 1rem; box-shadow: var(--schatten), var(--glanz);
}
.karte legend, .karte > h2, .karte > h3 {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-leise); margin: 0 0 0.875rem;
}
.karte-intro { margin: -0.375rem 0 1rem; color: var(--ink-weich); font-size: 0.9375rem; }
fieldset.karte { min-width: 0; }

/* ---------- Knöpfe ---------- */
.btn-primary, .btn-sekundaer, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: var(--tap);
  padding: 0.625rem 1.125rem; border-radius: var(--r-s); font: inherit; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--tempo), color var(--tempo), border-color var(--tempo), transform 80ms, box-shadow var(--tempo);
}
.btn-primary:active, .btn-sekundaer:active, .btn-ghost:active { transform: translateY(1px); }
.btn-primary { background: var(--tl); color: var(--tl-ink); border: 1px solid var(--tl); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(77,197,227,.18); }
.btn-primary:hover { background: #63D3EE; border-color: #63D3EE; }
.btn-sekundaer { background: var(--flaeche-2); color: var(--ink); border: 1px solid var(--rand-stark); }
.btn-sekundaer:hover { background: var(--flaeche-3); border-color: #3A454F; }
.btn-ghost { background: transparent; color: var(--ink-weich); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--flaeche-2); }
.btn-primary:disabled, .btn-sekundaer:disabled, .btn-ghost:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn-primary svg, .btn-sekundaer svg, .btn-ghost svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-icon { padding: 0.5rem; min-width: var(--tap); }
.btn-voll { width: 100%; }
.btn-gefahr { color: var(--fehler); border-color: rgba(255, 107, 107, 0.4); }
.btn-gefahr:hover { background: var(--fehler-weich); border-color: var(--fehler); }

/* ---------- Formulare ---------- */
.feld { margin-bottom: 1.125rem; }
.feld-zeile { display: grid; gap: 1.125rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feld-zeile { grid-template-columns: 1fr 1fr; } }
.feld label, .feld .label {
  display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-weich); margin-bottom: 0.4375rem; text-transform: none;
}
.feld input:not([type="checkbox"]):not([type="radio"]), .feld select, .feld textarea {
  width: 100%; min-height: var(--tap); padding: 0.6875rem 0.875rem; font: inherit; font-weight: 500; color: var(--ink);
  background: var(--flaeche-2); border: 1px solid var(--rand-stark); border-radius: var(--r-s);
  transition: border-color var(--tempo), box-shadow var(--tempo), background var(--tempo);
}
.feld input::placeholder, .feld textarea::placeholder { color: var(--ink-leise); }
.feld textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.feld input:hover, .feld select:hover, .feld textarea:hover { border-color: #3A454F; }
.feld input:focus, .feld select:focus, .feld textarea:focus {
  outline: none; border-color: var(--tl); background: var(--flaeche-3); box-shadow: 0 0 0 3px var(--tl-weich);
}
.feld select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8B2BC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 18px; padding-right: 2.5rem; }
.feld-hilfe { display: block; margin-top: 0.4375rem; font-size: 0.8125rem; color: var(--ink-leise); line-height: 1.5; }
.feld-check { display: flex; align-items: center; gap: 0.75rem; min-height: var(--tap); }
.feld-check input { width: 20px; height: 20px; accent-color: var(--tl); flex-shrink: 0; }
.feld-check label { font-size: 0.9375rem; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; font-weight: 500; }
.tage { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tage label {
  display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.5rem 0.75rem; border: 1px solid var(--rand-stark);
  border-radius: var(--pille); font-size: 0.875rem; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--ink-weich); cursor: pointer; margin: 0; transition: all var(--tempo);
}
.tage label:hover { border-color: #3A454F; color: var(--ink); }
.tage label:has(input:checked) { background: var(--tl-weich); border-color: var(--tl-rand); color: var(--tl); }
.tage input { accent-color: var(--tl); }
.form-fehler { color: var(--fehler); min-height: 1.25rem; margin: 0.5rem 0 0; font-size: 0.9375rem; }
.aktionen { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; padding: 1.25rem; min-height: 100dvh; }
.login-karte {
  width: 100%; max-width: 408px; background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--r-xl); padding: 2rem 1.75rem; box-shadow: var(--schatten-hover), var(--glanz);
}
.login-logo { width: 60px; height: 60px; border-radius: 16px; display: block; margin: 0 auto 1.25rem; box-shadow: var(--schatten); }
.login-karte h1 { text-align: center; margin-bottom: 0.25rem; font-size: 1.5rem; }
.login-karte .unter { text-align: center; color: var(--ink-leise); margin-bottom: 1.75rem; font-size: 0.9375rem; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 1rem; right: 1rem; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast {
  padding: 0.8125rem 1rem; border-radius: var(--radius); background: var(--flaeche-3); border: 1px solid var(--rand-stark);
  color: var(--ink); box-shadow: var(--schatten-hover); font-size: 0.9375rem;
  opacity: 0; transform: translateY(-8px) scale(0.98); transition: opacity 200ms, transform 200ms;
}
.toast.sichtbar { opacity: 1; transform: none; }
.toast-ok { border-left: 3px solid var(--ok); }
.toast-fehler { border-left: 3px solid var(--fehler); }
@media (max-width: 720px) { #toasts { top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); left: 1rem; right: 1rem; max-width: none; } }

/* ---------- Modal / Einrichtung ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 8, 0.78); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 1.25rem; overflow: auto; }
.modal-karte {
  width: 100%; max-width: 580px; background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--r-xl); padding: 1.75rem; box-shadow: var(--schatten-hover), var(--glanz);
}
.modal-karte .schritt-nr { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tl); margin-bottom: 0.5rem; }
.modal-karte h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.wizard-schritt[hidden] { display: none; }
.wizard-fuss { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.radios { display: grid; gap: 0.5rem; }
.radios label {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8125rem 0.9375rem; border: 1px solid var(--rand-stark);
  border-radius: var(--r-s); text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 0.9375rem;
  font-weight: 500; cursor: pointer; margin: 0; transition: all var(--tempo);
}
.radios label:hover { border-color: #3A454F; background: var(--flaeche-2); }
.radios label:has(input:checked) { border-color: var(--tl-rand); background: var(--tl-weich); }
.radios input { margin-top: 0.1875rem; accent-color: var(--tl); flex-shrink: 0; }
.radios small { display: block; color: var(--ink-leise); font-weight: 500; }

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