/* vCP Auth-Seiten – Login & Passwort vergessen */

/* Inhalt sofort sichtbar – main.css versteckt bei show-spinner alle Kinder */
body.vcp-auth-page > *,
body.vcp-auth-page > main {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Globalen main.css-Spinner auf Auth-Seiten nie anzeigen */
body.vcp-auth-page.show-spinner::after,
body.vcp-auth-page::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
}

body.vcp-auth-page.show-spinner > main {
    overflow: visible !important;
}

/* Legacy-Fallback: alter Body ohne vcp-auth-page (z. B. veralteter Twig-Cache) */
body.background.no-footer.show-spinner:not(#app-container) > *,
body.background.no-footer.show-spinner:not(#app-container) > main {
    opacity: 1 !important;
    visibility: visible !important;
}

body.background.no-footer.show-spinner:not(#app-container)::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
}

/* Statischer Viewport – kein Scrollen, kein Layout-Shift */
body.vcp-auth-page {
    font-family: "Nunito", sans-serif;
    overflow: hidden !important;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
}

body.vcp-auth-page.background main {
    position: fixed;
    inset: 0;
    margin: 0 !important;
    height: 100vh !important;
    min-height: 100vh;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Hintergrundbild fixiert ohne Parallax-Jitter (background-attachment: fixed) */
body.vcp-auth-page .fixed-background {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
    z-index: 0;
    pointer-events: none;
}

.vcp-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: min(92vw, 520px);
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 2;
}

.vcp-auth__brand {
    margin-bottom: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.vcp-auth__brand .logo-single {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
}

/* Karte und Ladeanzeige überlagern sich – kein Verschieben beim Fade */
.vcp-auth__stage {
    position: relative;
    width: 100%;
    max-width: min(92vw, 440px);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.vcp-auth__card,
.vcp-auth__loading {
    grid-area: 1 / 1;
}

.vcp-auth__card {
    position: relative;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.08),
        0 25px 50px -12px rgba(15, 23, 42, 0.18);
    transform-origin: center center;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        visibility 0.35s ease;
}

.vcp-auth__card--exiting {
    opacity: 0;
    transform: scale(0.98);
    visibility: hidden;
    pointer-events: none;
}

.vcp-auth__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-height: 12rem;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease 0.15s;
}

.vcp-auth__loading--visible {
    opacity: 1;
}

.vcp-auth__loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(30, 45, 192, 0.18);
    border-top-color: #1E2DC0;
    border-radius: 50%;
    animation: vcp-auth-spin 0.75s linear infinite;
}

.vcp-auth__loading-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1E2DC0;
    letter-spacing: 0.01em;
}

@keyframes vcp-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.vcp-auth__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1E2DC0;
    z-index: 1;
}

.vcp-auth__header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.5rem 1.5rem 0.35rem;
}

.vcp-auth__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 12px;
    color: #1E2DC0;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(30, 45, 192, 0.14);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    font-size: 1.15rem;
}

.vcp-auth__header-text {
    flex: 1;
    min-width: 0;
    padding-top: 0.15rem;
}

.vcp-auth__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.vcp-auth__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
}

.vcp-auth__body {
    padding: 0.75rem 1.5rem 1.5rem;
}

.vcp-auth__body .vcp-flash-stack {
    margin-bottom: 1.15rem;
}

.vcp-auth__form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.vcp-auth__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.vcp-auth__label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.vcp-auth__field .form-control {
    display: block;
    width: 100%;
    border: 1px solid rgba(30, 45, 192, 0.14) !important;
    border-radius: 12px !important;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.4 !important;
    color: #1e293b !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vcp-auth__field .form-control:focus {
    border-color: rgba(30, 45, 192, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(30, 45, 192, 0.12) !important;
    outline: none !important;
}

.vcp-auth__field .form-control::placeholder {
    color: #94a3b8;
}

.vcp-auth__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.vcp-auth__link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1E2DC0;
    text-decoration: none;
    transition: color 0.15s ease;
}

.vcp-auth__link:hover,
.vcp-auth__link:focus {
    color: #161eb0;
    text-decoration: underline;
    outline: none;
}

.vcp-auth__submit {
    min-width: 7.5rem;
    padding: 0.55rem 1.25rem !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #fff !important;
    background: #1E2DC0 !important;
    box-shadow: 0 2px 8px rgba(30, 45, 192, 0.28) !important;
    transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.vcp-auth__submit:hover:not(:disabled),
.vcp-auth__submit:focus:not(:disabled) {
    background: #161eb0 !important;
    box-shadow: 0 4px 14px rgba(30, 45, 192, 0.32) !important;
    outline: none !important;
}

.vcp-auth__submit:disabled,
.vcp-auth__submit[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Dark Mode */
body.dark .vcp-auth__card {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(30, 41, 59, 0.98);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

body.dark .vcp-auth__accent {
    background: color-mix(in srgb, #1E2DC0 85%, #60a5fa);
}

body.dark .vcp-auth__header-icon {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.08);
    color: color-mix(in srgb, #1E2DC0 70%, #93c5fd);
}

body.dark .vcp-auth__title {
    color: #f1f5f9;
}

body.dark .vcp-auth__subtitle,
body.dark .vcp-auth__label {
    color: #94a3b8;
}

body.dark .vcp-auth__field .form-control {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 0.55) !important;
    color: #e2e8f0 !important;
}

body.dark .vcp-auth__field .form-control:focus {
    border-color: rgba(96, 165, 250, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12) !important;
}

body.dark .vcp-auth__field .form-control::placeholder {
    color: #64748b;
}

body.dark .vcp-auth__link {
    color: color-mix(in srgb, #1E2DC0 70%, #93c5fd);
}

body.dark .vcp-auth__link:hover,
body.dark .vcp-auth__link:focus {
    color: #bfdbfe;
}

body.dark .vcp-auth__submit {
    background: color-mix(in srgb, #1E2DC0 85%, #2563eb) !important;
}

body.dark .vcp-auth__submit:hover:not(:disabled),
body.dark .vcp-auth__submit:focus:not(:disabled) {
    background: color-mix(in srgb, #1E2DC0 70%, #3b82f6) !important;
}

body.dark .vcp-auth__loading-spinner {
    border-color: rgba(147, 197, 253, 0.22);
    border-top-color: color-mix(in srgb, #1E2DC0 70%, #93c5fd);
}

body.dark .vcp-auth__loading-text {
    color: color-mix(in srgb, #1E2DC0 70%, #93c5fd);
}

@media (max-width: 575.98px) {
    .vcp-auth {
        padding: 1rem 0.75rem;
    }

    .vcp-auth__header,
    .vcp-auth__body {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .vcp-auth__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .vcp-auth__link {
        text-align: center;
    }

    .vcp-auth__submit {
        width: 100%;
    }
}
