/* assets/auth/anmeldung.css — Anmeldeseiten der Plattform (qk5.me)
 *
 * Spec docs/superpowers/specs/2026-11-27-anmeldung-redesign-design.md, Entwurf docs/design/login-2026-11/.
 * Gerahmt von groups/includes/AuthBuehne.php; Farben aus assets/css/plattform/tokens.css, der Akzent je Mandant
 * kommt als --accent (nur #rgb/#rrggbb) samt Ableitungen aus AuthBuehne::kopf().
 *
 * Formsprache: Schrift 400/500, Formregel PF (Tafeln und Kacheln 2 px, Bedienelemente rund, Radien nur ueber --r-tafel/--r-bedien aus tokens.css). Als @keyframes nur der Hintergrund (lg-schein, lb-zug,
 * lb-heben — Ausnahme nur fuer die Anmeldung) und die Rueckmeldungen im Formular (Ladepunkte, Shake, Haken).
 * Waechter: tests/plattform/AnmeldungTest.php. Die Tunnelseiten haben ihr eigenes Blatt (auth.css).
 */

@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400 500; font-display: swap; src: url('/enabler/fonts/PlusJakartaSans-VariableFont_wght.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/enabler/fonts/inter-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/enabler/fonts/inter-v20-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('/enabler/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2'); }

:root { color-scheme: light; --lg-ease: cubic-bezier(0.16, 1, 0.3, 1); }
:root[data-theme="dark"] { color-scheme: dark; }

.h2a {
    --lg-grund: #F6F4F9;
    --lb1: color-mix(in srgb, var(--accent) 62%, #fff);
    --lb2: #D39BE3;
    --lb3: #9C97F0;
    --lb4: #C7B2F2;
    --lb-kante: var(--accent);
    --lg-panel: rgba(255, 255, 255, .72);
    --lg-panel-rand: rgba(24, 24, 27, .08);
    --lg-leise: var(--ink-3);
    --lg-link: var(--lg-akzent-text, var(--accent));
    --lg-auf-marke: var(--lg-auf-akzent, #fff);
}
:root[data-theme="dark"] .h2a {
    --lg-grund: #0B0A10;
    --lb1: var(--brand);
    --lb2: #B44FD0;
    --lb3: #5B4BE0;
    --lb4: #9D7BEA;
    --lb-kante: #fff;
    --lg-panel: rgba(23, 23, 27, .62);
    --lg-panel-rand: rgba(255, 255, 255, .09);
    --lg-leise: rgba(237, 237, 241, .55);
    --lg-link: var(--brand-text);
    --lg-auf-marke: #fff;
}

*, *::before, *::after { box-sizing: border-box; }

body.h2a {
    margin: 0;
    background: var(--lg-grund);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}
.h2a ::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); color: var(--ink); }
.h2a b, .h2a strong { font-weight: 500; }
/* [hidden] muss gegen display:flex/grid der Bausteine gewinnen. */
.h2a [hidden] { display: none !important; }

/* ── Seite ──────────────────────────────────────────────────────────── */

.lg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 96px 20px 72px;
    /* Der Grund muss IN der isolierten Flaeche liegen, sonst hellt die Koernung ihn auf. */
    background: var(--lg-grund);
}

/* ── Hintergrund: Schein, Lichtbaender, Koernung ────────────────────── */

.lg-schein {
    position: absolute;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(70% 60% at 30% 70%, color-mix(in srgb, var(--lb1) 18%, transparent), transparent 70%),
        radial-gradient(50% 50% at 75% 85%, color-mix(in srgb, var(--lb3) 20%, transparent), transparent 70%);
    animation: lg-schein 24s ease-in-out infinite alternate;
}
@keyframes lg-schein { to { transform: translate(3%, -2%) scale(1.05); } }

