/* ========================================================================== 
   FlexiPortal Login
   Theme-gebundener White-Label Login
   ========================================================================== */

:root {
    --auth-bg: #f3f7fb;
    --auth-surface: #ffffff;
    --auth-surface-soft: #f7f9fc;
    --auth-text: #152033;
    --auth-text-soft: #475569;
    --auth-text-muted: #8491a3;
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-primary-contrast: #ffffff;
    --auth-primary-soft: rgba(37,99,235,.10);
    --auth-primary-border: rgba(37,99,235,.24);
    --auth-primary-focus: rgba(37,99,235,.16);
    --auth-border: #dce4ee;
    --auth-danger: #d92d4c;
    --auth-danger-bg: #fff1f3;
    --auth-danger-border: #fecdd6;
    --auth-radius-xl: 16px;
    --auth-radius-lg: 12px;
    --auth-radius-md: 9px;
    --auth-shadow: 0 22px 60px rgba(15,23,42,.11), 0 6px 20px rgba(15,23,42,.06);
    --auth-control-shadow: 0 2px 7px rgba(15,23,42,.05);
    --auth-button-shadow: 0 10px 24px rgba(15,23,42,.10);
    --auth-visual-panel: #1d4ed8;
    --auth-visual-overlay: rgba(3,7,18,.38);
    --auth-visual-position: center center;
    --auth-visual-image: none;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--auth-bg);
}

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 8% 8%, var(--auth-primary-soft), transparent 30%),
        radial-gradient(circle at 92% 90%, var(--auth-primary-soft), transparent 32%),
        linear-gradient(135deg, var(--auth-surface-soft), var(--auth-bg));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-page-wrap {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-shell {
    width: min(1140px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(430px, 1.05fr);
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-xl);
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

/* Branding / Visual */
.auth-visual {
    position: relative;
    isolation: isolate;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 32px 36px 36px;
    color: #fff;
    background: linear-gradient(145deg, var(--auth-primary), var(--auth-primary-dark));
}

.auth-visual::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 430px;
    height: 430px;
    top: -210px;
    right: -180px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    box-shadow: 0 0 0 52px rgba(255,255,255,.035), 0 0 0 104px rgba(255,255,255,.018);
    pointer-events: none;
}

.auth-visual-mode--solid .auth-visual {
    background: var(--auth-visual-panel);
}

.auth-visual-mode--gradient .auth-visual {
    background:
        radial-gradient(circle at 12% 10%, rgba(255,255,255,.13), transparent 30%),
        linear-gradient(145deg, var(--auth-visual-panel), var(--auth-primary-dark));
}

.auth-visual-mode--image .auth-visual {
    background:
        linear-gradient(var(--auth-visual-overlay), var(--auth-visual-overlay)),
        var(--auth-visual-image),
        linear-gradient(145deg, var(--auth-visual-panel), var(--auth-primary-dark));
    background-size: cover, cover, cover;
    background-position: center, var(--auth-visual-position), center;
    background-repeat: no-repeat;
}

.auth-visual-mode--soft .auth-visual {
    color: var(--auth-text);
    background:
        radial-gradient(circle at 18% 18%, var(--auth-primary-soft), transparent 34%),
        radial-gradient(circle at 85% 80%, var(--auth-primary-soft), transparent 36%),
        var(--auth-surface-soft);
    border-right: 1px solid var(--auth-border);
}

.auth-visual-mode--soft .auth-visual::before {
    border-color: var(--auth-primary-border);
    box-shadow: 0 0 0 52px rgba(0,0,0,.012), 0 0 0 104px rgba(0,0,0,.008);
}

.auth-visual-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--auth-radius-md);
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.08);
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-visual-mode--soft .auth-visual-badge {
    color: var(--auth-text-soft);
    border-color: var(--auth-border);
    background: rgba(255,255,255,.72);
}

.auth-customer-brand {
    position: relative;
    z-index: 2;
    width: min(100%, 440px);
    margin: auto 0;
    padding: 44px 0;
}

.auth-logo-panel {
    width: min(350px, 88%);
    min-height: 142px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 28px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: var(--auth-radius-lg);
    background: rgba(255,255,255,.96);
    box-shadow: var(--auth-control-shadow);
}

.auth-logo-style--plain .auth-logo-panel {
    width: min(390px, 92%);
    min-height: 0;
    justify-content: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.auth-logo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 92px;
    object-fit: contain;
}

