/* HACO Exchange — Grundstile und Grundkomponenten. Nur Tokens aus tokens.css (DESIGN.md Regel 1).
   Pillenform für Klickbares, Trefferfläche ≥ var(--hit), Akzent nur als Fläche. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-size: var(--fs-body); line-height: 20px; font-weight: 500; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-title); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--text); }
h2 { font-size: var(--fs-section); font-weight: 700; line-height: 1.25; }
a { color: var(--text); text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: var(--space-0); }
.overline { margin: 0 0 var(--space-2); font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.text-2 { color: var(--text-2); }
.hinweis { color: var(--text-3); font-size: var(--fs-small); }
.sprunglink { position: absolute; left: var(--space-4); top: -100px; z-index: 10; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); background: var(--ink); color: var(--ink-text); }
.sprunglink:focus { top: var(--space-4); }

/* Bewegung (seed-170, DESIGN.md „Bewegung“). Tokens --dauer-* und --kurve-* aus tokens.css.
   „Bewegung reduzieren“ im System: keine Animation und kein Übergang, nur sofortige Zustände (Verzögerungen
   von Animationen bleiben, z. B. der Mauszeiger bei data-skript nach 8 s). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
/* Beim Wechsel von Hell/Dunkel springen die Farben sofort um, ohne Farbübergänge (theme.js setzt das Attribut für zwei Bilder) */
[data-thema-wechsel] *, [data-thema-wechsel] *::before, [data-thema-wechsel] *::after { transition: none !important; }

/* Logo: fest in Markenfarben, hell auf Hell, dunkel auf Dunkel */
.logo { display: block; height: auto; }
.logo-dunkel { display: none; }
[data-theme="dark"] .logo-hell { display: none; }
[data-theme="dark"] .logo-dunkel { display: block; }
/* Eigenes Logo (Einstellungen › Benutzeroberfläche): eine Datei für beide Modi, im Dunkelmodus auf Papierweiß */
.logo-eigen { width: auto; max-width: 100%; object-fit: contain; }
[data-theme="dark"] .logo-eigen { background: var(--paper); border-radius: var(--radius-field); padding: var(--space-1) var(--space-2); }

/* Karten */
.karte { background: var(--surface); border-radius: var(--radius-panel); box-shadow: var(--shadow); padding: var(--space-6); }

/* Schlichtes Layout (Login, Passwort, Fehler) */
body.schlicht { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4); }
.schlicht-rahmen { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-6); }
.schlicht-logo { align-self: center; display: block; width: 200px; }
.schlicht-logo .logo { width: 100%; }
.schlicht-logo .logo.logo-eigen { width: auto; max-height: 96px; margin-inline: auto; }
.schlicht-karte { padding: var(--space-7); display: flex; flex-direction: column; gap: var(--space-4); }
.schlicht-link { text-align: center; }
.schlicht-fuss { text-align: center; color: var(--text-3); font-size: var(--fs-small); }
/* Login und die anderen schlichten Seiten: bewegter Hintergrund (seed-185, Lars 30.10.2026) aus js/kern/login-hintergrund.js,
   weiche Farbflächen und geschwungene Linien in Akzentfarbe auf Graphit, die Mitte bleibt ruhig für die Karte. Ohne Skript
   oder bei einem Fehler bleibt das Standbild (OpenArt, 29.10.2026: zwei gegenläufige Lichtbänder in Akzentgrün). In Hell und
   Dunkel derselbe Hintergrund, deshalb hier Logo und Fußzeile immer hell. Ohne Bild bleibt der Grund Graphit. */
