/* ===================== Anmeldung (Leitstand 2, js/anmeldung.js) =====================
   Immer dunkel, unabhängig von html[data-theme]: alle Farben als lokale Variablen auf .anm.
   Marke über .anm[data-marke="bau" | "med"]: iPersonal Rot (sparsam), MediPersonal Blau mit Grün, ohne Rot.
   Die Anzeige-Regel steht nur als .anm:not(.hidden), damit .hidden die Anmeldung nach dem Anmelden sicher ausblendet. */
.anm {
  color-scheme: dark;
  /* Marke iPersonal */
  --ak: #E40313; --ak-rgb: 228, 3, 19; --ak-btn: #E40313; --ak-btn-2: #B8020F; --ak-btn-h: #C9020F;
  --ink: #FF5C66; --ak2: #D7DCE4; --ak2-deko: #D7DCE4;
  /* Thema dunkel, auch für Formulare in der Karte (Vermittler-Registrierung) */
  --bg: #050608; --app: #0A0B0E; --sb: #0C0E11;
  --flaeche: #111317; --flaeche-b: #0E1013; --flaeche-2: #15181D; --flaeche-3: #1C2027; --feld: #07080A; --knopf: #15181D; --input: var(--feld);
  --glass: var(--flaeche); --glass-2: var(--flaeche-2);
  --line: rgba(214, 222, 236, .08); --line-strong: rgba(214, 222, 236, .14); --line-3: rgba(214, 222, 236, .26);
  --text: #EDEFF3; --muted: #A9AFBA; --muted-2: #8A919C;
  --silber: #D7DCE4; --silber-rgb: 215, 220, 228;
  --glas: rgba(14, 16, 20, .74); --glas-voll: rgba(17, 19, 24, .985); --hover: rgba(214, 222, 236, .05);
  --ok-bg: rgba(74, 222, 128, .09); --ok-tx: #8EE0AC; --ok-ln: rgba(74, 222, 128, .26);
  --warn-bg: rgba(250, 204, 21, .085); --warn-tx: #EFD27E; --warn-ln: rgba(250, 204, 21, .24);
  --info-bg: rgba(167, 139, 250, .11); --info-tx: #C8BBFF; --info-ln: rgba(167, 139, 250, .3);
  --neu-bg: rgba(205, 214, 228, .06); --neu-tx: #C2C7D0; --neu-ln: rgba(205, 214, 228, .17);
  --gefahr-bg: rgba(248, 113, 113, .09); --gefahr-tx: #F4A3A3; --gefahr-ln: rgba(248, 113, 113, .28);
  --ring: var(--ak); --fokus: var(--ak);
  --ak-bg: rgba(var(--ak-rgb), .10); --ak-ln: rgba(var(--ak-rgb), .42); --primary-glow: rgba(var(--ak-rgb), .45);
  --primary: var(--ak-btn); --primary-2: var(--ink);
  /* Karte bei Nacht */
  --anm-land-a: rgba(222, 230, 244, .10); --anm-land-b: rgba(222, 230, 244, .024);
  --anm-kontur: rgba(232, 238, 248, .6); --anm-glut: rgba(232, 238, 248, .16); --anm-glut2: rgba(232, 238, 248, .045);
  --anm-see: #08090C; --anm-see-rand: rgba(214, 222, 236, .22); --anm-bahn: rgba(214, 222, 236, .15);
  --anm-nachbar: rgba(214, 222, 236, .34); --anm-halo: #0A0B0E;
  --anm-paket: #D7DCE4;
  position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr); align-items: center; justify-items: start; padding: 92px 0 76px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.4; color: var(--text); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 600px at 70% 45%, rgba(196, 208, 230, .06), transparent 70%), #08090B;
}
.anm[data-marke="med"] {
  --ak: #0A9BD9; --ak-rgb: 10, 155, 217; --ak-btn: #0879B2; --ak-btn-2: #05608E; --ak-btn-h: #06689C;
  --ink: #5CCBF7; --ak2: #2EAA60; --ak2-deko: #2EAA60; --fokus: var(--ak2);
}
/* über offenen Pop-ups (50), unter Meldungen (60) und Bestätigungen (70) */
.anm:not(.hidden) { display: grid; z-index: 55; }
/* Seite und Rand hinter der Anmeldung ebenfalls dunkel (kein heller Rand beim Überscrollen) */
html:has(> body > .anm:not(.hidden)), html:has(> body > .anm:not(.hidden)) > body { background: #08090B; color-scheme: dark; }

/* ---------- Karte (Hintergrund) ---------- */
.anm-flaeche { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent calc(var(--anm-l, 37%) - 17%), rgba(0, 0, 0, .55) calc(var(--anm-l, 37%) - 1%), #000 calc(var(--anm-l, 37%) + 15%));
  mask-image: linear-gradient(90deg, transparent calc(var(--anm-l, 37%) - 17%), rgba(0, 0, 0, .55) calc(var(--anm-l, 37%) - 1%), #000 calc(var(--anm-l, 37%) + 15%)); }
.anm-flaeche > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: hidden; }
.anm-basis { will-change: transform; }
.anm svg text { font-family: var(--mono); }
.anm-st-land-a { stop-color: var(--anm-land-a); } .anm-st-land-b { stop-color: var(--anm-land-b); }
.anm-st-ak { stop-color: var(--ak); }
.anm-glut { fill: none; stroke: var(--anm-glut); stroke-width: 12px; stroke-linejoin: round; }
.anm-glut2 { fill: none; stroke: var(--anm-glut2); stroke-width: 6px; stroke-linejoin: round; }
.anm-kontur { fill: none; stroke: var(--anm-kontur); stroke-width: 1.15px; stroke-linejoin: round; }
.anm-seen path { fill: var(--anm-see); stroke: var(--anm-see-rand); stroke-width: .8px; stroke-linejoin: round; }
.anm-bahn path { fill: none; stroke: var(--anm-bahn); stroke-width: 1px; stroke-linejoin: round; stroke-linecap: round; }
.anm-nachbarn text { font-size: 10px; letter-spacing: .32em; fill: var(--anm-nachbar); }

.anm-bogen { fill: none; stroke: rgba(var(--silber-rgb), .2); stroke-width: 1px; stroke-dasharray: 2px 5px; }
.anm-bogen.m { stroke: rgba(var(--silber-rgb), .36); stroke-dasharray: none; }
.anm-zbogen { animation: anm-fluss 14s linear infinite; }
@keyframes anm-fluss { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -56px; } }
.anm-paket circle { fill: var(--anm-paket); }
.anm-paket.z circle { fill: #fff; filter: drop-shadow(0 0 3px rgba(var(--ak-rgb), 1)); }
.anm[data-marke="med"] .anm-paket.z circle { filter: drop-shadow(0 0 3px rgba(46, 170, 96, 1)); }
.anm-mensch { fill: var(--silber); }
.anm-f-kern { fill: var(--ak); }
.anm-f-mitte { fill: #fff; }
.anm-f-ring { fill: none; stroke: var(--ak); stroke-width: 1.3px; transform-box: fill-box; transform-origin: center;
  animation: anm-ring 3.4s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: var(--d, 0s); }
@keyframes anm-ring { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(4.2); opacity: 0; } }
.anm-f-lab { font-size: 10.5px; letter-spacing: .08em; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--anm-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.anm-z-kern { fill: var(--text); stroke: var(--app); stroke-width: 1.5px; }
.anm-z-mitte { fill: var(--ak); }
.anm[data-marke="med"] .anm-z-mitte { fill: var(--ak2); }
.anm-z-lab { font-size: 9.5px; letter-spacing: .1em; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--anm-halo); stroke-width: 3px; stroke-linejoin: round; }
.anm-z-unter { font-weight: 400; fill: var(--muted); }
/* Fenster versteckt: Bewegung anhalten */
.anm-pause *, .anm-pause *::before, .anm-pause *::after { animation-play-state: paused !important; }

/* ---------- Licht, Produkt, Claim, Fusszeile ---------- */
.anm-licht { position: absolute; z-index: -1; width: 640px; height: 640px; left: -6%; top: 50%; transform: translateY(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--ak-rgb), .12), transparent 64%); }
.anm-oben { position: absolute; top: 22px; left: 32px; z-index: 2; display: flex; align-items: center; gap: 18px; pointer-events: none; }
.anm-produkt { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--text); }
.anm-zeichen { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-3); background: var(--glas); flex: none; }
.anm-zeichen::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ak); box-shadow: 0 0 0 3px rgba(var(--ak-rgb), .18), 0 0 12px rgba(var(--ak-rgb), .8); }
.anm-claim { position: absolute; left: 41%; bottom: 8%; max-width: 30%; z-index: 1; pointer-events: none; }
.anm-claim[hidden] { display: none; }
.anm-claim h2 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; color: var(--text); text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.anm-claim h2 span { color: var(--muted); font-weight: 400; }
.anm-unten { position: absolute; left: 32px; right: 32px; bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  font-size: 12px; color: var(--muted-2); }
.anm-unten .lg-lizenz { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted-2); }

