/* ================= Login Overlay ================= */
#loginOverlay {
    display: none;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow-y: auto;
    z-index: 9999;
}

.login-overlay::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: bgFade 5s infinite alternate;
    z-index: -1;
}

@keyframes bgFade {
    0% {
        background-image: url('./images/background_1.png');
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        background-image: url('./images/background_2.png');
        opacity: 1;
    }
}

/* ================= Login Container ================= */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    z-index: 10;
    gap: 1.5rem;
    /* ADD: Prevent overflow */
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    /* ADD: Account for bottom logo */
    padding-bottom: 80px;
}

.login-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 1;
}

.top-logo {
    flex-shrink: 1;
}

.top-logo img {
    width: min(700px, 80vw);
    height: auto;
    /* CHANGE: Make it bigger on high resolution */
    max-height: min(40vh, 400px); /* was 30vh */
    object-fit: contain;
}

.bottom-logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: min(320px, 80vw);
    flex-shrink: 1;
}

.bottom-logos img {
    width: calc(50% - 0.5rem);
    height: auto;
    max-height: 15vh;
    object-fit: contain;
}

/* ================= Login Card ================= */
.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 1rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-align: center;
    /* CHANGE: Remove flex-shrink to keep it visible */
    flex-shrink: 0;
    /* ADD: Ensure minimum visibility */
    min-height: min-content;
}

.login-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.login-card p {
    margin-bottom: 2rem;
    color: #555;
}

.btn-custom {
    background-color: #5b8da6;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 44px;
}

.btn-custom:hover {
    background-color: #4a7488;
    color: white;
}

.btn-custom:focus {
    background-color: #4a7488;
    color: white;
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(91, 141, 166, 0.3);
}

/* ================= Bottom Logo ================= */
.bottom-logo {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    height: auto;
    max-height: min(50px, 8vh);
    width: auto;
    max-width: 90vw;
    opacity: 0.8;
    z-index: 5;
    object-fit: contain;
}

/* ================= Responsive Design ================= */
@media (max-width: 768px) {
    .login-container {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .top-logo img {
        max-height: 25vh;
    }

    .bottom-logos img {
        max-height: 12vh;
    }

    .login-card {
        max-width: 350px;
        padding: 1.5rem;
    }

    .bottom-logo {
        max-height: min(35px, 6vh);
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
        gap: 0.75rem;
    }

    .top-logo img {
        max-height: 20vh;
    }

    .bottom-logos img {
        max-height: 10vh;
    }

    .login-card {
        max-width: 300px;
        padding: 1.25rem;
    }

    .bottom-logo {
        max-height: min(25px, 5vh);
        bottom: 5px;
    }
}

@media (max-height: 600px) {
    .login-container {
        padding: 1rem;
        gap: 0.5rem;
    }

    .top-logo img {
        max-height: 15vh;
    }

    .bottom-logos {
        gap: 0.5rem;
    }

    .bottom-logos img {
        max-height: 8vh;
    }

    .login-card {
        padding: 1rem;
    }

    .btn-custom {
        padding: 0.5rem 1.5rem;
    }
}

@media (max-height: 400px) {
    .login-logos {
        display: none;
    }

    .bottom-logo {
        display: none;
    }
}

@media (max-height: 700px) {
    .login-container {
        gap: 0.75rem;
        padding-bottom: 60px;
    }

    .top-logo img {
        max-height: 25vh; /* Smaller on short screens */
    }
}

/* ADD: High resolution screens */
@media (min-height: 900px) {
    .top-logo img {
        max-height: min(45vh, 500px); /* Even bigger on tall screens */
    }
}