/* Biskoping Login — dunkle „Wartungs“-Familie (Karte + Radial), DM Sans */
:root {
    --bg: #0f172a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --brand: #0ea5e9;
    --brand-hover: #0284c7;
    --brand-dark: #004191;
    --accent-warm: #f97316;
    --brand-soft: rgba(14, 165, 233, 0.18);
    --brand-glow: rgba(14, 165, 233, 0.35);
    --ok: #4ade80;
    --err: #fb7185;
    --radius: 20px;
    --radius-sm: 12px;
    --font: "DM Sans", system-ui, "Segoe UI", Roboto, sans-serif;
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    --card-bg: rgba(30, 41, 59, 0.94);
    --card-border: rgba(255, 255, 255, 0.06);
}

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

html {
    color-scheme: dark;
}

.login-field--honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.login-captcha-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--muted);
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.22);
}

.login-captcha-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
    flex-shrink: 0;
}

.login-captcha-status strong {
    color: #86efac;
    font-weight: 600;
}

.login-recaptcha-v3-note {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text);
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.28);
}

.login-recaptcha-v3-note strong {
    font-weight: 600;
    color: #bae6fd;
}

.login-field--captcha {
    margin-top: 4px;
}
.login-captcha-hint {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
    position: relative;
    overflow-x: hidden;
}

/* Hintergrund: wie Wartung/404 — tiefer Slate + Akzentflecken */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 600px at 10% 0%, #1e3a5f 0%, var(--bg) 55%),
        radial-gradient(700px 400px at 92% 18%, rgba(249, 115, 22, 0.12), transparent 52%),
        radial-gradient(520px 360px at 50% 100%, rgba(14, 165, 233, 0.08), transparent 45%),
        linear-gradient(165deg, #0f172a 0%, #020617 100%);
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 28% 38%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 72% 62%, rgba(14, 165, 233, 0.07) 0%, transparent 38%);
    animation: login-shimmer 18s ease-in-out infinite alternate;
}

@keyframes login-shimmer {
    0% {
        opacity: 0.65;
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        opacity: 1;
        /* px statt % — vermeidet „ungültig“-transform in manchen Browsern bei ::after ohne klare %-Basis */
        transform: translate3d(12px, 8px, 0) scale(1.02);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-bg::after {
        animation: none;
        opacity: 0.85;
        transform: none;
    }
    .login-btn-primary,
    .login-btn-ghost,
    .login-field__reveal {
        transition: none !important;
    }
    .login-btn-primary::after {
        transition: none !important;
    }
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    position: relative;
}

.login-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-dark) 0%, var(--accent-warm) 42%, var(--brand) 100%);
    box-shadow: 0 0 28px rgba(249, 115, 22, 0.25);
}

.login-card__inner {
    padding: 28px 26px 26px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-brand__logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.2), rgba(30, 41, 59, 0.9));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

span.login-brand__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-warm);
}

.login-brand__text h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
}

.login-brand__text p {
    margin: 4px 0 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
}

.login-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.login-field__wrap {
    position: relative;
}

.login-field--password .login-field__wrap input {
    padding-right: 50px;
}

.login-field__reveal {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.login-field__reveal:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.login-field__reveal:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.login-field__reveal-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-field__reveal-icon[hidden] {
    display: none;
}

.login-field__wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    opacity: 0.75;
    pointer-events: none;
}

.login-field input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px 12px 44px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.75);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-field input::placeholder {
    color: #64748b;
}

.login-field input:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.88);
}

.login-field input:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.55);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
    background: rgba(15, 23, 42, 0.95);
}

.login-actions {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-btn-primary {
    position: relative;
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(165deg, #004191 0%, #0369a1 38%, #0ea5e9 100%);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
    overflow: hidden;
}

.login-btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.5s ease;
}

.login-btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-btn-primary:hover::after {
    transform: translateX(120%);
}

.login-btn-primary:active {
    transform: translateY(1px);
}

.login-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-glow), 0 4px 20px rgba(14, 165, 233, 0.25);
}

.login-actions-secondary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.login-btn-ghost {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, border-style 0.18s ease;
}

.login-btn-ghost:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(249, 115, 22, 0.45);
    border-style: solid;
}

.login-btn-ghost:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

.login-2fa-resend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.login-2fa-resend__btn {
    width: 100%;
    min-height: 40px;
    font-size: 0.82rem;
}

.login-2fa-resend__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-2fa-resend__hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--muted);
    text-align: center;
}

/* Hinweise & Meldungen */
.login-alert {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-alert__main {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.login-alert__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.login-alert__detail-btn {
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.8rem;
    border-style: solid;
}

.login-alert__pre {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.login-alert--hidden {
    display: none;
}

.login-alert--captcha-missing {
    margin-bottom: 18px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-inline-code {
    word-break: break-all;
}

.login-alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.login-alert__body {
    flex: 1;
    min-width: 0;
}

.login-alert--error {
    color: #fecdd3;
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(251, 113, 133, 0.35);
    border-left: 4px solid var(--err);
    box-shadow: none;
}

.login-alert--error .login-alert__icon {
    color: var(--err);
}

.login-alert--success {
    color: #bbf7d0;
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(74, 222, 128, 0.35);
    border-left: 4px solid var(--ok);
    box-shadow: none;
}

.login-alert--success .login-alert__icon {
    color: var(--ok);
}

.login-alert--info {
    color: #bae6fd;
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(56, 189, 248, 0.35);
    border-left: 4px solid var(--brand);
    box-shadow: none;
}

.login-alert--info .login-alert__icon {
    color: var(--brand);
}

.login-foot {
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* System-Dialoge (analog Admin) */
.row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn:hover {
    background: var(--brand-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-glow), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    box-shadow: none;
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border-color: rgba(249, 115, 22, 0.45);
    border-style: solid;
}

.btn.ghost:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

dialog.modal-dlg {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    width: min(520px, 94vw);
    padding: 22px;
    box-shadow: var(--shadow-card);
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
}

.ui-system-dlg {
    max-width: 440px;
    width: min(440px, 94vw);
}

.ui-system-dlg__msg {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

.ui-system-dlg__row {
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ui-system-dlg__input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font: inherit;
    margin-bottom: 10px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
}

.ui-system-dlg__input:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.ui-system-dlg--prompt .ui-system-dlg__msg {
    margin-bottom: 8px;
}

@media (max-width: 380px) {
    .login-card__inner {
        padding: 22px 18px 20px;
    }

    .login-brand__text h1 {
        font-size: 1.28rem;
    }
}
