/* Spotlight-Register: Handy-Seite fuer den MagicInfo-Rollout.
   Hell/Dunkel folgt dem System (prefers-color-scheme). Keine Emojis, nur SVG. Ziel: 375 px breite Handys,
   keine waagerechte Scrollleiste, Tippflaechen mindestens 44 px. CSP: style-src 'self', daher keine Inline-Styles. */

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #5f6b7a;
  --border: #d9dfe7;
  --accent: #2f66b3;
  --accent-text: #ffffff;
  --hover: rgba(47, 102, 179, 0.07);
  --ok: #1f8a4c;
  --ok-bg: rgba(31, 138, 76, 0.1);
  --warn: #9a6700;
  --warn-bg: rgba(212, 160, 23, 0.14);
  --fehler: #b42828;
  --fehler-bg: rgba(192, 82, 82, 0.1);
  --info-bg: rgba(47, 102, 179, 0.08);
  --badge-bg: rgba(47, 102, 179, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --card: #181e25;
    --text: #e5e9ef;
    --muted: #9aa6b4;
    --border: #2c3540;
    --accent: #6f9fdc;
    --accent-text: #0d1520;
    --hover: rgba(111, 159, 220, 0.1);
    --ok: #5cc98a;
    --ok-bg: rgba(92, 201, 138, 0.12);
    --warn: #e6b84a;
    --warn-bg: rgba(230, 184, 74, 0.13);
    --fehler: #ec8a8a;
    --fehler-bg: rgba(236, 138, 138, 0.12);
    --info-bg: rgba(111, 159, 220, 0.12);
    --badge-bg: rgba(111, 159, 220, 0.2);
  }
}

* { box-sizing: border-box; }
/* PFLICHT: eigene display-Regeln ueberstimmen sonst das hidden-Attribut (Lehre aus abwesenheiten-extern). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}
h1, h2 { overflow-wrap: anywhere; }
svg { flex-shrink: 0; }

/* ── Grundbausteine ── */
.karte {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 16px; display: flex; flex-direction: column;
}
.unterzeile { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.feld-titel { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.tipp { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }
.freiwillig { font-weight: 400; }

input, select, button { font: inherit; color: inherit; }
.eingabe, .suche, .pin, .login-karte input {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text);
}
.eingabe:focus, .suche:focus, .pin:focus, .login-karte input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.suche { font-size: 1.25rem; letter-spacing: 0.04em; }
.pin {
  font-size: 26px; letter-spacing: 0.12em; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  min-height: 56px;
}
select.eingabe { appearance: auto; }

.knopf {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 16px; margin-top: 16px; border-radius: 10px; cursor: pointer;
  font-size: 1.05rem; font-weight: 600; text-align: center;
}
.knopf-haupt { background: var(--accent); color: var(--accent-text); border: none; }
.knopf-haupt:disabled { opacity: 0.6; cursor: wait; }
.knopf-neben { background: var(--card); color: var(--text); border: 1px solid var(--border); font-weight: 500; font-size: 0.95rem; }
.knopf-neben:hover, .knopf-neben:focus-visible { border-color: var(--accent); }
.knopf-text {
  display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 8px; cursor: pointer;
  background: none; border: none; color: var(--accent); font-size: 0.95rem; text-align: center;
  text-decoration: underline; text-underline-offset: 3px;
}
.knopf-klein {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--muted);
  font-size: 0.85rem; cursor: pointer;
}
.knopf-klein:hover, .knopf-klein:focus-visible { color: var(--text); border-color: var(--accent); }
.knopf-zurueck {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 6px 8px 0; margin-bottom: 6px;
  background: none; border: none; color: var(--accent); font-size: 0.95rem; cursor: pointer;
}

.meldung { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 0.92rem; overflow-wrap: anywhere; }
.meldung-fehler { color: var(--fehler); background: var(--fehler-bg); }
.meldung-warn { color: var(--warn); background: var(--warn-bg); }
.meldung-info { color: var(--text); background: var(--info-bg); }

/* ── Anmeldung ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-karte { width: 100%; max-width: 380px; }
.login-icon { color: var(--accent); margin: 0 auto 10px; }
.login-karte h1 { margin: 0; font-size: 1.3rem; text-align: center; }
.login-karte .unterzeile { text-align: center; margin-bottom: 8px; }
.login-karte label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.version { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 0.72rem; opacity: 0.8; }

/* ── Seite ── */
.seite {
  max-width: 560px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
.kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.kopf-text { min-width: 0; }
.kopf h1 { margin: 0; font-size: 1.2rem; line-height: 1.25; }
#fortschritt { font-variant-numeric: tabular-nums; }

/* ── Treffer ── */
.treffer { margin-top: 10px; }
.leer { color: var(--muted); padding: 14px 2px; margin: 0; }
.gruppe { margin-top: 14px; }
.gruppe h2 { font-size: 0.95rem; font-weight: 600; margin: 0 0 6px; color: var(--muted); }
.geraete { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.geraete li + li { border-top: 1px solid var(--border); }
.geraet {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 12px 10px 14px;
  background: none; border: none; text-align: left; color: var(--text); font-size: 1rem;
}
button.geraet { cursor: pointer; }
button.geraet:hover, button.geraet:focus-visible { background: var(--hover); }
button.geraet:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.geraet-haupt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.geraet-name { font-weight: 600; overflow-wrap: anywhere; }
.geraet-meta { color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.geraet-ende { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.geraet-fertig .geraet-name { font-weight: 500; color: var(--muted); }
.ende-ok { color: var(--ok); }
.ende-warn { color: var(--warn); }
.ende-fehler { color: var(--fehler); }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 9px;
  background: var(--badge-bg); color: var(--accent); white-space: nowrap;
}

/* ── Geraet ── */
.geraet-titel { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.angaben { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: 0.95rem; }
.angaben dt { color: var(--muted); }
.angaben dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── Ergebnis ── */
.ergebnis { align-items: center; text-align: center; padding-top: 22px; }
.ergebnis-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stufe-ok .ergebnis-icon { color: var(--ok); background: var(--ok-bg); }
.stufe-warn .ergebnis-icon { color: var(--warn); background: var(--warn-bg); }
.stufe-fehler .ergebnis-icon { color: var(--fehler); background: var(--fehler-bg); }
.stufe-ok { border-color: var(--ok); }
.stufe-warn { border-color: var(--warn); }
.stufe-fehler { border-color: var(--fehler); }
.ergebnis-text { margin: 12px 0 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.aktionen .knopf + .knopf { margin-top: 10px; }

.fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 28px; color: var(--muted); font-size: 0.75rem; }
.fuss-abmelden { margin-left: auto; }