.auth-logo-style--plain:not(.auth-visual-mode--soft) .auth-logo {
    filter: drop-shadow(0 5px 18px rgba(0,0,0,.16));
}

.auth-logo-fallback {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: var(--auth-radius-lg);
    color: #fff;
    background: rgba(255,255,255,.10);
    font-size: 34px;
}

.auth-visual-mode--soft .auth-logo-fallback {
    color: var(--auth-primary);
    border-color: var(--auth-primary-border);
    background: var(--auth-primary-soft);
}

.auth-customer-kicker {
    margin-top: 26px;
    color: rgba(255,255,255,.72);
    font-size: 11px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-visual-mode--soft .auth-customer-kicker {
    color: var(--auth-text-muted);
}

.auth-visual-foot {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.64);
    font-size: 11px;
}

.auth-visual-mode--soft .auth-visual-foot { color: var(--auth-text-muted); }

/* Sprache */
.auth-visual .portal-lang-switcher .dropdown-toggle {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: var(--auth-radius-md);
    color: #fff;
    background: rgba(255,255,255,.09);
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
}

.auth-visual-mode--soft .auth-visual .portal-lang-switcher .dropdown-toggle {
    color: var(--auth-text-soft);
    border-color: var(--auth-border);
    background: rgba(255,255,255,.78);
}

.auth-visual .portal-lang-switcher .dropdown-toggle:hover,
.auth-visual .portal-lang-switcher .dropdown-toggle:focus {
    border-color: rgba(255,255,255,.50);
    background: rgba(255,255,255,.16);
}

.auth-visual-mode--soft .auth-visual .portal-lang-switcher .dropdown-toggle:hover,
.auth-visual-mode--soft .auth-visual .portal-lang-switcher .dropdown-toggle:focus {
    color: var(--auth-primary);
    border-color: var(--auth-primary-border);
    background: var(--auth-primary-soft);
}

.portal-lang-switcher .dropdown-menu {
    min-width: 180px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

.portal-lang-switcher .dropdown-item {
    padding: 9px 10px;
    border-radius: var(--auth-radius-md);
    color: var(--auth-text-soft);
    font-size: 13px;
}

.portal-lang-switcher .dropdown-item:hover,
.portal-lang-switcher .dropdown-item:focus,
.portal-lang-switcher .dropdown-item.active {
    color: var(--auth-primary-dark);
    background: var(--auth-primary-soft);
}

/* Formularseite */
.auth-form {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background:
        radial-gradient(circle at 100% 0, var(--auth-primary-soft), transparent 29%),
        var(--auth-surface);
}

.auth-form-inner { width: min(100%, 430px); }
.auth-mobile-top { display: none; }

.auth-head { margin-bottom: 27px; }
.auth-title-row { display: flex; align-items: flex-start; gap: 15px; }

.auth-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--auth-primary-border);
    border-radius: var(--auth-radius-lg);
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    font-size: 19px;
}

.auth-kicker {
    margin-bottom: 6px;
    color: var(--auth-primary);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.auth-h1 {
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(31px, 3vw, 40px);
    line-height: 1.08;
    font-weight: 780;
    letter-spacing: -.04em;
}

.auth-sub {
    max-width: 400px;
    margin-top: 15px;
    color: var(--auth-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.auth-secure {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    color: var(--auth-text-muted);
    font-size: 11px;
}
.auth-secure i { color: var(--auth-primary); }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid var(--auth-danger-border);
    border-radius: var(--auth-radius-md);
    color: var(--auth-danger);
    background: var(--auth-danger-bg);
    font-size: 13px;
    line-height: 1.5;
}
.auth-alert i { margin-top: 1px; }

.auth-card { margin: 0; padding: 0; border: 0; background: transparent; }
.auth-form-stack { display: grid; gap: 18px; }
.auth-field { min-width: 0; }

.auth-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--auth-text-soft);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
}

.auth-input-wrap { position: relative; }

.auth-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color .2s ease, transform .2s ease;
}