.lb-baender {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    container-type: size;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 12%, #000 45%);
    mask-image: linear-gradient(to bottom, transparent 12%, #000 45%);
}
/* Zeichenflaeche 1600×900, die den Grund immer deckt (wie „slice"): mittig, unten buendig. */
.lb-flaeche {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    width: max(100cqw, 177.7778cqh);
    aspect-ratio: 16 / 9;
    transform: translateX(-50%);
}
/* Ein Band ist zwei Zeichenflaechen breit (nahtlose Schleife) und beginnt bei y = 220 von 900.
   Dauern je Band stehen am Element (baender.html): Zug 80–140 s, Heben 27–47 s. */
.lb-band {
    position: absolute;
    top: 24.4444%;
    left: 0;
    width: 200%;
    height: 77.7778%;
    animation-name: lb-zug, lb-heben;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-direction: normal, alternate;
}
@keyframes lb-zug { to { transform: translateX(-50%); } }
@keyframes lb-heben { from { translate: 0 -6px; } to { translate: 0 6px; } }
.lb-band svg { display: block; width: 100%; height: 100%; }

.lg-korn {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .1;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* ── Marke und Bereich ──────────────────────────────────────────────── */

.lg-marke {
    position: absolute;
    left: clamp(24px, 4vw, 56px);
    top: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 40px);
    color: var(--ink);
    text-decoration: none;
    font: 500 15px/1.3 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.h2a-mono {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    border-radius: var(--r-bedien);
    background: var(--brand);
    color: var(--lg-auf-marke);
    font-size: 13px;
    font-weight: 500;
}
.h2a-mono svg { width: 16px; height: 16px; }
.h2a-wort { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2a-wort span { color: var(--lg-leise); }
.h2a-logo { display: block; height: 28px; width: auto; max-width: 200px; object-fit: contain; }

.lg-bereich {
    position: absolute;
    left: clamp(24px, 4vw, 56px);
    right: 20px;
    bottom: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--lg-leise);
    pointer-events: none;
}

/* ── Spalte und Panel ───────────────────────────────────────────────── */

.lg-spalte {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 420px;
    transition: transform .7s var(--lg-ease), opacity .7s var(--lg-ease);
}
body.h2a.is-leaving .lg-spalte { opacity: 0; transform: scale(.98); }

.lg-panel {
    position: relative;
    padding: 40px;
    border: 1px solid var(--lg-panel-rand);
    border-radius: var(--r-tafel);
    background: var(--lg-panel);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 40px 80px -40px rgba(10, 5, 20, .55);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .lg-panel { background: color-mix(in srgb, var(--surf) 94%, transparent); }
}

.h2a-card h1 {
    margin: 0 0 22px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}
.h2a-card p.lead-sm { margin: -14px 0 22px; color: var(--ink-2); }
.h2a-card p.lead-sm strong { color: var(--ink); }

/* ── Felder ─────────────────────────────────────────────────────────── */

.h2a-feld { margin-bottom: 18px; }
.h2a-feld label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }

.h2a-eingabe { position: relative; }
.h2a-eingabe input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font: inherit;
    color: var(--ink);
    background: color-mix(in srgb, var(--surf) 80%, transparent);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-feld);
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .2s var(--lg-ease);
}
.h2a-eingabe input::placeholder { color: var(--ink-3); }
.h2a-eingabe input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.h2a-eingabe input:-webkit-autofill,
.h2a-eingabe input:-webkit-autofill:hover,
.h2a-eingabe input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px var(--surf) inset;
    caret-color: var(--ink);
    transition: background-color 9999s;
}
/* Auf dem Telefon vergroessert iOS Felder unter 16 px beim Antippen. */
@media (pointer: coarse) { .h2a-eingabe input { font-size: 16px; } }

.h2a-eingabe.mit-auge input { padding-right: 42px; }
.h2a-auge {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--r-bedien);
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 16px;
}
.h2a-auge:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.h2a-auge:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 0; }
.h2a-auge[aria-pressed="true"] { color: var(--lg-link); }

.h2a-card.hat-fehler .h2a-eingabe input:not(:focus) { border-color: var(--red); }

.h2a-caps {
    display: flex;
    align-items: center;
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 12px;
    color: var(--ink-2);
    transition: opacity .2s, max-height .25s var(--lg-ease), margin .25s var(--lg-ease);
}
.h2a-caps.is-on { opacity: 1; max-height: 1.6rem; margin: -10px 0 14px; }

/* ── Knopf und Links ────────────────────────────────────────────────── */

.h2a-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    margin-top: 4px;
    padding: 0 16px;
    border: 1px solid var(--brand);
    border-radius: var(--r-bedien);
    background: var(--brand);
    color: var(--lg-auf-marke);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s;
}
.h2a-btn:hover { filter: brightness(1.08); }
.h2a-btn:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }

