/* =========================================================
   Принудительное корректное окно входа
   Исправляет только стартовое окно логина.
   ========================================================= */

#loginOverlay {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 16px !important;
    margin: 0 !important;

    overflow: hidden !important;
    z-index: 2147483600 !important;

    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(6px) !important;
}

#loginOverlay.force-hidden {
    display: none !important;
}

#loginOverlay .login-box {
    position: relative !important;

    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;

    margin: auto !important;

    width: 360px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;

    overflow-y: auto !important;
    z-index: 2147483601 !important;
}

/* Обычные модалки не трогаем, но если открываются — поверх интерфейса */
.modal-overlay {
    z-index: 2147483000 !important;
}

.modal-overlay .modal-box {
    z-index: 2147483001 !important;
}

@media (max-width: 950px) {
    #loginOverlay {
        padding: 10px !important;
    }

    #loginOverlay .login-box {
        width: 360px !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
    }
}