/* ---------- Glas-Karte mit Formular ---------- */
.anm-karte { position: relative; z-index: 1; width: min(412px, calc(100vw - 32px)); margin: 0 0 0 clamp(16px, 4.4vw, 72px); padding: 30px 30px 22px; border-radius: 24px;
  border: 1px solid var(--line-strong); color: var(--text);
  background: linear-gradient(180deg, rgba(22, 25, 31, .84), rgba(12, 14, 18, .9));
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
.anm-karte::before { content: ""; position: absolute; top: -1px; left: 32px; width: 64px; height: 2px; border-radius: 2px; background: var(--ak); box-shadow: 0 0 14px rgba(var(--ak-rgb), .9); }
.anm[data-marke="med"] .anm-karte::before { width: 96px; background: linear-gradient(90deg, var(--ak), var(--ak2)); }
.anm-karte.anm-breit { width: min(780px, calc(100vw - 32px)); }
.anm-logo { display: inline-flex; align-items: center; height: 50px; padding: 0 16px; border-radius: 12px; background: #fff; border: 1px solid rgba(255, 255, 255, .1); }
.anm-logo img { display: block; height: 26px; width: auto; }
.anm[data-marke="med"] .anm-logo img { height: 34px; }
.anm-titel, .anm-karte h1, .anm-karte h2 { margin: 24px 0 0; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.anm-unter { margin: 8px 0 4px; color: var(--muted); font-size: 14px; }
.anm-karte p { margin: 0; }
.anm-karte .muted { color: var(--muted); }
.anm-karte a { color: var(--ink); font-weight: 700; text-decoration: none; }
.anm-karte a:hover { text-decoration: underline; }
.anm-feld { display: block; margin-top: 16px; }
.anm-lbl { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.anm-eingabe { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; border-radius: 12px; background: var(--feld); border: 1px solid var(--line-strong); }
.anm-eingabe:focus-within { border-color: var(--ak-ln); box-shadow: 0 0 0 4px rgba(var(--ak-rgb), .12); }
.anm-eingabe > svg.i { width: 18px; height: 18px; color: var(--muted-2); }
.anm-eingabe:focus-within > svg.i { color: var(--ink); }
.anm .anm-eingabe > input, .anm .anm-eingabe > input:focus { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 8px 0 0; border: 0; border-radius: 0; outline: none; box-shadow: none;
  background: none; font: inherit; font-size: 14.5px; font-weight: 400; color: var(--text); }
.anm input:-webkit-autofill, .anm input:-webkit-autofill:hover, .anm input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 60px var(--feld) inset; box-shadow: 0 0 0 60px var(--feld) inset; transition: background-color 9999s; }
/* Passwort anzeigen: echtes Kontrollkästchen als Augen-Knopf (Tastatur mit Leertaste) */
.anm-auge { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted-2); }
.anm-auge:hover { color: var(--text); background: var(--hover); }
.anm .anm-auge > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.anm-auge:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 1px; color: var(--text); }
.anm-auge svg.i { width: 18px; height: 18px; pointer-events: none; }
.anm-auge .zu, .anm-auge:has(input:checked) .auf { display: none; }
.anm-auge:has(input:checked) .zu { display: block; }
.anm-auge:has(input:checked) { color: var(--ink); }
.anm-los { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 50px; margin-top: 20px; padding: 0 18px;
  border: 0; border-radius: 13px; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, var(--ak-btn), var(--ak-btn-2)); box-shadow: 0 14px 30px -14px rgba(var(--ak-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .2); }
.anm-los:hover { background: var(--ak-btn-h); }
.anm-los:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.anm-los:disabled { cursor: progress; opacity: .8; }
.anm-los-rechts { display: inline-flex; align-items: center; gap: 10px; }
.anm-los-rechts::before { content: "Enter"; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .4); font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; }
.anm-los svg.i { width: 18px; height: 18px; color: #fff; }
.anm-fehler { margin: 10px 0 0; min-height: 1em; font-size: 13px; color: var(--gefahr-tx); }
.anm-fehler:empty { margin-top: 4px; }
.anm-fuss { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted-2); }
.anm-fuss svg.i { width: 15px; height: 15px; color: var(--muted); flex: none; }

