﻿
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden; /* Previene el scroll horizontal */
}

.login-background-gradient {
    background-image: url('https://img.freepik.com/foto-gratis/mano-mecanico-revisando-arreglando-automovil-roto-garaje-servicio-automoviles_146671-19717.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    filter: brightness(40%);
}

/* Modificación clave: min-height: 100vh; solo si es necesario, y flex-shrink */
.login-container {
    /* d-flex, justify-content-center, align-items-center, p-3 ya están en HTML.
           Quitamos min-vh-100 de aquí para controlarlo con media queries si es necesario
           o dejar que el contenido defina la altura si es menor que 100vh. */
    /* overflow-y: auto; se mantiene para permitir scroll si el contenido es demasiado grande */
    overflow-y: auto;
    /* Permitir que el card se encoja si el espacio vertical es limitado */
    flex-shrink: 1;
}

.card.custom-login-card {
    background-color: #6c757d;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    position: relative;

}

.logo-circle-container {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.logo-icon-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.login-title {
    color: white;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 2.5em; /* Tamaño predeterminado para pantallas grandes */
}

.input-group-text.custom-input-icon {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    padding-left: 0.75rem;
    padding-right: 0.5rem;
    border-radius: 0 !important;
    transition: border-bottom-color 0.3s ease;
}

.form-control.custom-input-field {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 0;
    color: white;
    padding: 0.75rem 0.75rem 0.75rem 0;
    font-size: 1.1em;
    transition: border-bottom-color 0.3s ease;
    box-shadow: none !important;
}

    .form-control.custom-input-field::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    .form-control.custom-input-field:focus {
        outline: none;
        box-shadow: none !important;
        border-bottom: 2px solid white;
    }

.input-group:focus-within .input-group-text.custom-input-icon,
.input-group:focus-within .form-control.custom-input-field {
    border-bottom-color: white !important;
}

.input-error-message {
    color: #ffc107 !important;
    display: block;
    text-align: left;
    margin-top: 5px;
    padding-left: 0.5rem;
    font-size: 0.85em;
}

.input-group.is-invalid .form-control.custom-input-field,
.input-group.is-invalid .input-group-text.custom-input-icon {
    border-bottom-color: #ffc107 !important;
}

.failureNotification {
    color: #ffc107;
    font-size: 0.9em;
    margin-bottom: 1rem;
    display: block;
    font-weight: 500;
}

.remember-me-container input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    background-color: transparent;
    appearance: none;
    cursor: pointer;
    position: relative;
    outline: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .remember-me-container input[type="checkbox"]:checked {
        background-color: #90EE90;
        border-color: #90EE90;
    }

.btn-primary.custom-btn {
    background-color: #90EE90;
    border-color: #90EE90;
    color: black;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

    .btn-primary.custom-btn:hover {
        background-color: #7EC87E;
        border-color: #7EC87E;
        color: black;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    }

    .btn-primary.custom-btn:active {
        transform: translateY(0);
    }

.forgot-password-link {
    color: white;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .forgot-password-link:hover {
        color: rgba(255, 255, 255, 0.8);
    }

/* Media Queries */

/* Para pantallas grandes (desktops y laptops con resolución alta) */
@media (min-width: 1400px) { /* A partir de 1400px, usar tamaños grandes */
    .login-title {
        font-size: 2.5em;
        letter-spacing: 2px;
    }

    .logo-circle-container {
        top: -60px;
        width: 120px;
        height: 120px;
    }

    .logo-icon-image {
        width: 170px;
        height: 170px;
    }
}


/* Rango de laptops y pantallas grandes intermedias (ej. 1399px a 992px) */
@media (max-width: 1399.98px) and (min-width: 992px) {
    .login-title {
        font-size: 2.1em;
        letter-spacing: 1.5px;
    }
    /* Ajustar el logo para que no sea tan grande, si es necesario */
    .logo-circle-container {
        top: -55px; /* Un poco más arriba para compensar */
        width: 110px;
        height: 110px;
    }

    .logo-icon-image { /*MIA*/
        width: 180px;
        height: 180px;
    }
}

/* Rango de tablets en horizontal y laptops pequeños (hasta 991.98px) */
@media (max-width: 991.98px) {
    .login-title {
        font-size: 1.8em;
        margin-top: 50px; /* Margen para compensar logo */
        margin-bottom: 1.5rem;
        letter-spacing: 1px;
    }

    .logo-circle-container {
        width: 100px;
        height: 100px;
        top: -40px;
    }

    .logo-icon-image {
        width: 150px;
        height: 150px;
    }
    /* Reducir padding del card en estas resoluciones para ser más compacto */
    .card.custom-login-card {
        padding-top: 40px; /* Reducimos el padding superior */
        padding-bottom: 30px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Para pantallas muy pequeñas (móviles y tablets pequeñas) hasta 575.98px */
@media (max-width: 575.98px) {
    .login-title {
        font-size: 1.6em;
        margin-top: 40px;
        margin-bottom: 1rem;
        letter-spacing: 0.5px;
    }

    .logo-circle-container {
        width: 80px;
        height: 80px;
        top: -30px;
    }

    .logo-icon-image {
        width: 100px;
        height: 100px;
    }
    /* Aún más compacto en móviles */
    .card.custom-login-card {
        padding-top: 30px; /* Más reducción de padding */
        padding-bottom: 20px;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* **CRÍTICO PARA ALTURAS LIMITADAS:** Para pantallas con poca altura (ej. portátiles compactos, o ventanas no maximizadas) */
@media (max-height: 700px) { /* Ajustar este valor (ej. 600px, 700px) según la altura mínima de los portátiles de prueba */
    .login-container {
        /* QUITAMOS min-height: 100vh; para estas alturas */
        min-height: auto !important; /* Asegura que no fuerce la altura del viewport */
        align-items: flex-start; /* Alinea el contenido al inicio para no forzar centrado vertical */
        padding-top: 10px; /* Pequeño padding superior */
        padding-bottom: 10px; /* Pequeño padding inferior */
    }

    .card.custom-login-card {
        /* Reduce significativamente el padding vertical del card */
        padding-top: 20px !important;
        padding-bottom: 15px !important;
        border-radius: 10px !important; /* Menos redondeo si el card es más pequeño */
        margin-top: 22%; /* Eliminar margen superior si lo hubiera */
        margin-bottom: 0; /* Eliminar margen inferior si lo hubiera */
    }

    .logo-circle-container {
        width: 70px;
        height: 70px;
        top: -25px; /* Ajuste para que se vea menos prominente */
    }

    .logo-icon-image {
        width: 110px;
        height: 110px;
    }

    .login-title {
        font-size: 1.4em !important; /* Título mucho más pequeño */
        margin-top: 25px !important; /* Menos margen superior */
        margin-bottom: 0.7rem !important;
        letter-spacing: 0 !important; /* Eliminar espaciado para ahorrar espacio */
    }

    .form-group {
        margin-bottom: 1rem !important; /* Reducir espacio entre campos */
    }

    .btn-primary.custom-btn {
        padding: 10px !important; /* Botón más compacto */
        font-size: 1em !important;
    }

    .remember-me-container {
        margin-top: 0.5rem !important;
        margin-bottom: 1rem !important;
    }

    .forgot-password-link {
        margin-top: 0.8rem !important;
        font-size: 0.8em !important;
    }
}


