/* Zwei-Faktor-Anmeldung (web/js/zweifaktor.js): zweiter Schritt nach Discord, Fenster „Kurz bestätigen“, Karte in den Einstellungen,
   Hinweis für Moderation und Dev. Nach docs/STIL.md: Schrift nur 20 und 30 px, Farben nur aus den Tokens, keine runden Ecken und
   keine weichen Schatten, Tippflächen ab 44 px, Fokus wie überall in Messing (style.css). Der QR-Code: Tinte auf Pergament,
   ringsum vier helle Module (im Bild), außen das vertiefte Messingfeld. */

/* Lange Wörter (Wiederherstellungscodes, Zwei-Faktor-Anmeldung …) brechen bei 160 % Zoom bzw. schmalem Bildschirm notfalls mitten
   im Wort um, statt die Seite seitlich zu verschieben */
.zf, .zf-schritt, .zf-dialog .card, .zf-pflicht, .zf-admin { overflow-wrap: anywhere; }
.zf .btn, .zf-schritt .btn, .zf-dialog .btn, .zf-pflicht .btn, .zf-admin .btn { max-width: 100%; }
.zf h3, .zf-schritt h3, .zf-dialog h3 { margin: 14px 0 2px; font-size: 20px; line-height: 30px; display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; }
.zf .badge, .zf-schritt .badge { margin-left: 0; }
.zf-knoepfe, .zf-zeile-knoepfe { justify-content: flex-start; gap: 6px; }
.zf-knoepfe { margin: 6px 0; }
.zf-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 4px 0; }
.zf-feld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.zf-feld > span { font-weight: 700; }
input.zf-eingabe, input.zf-name { color: var(--ink); background: none; border-style: solid; border-width: 8px; width: 100%; min-width: 0;
  border-image: url("/img/ui/field.png") 4 fill / 8px stretch; image-rendering: pixelated; }
input.zf-eingabe { font: 700 30px/40px var(--font); letter-spacing: .1em; padding: 2px 8px; max-width: 360px; min-height: 60px; }
input.zf-name { font: 400 20px/30px var(--font); padding: 2px 6px; min-height: 44px; }
input.zf-eingabe::placeholder, input.zf-name::placeholder { color: var(--soft); opacity: 1; }
.zf-hinweis { margin: 4px 0; min-height: 30px; font-weight: 700; color: var(--wine); }
.zf-hinweis:empty { margin: 0; min-height: 0; }
.zf-uhr { margin: 2px 0; }
.zf-warnung { margin: 8px 0; padding: 4px 10px; font-weight: 700; color: var(--wine); border-style: solid; border-width: 6px 6px 8px;
  border-image: url("/img/ui/chip-paper.png") 3 3 4 fill / 6px 6px 8px stretch; }

/* Passkeys: je einer ein Pergamentschild wie die Geräteliste */
.zf-liste { display: grid; gap: 8px; margin: 6px 0; }
.zf-liste li { display: grid; gap: 2px 8px; padding: 2px 8px 4px; border-style: solid; border-width: 6px 6px 8px;
  border-image: url("/img/ui/chip-paper.png") 3 3 4 fill / 6px 6px 8px stretch; }
.zf-liste li strong { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; overflow-wrap: anywhere; }
.zf-umbenennen { display: grid; gap: 6px; }

/* Offener Teil der Karte (App einrichten, neue Codes, neu anmelden): Messingschild */
.zf-panel { margin: 8px 0 12px; padding: 4px 10px 8px; border-style: solid; border-width: 6px 6px 8px;
  border-image: url("/img/ui/chip-butter.png") 3 3 4 fill / 6px 6px 8px stretch; }
.zf-panel > h3:first-child { margin-top: 2px; }
.zf-qr-rahmen { line-height: 0; width: max-content; margin: 6px 0; background: var(--paper); border: 14px solid;
  border-image: url("/img/ui/field.png") 4 stretch; }
.zf-qr-rahmen[hidden] { display: none; }
canvas.zf-qr { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.zf-geheim { font: 700 20px/30px var(--font); letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; margin: 2px 0 8px; }
.zf-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 2px 16px; margin: 6px 0; padding-left: 0;
  list-style: decimal inside; font: 700 20px/30px var(--font); letter-spacing: .06em; user-select: all; }

/* Zweiter Schritt und Fenster „Kurz bestätigen“ (über allem, auch über dem Dev-Menü) */
.zf-schritt .zf-passkey, .zf-dialog .zf-passkey { min-width: min(320px, 100%); }
.zf-dialog { z-index: 60; }
.zf-dialog .card { width: min(480px, 100%); justify-items: stretch; text-align: left; max-height: calc(100vh - 32px); overflow-y: auto; }
.zf-dialog .zf-knoepfe { justify-content: flex-start; }

/* Hinweis statt der Funktion (Moderation, Dev) und Admin-Hilfe in der Moderationsübersicht */
.zf-pflicht { display: grid; gap: 2px; }
.zf-pflicht .btn { justify-self: start; text-decoration: none; }
.zf-admin { display: grid; gap: 6px; margin-top: 6px; grid-column: 1 / -1; }

/* Kontrastdesign (erzwungene Farben): wie style.css – Bildrahmen weg, Ränder in Systemfarben; der QR-Code (Leinwand) bleibt, wie er
   ist, und hat seine helle Ruhezone im Bild selbst */
@media (forced-colors: active) {
  .zf-panel, .zf-warnung, .zf-liste li { border-image: none !important; border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
  .zf-qr-rahmen { border-image: none !important; border: 2px solid CanvasText; }
}