/* ---------- Formulare anderer Seiten in der Karte (z.B. Vermittler-Registrierung, Formular #inv-reg) ----------
   Bausteine: label > input|select|textarea, fieldset > legend (Abschnitt), .anm-raster (2 Spalten, .anm-voll über beide),
   .anm-hinweis (kleiner Satz), .btn.primary (Hauptknopf), .error (Fehlerzeile) */
.anm-karte form:not(#login-form) > p.muted, .anm-karte .anm-hinweis { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.anm-karte fieldset { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.anm-karte legend { padding: 0; margin: 0 0 2px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.anm[data-marke="med"] .anm-karte legend { color: var(--ink); }
.anm-karte label:not(.anm-feld):not(.anm-auge) { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.anm .anm-karte :not(.anm-eingabe):not(.anm-auge) > input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.anm .anm-karte select, .anm .anm-karte textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--feld); border: 1px solid var(--line-strong); color: var(--text);
  font: inherit; font-size: 14.5px; font-weight: 400; box-shadow: none; outline: none; }
.anm .anm-karte textarea { height: auto; min-height: 88px; padding: 10px 14px; }
.anm .anm-karte :not(.anm-eingabe):not(.anm-auge) > input:not([type="checkbox"]):not([type="radio"]):focus,
.anm .anm-karte select:focus, .anm .anm-karte textarea:focus { background: var(--feld); border-color: var(--ak-ln); box-shadow: 0 0 0 4px rgba(var(--ak-rgb), .12); }
.anm .anm-karte select option, .anm .anm-karte select optgroup { background: #111317; color: #EDEFF3; }
.anm .anm-karte input[type="checkbox"] { accent-color: var(--ak-btn); }
.anm .anm-karte .btn { min-height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--knopf); color: var(--text); }
.anm .anm-karte .btn.primary { width: 100%; min-height: 50px; margin-top: 20px; border: 0; border-radius: 13px; font-size: 15px; color: #fff;
  background: linear-gradient(180deg, var(--ak-btn), var(--ak-btn-2)); box-shadow: 0 14px 30px -14px rgba(var(--ak-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .2); }
.anm .anm-karte .btn.primary:hover { background: var(--ak-btn-h); }
.anm .anm-karte .error { margin-top: 10px; min-height: 1em; font-size: 13px; color: var(--gefahr-tx); }
.anm-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.anm-raster > .anm-voll { grid-column: 1 / -1; }
/* Einfache Hinweiskarte direkt in der Bühne (z.B. Einladung ungültig) */
.anm > .login-card { z-index: 1; justify-self: center; width: min(420px, calc(100vw - 32px)); padding: 26px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--glas-voll); }