/* Laden: Text weicht drei Punkten, der Knopf behaelt seine Groesse. */
.h2a-btn .h2a-punkte { display: none; gap: 4px; }
.h2a-btn .h2a-punkte i { width: 5px; height: 5px; border-radius: var(--r-bedien); background: currentColor; animation: h2a-punkt 1s ease-in-out infinite; }
.h2a-btn .h2a-punkte i:nth-child(2) { animation-delay: .15s; }
.h2a-btn .h2a-punkte i:nth-child(3) { animation-delay: .3s; }
.h2a-btn.is-loading { cursor: progress; pointer-events: none; }
.h2a-btn.is-loading > :not(.h2a-punkte) { display: none; }
.h2a-btn.is-loading .h2a-punkte { display: inline-flex; }
@keyframes h2a-punkt { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.h2a-links { margin-top: 18px; text-align: center; font-size: 13px; }
.h2a-links a, .h2a-textknopf { color: var(--lg-link); text-decoration: none; }
.h2a-textknopf { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.h2a-links a:hover, .h2a-textknopf:hover { text-decoration: underline; }
.h2a-links a:focus-visible, .h2a-textknopf:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; border-radius: var(--r-bedien); }

/* ── Meldungen ──────────────────────────────────────────────────────── */

.h2a-card .alert {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-tafel);
    background: color-mix(in srgb, var(--surf) 80%, transparent);
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.45;
}
.h2a-card .alert:empty { display: none; }
.h2a-card .alert::before { flex: 0 0 auto; font-family: 'bootstrap-icons'; line-height: 1.45; }
.h2a-card .alert-danger {
    border-color: color-mix(in srgb, var(--red) 45%, transparent);
    background: color-mix(in srgb, var(--red) 9%, var(--surf));
    color: var(--ink);
}
.h2a-card .alert-danger::before { content: '\F332'; color: var(--red-text); }
.h2a-card .alert-success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.h2a-card .alert-success::before { content: '\F26A'; color: var(--ok-text); }
.h2a-card .alert-info { border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.h2a-card .alert-info::before { content: '\F430'; color: var(--lg-link); }
.h2a-card .alert-warning { border-color: color-mix(in srgb, #C98A12 55%, transparent); }
.h2a-card .alert-warning::before { content: '\F33A'; color: #C98A12; }

.h2a-card.is-shake { animation: h2a-shake .45s var(--lg-ease); }
@keyframes h2a-shake {
    15% { transform: translateX(-7px); }
    35% { transform: translateX(6px); }
    55% { transform: translateX(-3px); }
    75% { transform: translateX(2px); }
}

/* Erfolg: Kreis und Haken zeichnen sich. */
.h2a-success {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border-radius: inherit;
    background: color-mix(in srgb, var(--surf) 98%, transparent);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--lg-ease);
}
.h2a-success svg { width: 56px; height: 56px; }
.h2a-success circle { stroke: var(--brand); stroke-dasharray: 214; stroke-dashoffset: 214; }
.h2a-success path { stroke: var(--brand); stroke-dasharray: 48; stroke-dashoffset: 48; }
.h2a-success p { margin: 0; font-weight: 500; }
.h2a-card.is-success .h2a-success { opacity: 1; pointer-events: auto; }
.h2a-card.is-success .h2a-success circle { animation: h2a-draw .6s var(--lg-ease) forwards; }
.h2a-card.is-success .h2a-success path { animation: h2a-draw .35s .4s var(--lg-ease) forwards; }
@keyframes h2a-draw { to { stroke-dashoffset: 0; } }

/* ── Passwortstaerke ────────────────────────────────────────────────── */

.h2a-staerke { margin: -8px 0 18px; }
.h2a-staerke-balken { height: 3px; overflow: hidden; background: var(--line-strong); }
.h2a-staerke-balken i { display: block; width: 0; height: 100%; background: var(--ink-3); transition: width .3s var(--lg-ease), background .3s; }
.h2a-staerke-text { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.h2a-staerke[data-stufe="1"] i { background: var(--red); }
.h2a-staerke[data-stufe="2"] i { background: #C98A12; }
.h2a-staerke[data-stufe="3"] i,
.h2a-staerke[data-stufe="4"] i { background: var(--ok); }

/* ── Organisationswahl (mandantenloser Login, mehrere Konten) ───────── */

.h2a-mandanten { display: grid; gap: 8px; }
.h2a-mandant {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-tafel);
    background: color-mix(in srgb, var(--surf) 80%, transparent);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s;
}
.h2a-mandant:hover { border-color: var(--brand); }
.h2a-mandant:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.h2a-mandant:disabled { opacity: .55; cursor: progress; }
.h2a-mandant > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.h2a-mandant-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--r-bedien);
    background: var(--brand);
    color: var(--lg-auf-marke);
    font-weight: 500;
}
.h2a-mandant-logo img { width: 100%; height: 100%; padding: 4px; object-fit: contain; background: #fff; }
.h2a-mandant-name { display: block; font-weight: 500; line-height: 1.25; }
.h2a-mandant-ident { display: block; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.h2a-mandant .bi { margin-left: auto; color: var(--ink-3); }
.h2a-mandant:hover .bi { color: var(--lg-link); }

/* ── Unter dem Panel: Fusszeile und Themenschalter ──────────────────── */

.lg-unter { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 4px; font-size: 12px; color: var(--lg-leise); }
.lg-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.lg-links span, .lg-links a { white-space: nowrap; }
.lg-links a { color: inherit; text-decoration: none; }
.lg-links a:hover { color: var(--ink); text-decoration: underline; }
.lg-links a:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; border-radius: var(--r-bedien); }

/* Ohne JavaScript hat der Schalter keine Wirkung und bleibt unsichtbar. */
.lg-thema { display: flex; visibility: hidden; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-bedien); }
.h2a-bereit .lg-thema { visibility: visible; }
.lg-thema button { display: grid; place-items: center; width: 34px; height: 30px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.lg-thema button[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-fg); }
.lg-thema button:focus-visible { outline: 2px solid var(--brand-text); outline-offset: -3px; }
.lg-thema svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Schmal ─────────────────────────────────────────────────────────── */

@media (max-width: 959px) {
    .lb-baender { opacity: .7; }
}
@media (max-width: 389px) {
    .lg-panel { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .lb-band, .lg-schein { animation: none; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