.auth-input {
    width: 100%;
    min-height: 52px;
    padding: 13px 15px 13px 44px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    color: var(--auth-text);
    background: var(--auth-surface);
    box-shadow: var(--auth-control-shadow);
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-input::placeholder { color: var(--auth-text-muted); opacity: .72; }
.auth-input:hover { border-color: var(--auth-primary-border); }
.auth-input:focus {
    color: var(--auth-text);
    border-color: var(--auth-primary);
    outline: 0;
    background: var(--auth-surface);
    box-shadow: 0 0 0 4px var(--auth-primary-focus);
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--auth-primary); }

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-text);
    caret-color: var(--auth-text);
    border-color: var(--auth-primary-border);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-surface) inset, 0 0 0 4px var(--auth-primary-focus);
}

.auth-input-password { padding-right: 52px; }
.pw-wrap { position: relative; }

.pw-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 9px;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--auth-radius-md);
    color: var(--auth-text-muted);
    background: transparent;
}
.pw-toggle:hover,
.pw-toggle:focus-visible { color: var(--auth-primary); outline: 0; background: var(--auth-primary-soft); }
.pw-toggle:focus-visible { box-shadow: 0 0 0 3px var(--auth-primary-focus); }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--auth-text-soft);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.auth-check .form-check-input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 0;
    border: 1px solid var(--auth-border);
    border-radius: max(3px, calc(var(--auth-radius-md) * .45));
    background-color: var(--auth-surface);
    box-shadow: none;
    cursor: pointer;
}
.auth-check .form-check-input:checked { border-color: var(--auth-primary); background-color: var(--auth-primary); }
.auth-check .form-check-input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 4px var(--auth-primary-focus); }

.auth-link { color: var(--auth-primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.auth-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }

.auth-btn {
    min-height: 52px;
    margin-top: 2px;
    padding: 13px 18px;
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius-md);
    color: var(--auth-primary-contrast);
    background: var(--auth-primary);
    box-shadow: var(--auth-button-shadow);
    font-size: 14px;
    font-weight: 750;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}
.auth-btn:hover {
    color: var(--auth-primary-contrast);
    border-color: var(--auth-primary-dark);
    background: var(--auth-primary-dark);
    transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:focus-visible { color: var(--auth-primary-contrast); outline: 0; box-shadow: 0 0 0 4px var(--auth-primary-focus); }
.auth-btn-content { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }

.auth-help {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--auth-text-muted);
    font-size: 11px;
    line-height: 1.55;
}
.auth-help i { margin-top: 2px; color: var(--auth-primary); }

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 29px;
    padding-top: 19px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-text-muted);
    font-size: 11px;
}
.auth-footer-copy { flex: 0 0 auto; white-space: nowrap; }

/* Mobile */
.auth-mobile-top .portal-lang-switcher .dropdown-toggle {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    color: var(--auth-text-soft);
    background: var(--auth-surface);
    font-size: 12px;
    font-weight: 700;
}
.auth-mobile-top .portal-lang-switcher .dropdown-toggle:hover,
.auth-mobile-top .portal-lang-switcher .dropdown-toggle:focus {
    color: var(--auth-primary);
    border-color: var(--auth-primary-border);
    background: var(--auth-primary-soft);
}

.auth-mobile-brand { min-height: 48px; display: flex; align-items: center; }
.auth-mobile-logo-wrap {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: var(--auth-surface);
}
.auth-mobile-logo { display: block; width: auto; max-width: 100%; max-height: 34px; object-fit: contain; }
.auth-mobile-brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--auth-radius-md);
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    font-size: 18px;
}

@media (max-width: 1060px) {
    .auth-page-wrap { padding: 22px; }
    .auth-shell { grid-template-columns: minmax(0, .9fr) minmax(400px, 1.1fr); min-height: 620px; }
    .auth-visual { padding: 28px 30px 34px; }
    .auth-form { padding: 40px 34px; }
}

@media (max-width: 860px) {
    .auth-page-wrap { align-items: flex-start; padding: 0; }
    .auth-shell {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .auth-visual { display: none; }
    .auth-form { min-height: 100vh; min-height: 100dvh; padding: 28px 24px 36px; }
    .auth-form-inner { width: min(100%, 500px); }
    .auth-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: 52px;
        margin-bottom: 36px;
    }
}

@media (max-width: 520px) {
    .auth-form { padding: 22px 18px 30px; }
    .auth-mobile-top { margin-bottom: 30px; }
    .auth-title-row { gap: 12px; }
    .auth-icon { width: 44px; height: 44px; }
    .auth-h1 { font-size: 31px; }
    .auth-row { align-items: flex-start; flex-direction: column; gap: 10px; }
    .auth-footer { justify-content: flex-start; }
}
