/* LOGIN V2.1 - Mega Publicidad (Responsive Fix) */

:root {
    --primary-color: #D50D11; 
    --primary-hover: #B50A0E;
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(20, 20, 20, 0.85); /* Más opaco para mejor lectura */
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.4);
    --radius: 16px;
}

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    background-color: #1a1a1a; 
}

/* --- FONDO --- */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/mega.jpg'); 
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Padding pequeño para móviles */
    z-index: 1;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: -1;
    backdrop-filter: blur(3px);
}

/* --- TARJETA --- */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 40px;
    width: 100%;
    max-width: 400px; /* Un poco más estrecha por defecto */
    text-align: center;
    color: var(--text-color);
    position: relative;
    z-index: 2;
}

/* --- ELEMENTOS --- */
.company-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 16px; /* Padding cómodo */
    font-size: 15px;
    color: var(--text-color);
    transition: all 0.2s;
    height: 48px; /* Altura mínima para dedo */
}

.login-input.with-icon {
    padding-left: 44px;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 20px;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 2px rgba(213, 13, 17, 0.3);
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.login-button {
    width: 100%;
    height: 50px; /* Botón alto */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-button:active {
    transform: scale(0.98);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #ffb3b3;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   RESPONSIVE (AQUÍ ESTÁ LA SOLUCIÓN)
   ========================================= */
@media (max-width: 768px) {
    .login-background {
        padding: 0; /* Sin padding en el borde */
        background-attachment: scroll; /* Mejor rendimiento en móvil */
        display: flex;
        align-items: center; /* Centrado vertical */
    }

    .login-card {
        width: 90%; /* Ocupa casi todo el ancho */
        max-width: none;
        padding: 30px 20px;
        margin: 0 auto;
        border-radius: 20px;
        background: rgba(15, 15, 15, 0.92); /* Casi negro sólido para leer bien */
    }

    .company-logo {
        max-width: 200px; /* Logo grande */
        margin-bottom: 25px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-input {
        font-size: 16px; /* Evita zoom en iPhone */
        height: 52px; /* Área táctil grande */
    }

    .login-button {
        height: 56px; /* Botón muy fácil de tocar */
        font-size: 18px;
    }

    .input-label {
        font-size: 14px;
        color: #ddd;
    }
    
    .remember-me {
        font-size: 14px;
        padding: 10px 0; /* Más fácil de tocar el checkbox */
    }
}