/* ---------- Breiten ---------- */
@media (max-width: 1180px) {
  .anm-claim { display: none; }
}
/* Gestapelt (Tablet hoch, Handy): Karte oben mit der ganzen Schweiz, Formular darunter überlappend */
@media (max-width: 900px) {
  .anm:not(.hidden) { display: flex; flex-direction: column; align-items: stretch; }
  .anm { padding: 0 0 20px; }
  .anm-flaeche { position: relative; inset: auto; order: 1; height: clamp(280px, 52vw, 400px); flex: none; z-index: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
  .anm-licht { display: none; }
  .anm-oben { top: 14px; left: 16px; }
  .anm-karte, .anm-karte.anm-breit { order: 2; width: auto; max-width: 560px; margin: -40px 12px 0; padding: 22px 18px 18px; border-radius: 20px; }
  .anm-karte.anm-breit { max-width: 720px; }
  .anm-titel, .anm-karte h1, .anm-karte h2 { margin-top: 20px; font-size: 24px; }
  .anm-unten { position: static; order: 3; margin: 16px 16px 0; flex-direction: column; align-items: flex-start; gap: 4px; }
  .anm-raster { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 589px) and (max-width: 900px) {
  .anm-karte, .anm-karte.anm-breit { align-self: center; width: calc(100% - 24px); margin-left: auto; margin-right: auto; }
}
@media (max-width: 420px) {
  .anm-los-rechts::before { display: none; }
}
/* Weniger Bewegung: alles still */
@media (prefers-reduced-motion: reduce) {
  .anm *, .anm *::before, .anm *::after { animation: none !important; transition: none !important; }
}