body.schlicht { position: relative; isolation: isolate; background: var(--ink); }
[data-theme="dark"] body.schlicht { background: var(--bg); }
body.schlicht::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: center / cover no-repeat url("../marke/login-hintergrund.jpg");
  background-image: image-set(url("../marke/login-hintergrund.webp") type("image/webp"), url("../marke/login-hintergrund.jpg") type("image/jpeg"));
  transform-origin: 50% 55%; animation: schlicht-atmen 48s ease-in-out infinite alternate;
}
@media (max-width: 900px) {
  body.schlicht::before {
    background-image: url("../marke/login-hintergrund-klein.jpg");
    background-image: image-set(url("../marke/login-hintergrund-klein.webp") type("image/webp"), url("../marke/login-hintergrund-klein.jpg") type("image/jpeg"));
  }
}
@keyframes schlicht-atmen { from { transform: scale(1); } to { transform: scale(1.06) translateY(-1%); } }
@media (prefers-reduced-motion: reduce) { body.schlicht::before { animation: none; } }
/* Bühne der Animation (vom Skript eingesetzt): blendet über das Standbild, danach ruht das Bild (verborgen, ohne Atmen) */
.schlicht-buehne { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: strict; opacity: 0; }
.schlicht-buehne > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
[data-hintergrund="bewegt"] .schlicht-buehne { opacity: 1; transition: opacity var(--dauer-lang) var(--kurve-standard); }
[data-hintergrund="bewegt"] body.schlicht::before { animation: none; visibility: hidden; transition: visibility var(--dauer-lang); }
@media print { body.schlicht::before, .schlicht-buehne { display: none; } body.schlicht { background: none; } }
body.schlicht .schlicht-karte { box-shadow: var(--shadow-dialog); }
/* Karte und Marke blenden beim Laden weich ein (nur Deckkraft, nichts verschiebt sich unter dem Zeiger) */
body.schlicht .schlicht-rahmen { animation: blende-ein var(--dauer-lang) var(--kurve-standard) backwards; }
@keyframes blende-ein { from { opacity: 0; } }
[data-theme="dark"] body.schlicht .schlicht-karte { border: 1px solid var(--line); }
body.schlicht .schlicht-logo .logo-hell { display: none; }
body.schlicht .schlicht-logo .logo-dunkel { display: block; }
body.schlicht .schlicht-logo .logo-eigen { background: var(--paper); border-radius: var(--radius-field); padding: var(--space-1) var(--space-2); }
body.schlicht .schlicht-fuss { color: var(--ink-text); opacity: .72; }
[data-theme="dark"] body.schlicht .schlicht-fuss { color: var(--text-2); opacity: 1; }

/* Knöpfe (Pille) */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--hit); padding: 0 var(--space-5); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-body); font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--dauer-kurz) var(--kurve-standard); }
/* Farben gleiten nur beim Überfahren hinein; beim Verlassen und bei Zustandswechseln (gesperrt, Hell/Dunkel) springen sie sofort */
.knopf:hover { background: var(--surface-2); transition: background-color var(--dauer-kurz) var(--kurve-standard), border-color var(--dauer-kurz) var(--kurve-standard), color var(--dauer-kurz) var(--kurve-standard), opacity var(--dauer-kurz) var(--kurve-standard), transform var(--dauer-kurz) var(--kurve-standard); }
/* Knöpfe geben beim Drücken leicht nach (breite Knöpfe weniger, sonst wirkt es wie ein Sprung) */
.knopf:active:not([disabled], [aria-disabled="true"], .knopf-inaktiv) { transform: scale(.96); }
.knopf.knopf-breit:active:not([disabled], [aria-disabled="true"], .knopf-inaktiv) { transform: scale(.99); }
.knopf-ink { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.knopf-ink:hover { background: var(--ink); opacity: .9; }
.knopf-akzent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.knopf-breit { width: 100%; }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: var(--space-4); }
.feld { display: flex; flex-direction: column; gap: var(--space-2); }
.feld-label { font-size: var(--fs-label); font-weight: 700; color: var(--text-2); }
.eingabe { width: 100%; min-height: var(--hit); padding: 0 var(--space-4); border-radius: var(--radius-field); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-body); }
.eingabe::placeholder { color: var(--text-3); }
.eingabe:focus-visible { outline: 3px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.feld-fehler .eingabe { border-color: var(--danger); }
.feld-meldung { font-size: var(--fs-small); font-weight: 600; color: var(--danger); }

/* Meldungen */
.meldung { padding: var(--space-3) var(--space-4); border-radius: var(--radius-note); font-size: var(--fs-small); font-weight: 600; }
.meldung-ok { background: var(--surface-2); color: var(--text); }
.meldung-fehler { background: var(--warn-bg); color: var(--warn-text); }
