﻿/* --- Variables Globales --- */
:root {
    --primary-color: #0056b3; /* Un azul corporativo fuerte */
    --primary-hover: #004494;
    --sidebar-bg: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    --body-bg: #f4f7f6;
    --form-bg: #ffffff;
    --text-color: #333;
    --light-text-color: #ffffff;
    --input-border-color: #ced4da;
    --input-focus-color: var(--primary-color);
    --error-color: #dc3545;
    --success-color: #28a745;
    --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* --- Estilos Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
}

/* --- Contenedor Principal (Wrapper) --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

/* --- Contenedor del Login --- */
.login-container {
    display: flex;
    flex-direction: column; /* Apilado en móvil por defecto */
    width: 100%;
    max-width: 400px; /* Tamaño máximo para móviles */
    background-color: var(--form-bg);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden; /* Mantiene los bordes redondeados */
    transition: all 0.3s ease-in-out;
}

/* --- Barra Lateral (Sidebar) --- */
.login-sidebar {
    background: var(--sidebar-bg);
    color: var(--light-text-color);
    padding: 40px 20px;
    text-align: center;
}

.sidebar-content .logo {
    max-width: 120px;
    margin-bottom: 20px;
}

.sidebar-content h1 {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.sidebar-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* --- Sección del Formulario --- */
.login-form-section {
    padding: 40px 30px;
}

.login-form-content h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    color: var(--text-color);
}

/* --- Grupos de Formulario y Campos de Texto --- */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--input-border-color);
    transition: color 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 12px 12px 12px 45px; /* Espacio para el ícono */
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .form-control:focus {
        outline: none;
        border-color: var(--input-focus-color);
        box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2);
    }

        .form-control:focus + .input-icon i,
        .form-control:not(:placeholder-shown) + .input-icon i {
            color: var(--primary-color);
        }

/* --- Botón de Login --- */
.btn-login {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-login:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
    }

/* --- Mensajes de Error y Alertas --- */
.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: -15px;
    display: block;
    margin-bottom: 10px;
    padding-left: 5px;
}

.alert-message {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    border-radius: 8px;
    background-color: var(--error-color); /* Por defecto, para error de credenciales */
    color: white;
}


/* --- Responsive Design (Para Tablets y Escritorios) --- */
@media (min-width: 768px) {
    .login-container {
        flex-direction: row; /* Columnas lado a lado */
        max-width: 800px; /* Más ancho en pantallas grandes */
    }

    .login-sidebar, .login-form-section {
        flex: 1; /* Ambas columnas toman el 50% del espacio */
    }

    .login-sidebar {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .login-form-section {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .login-form-content {
        width: 100%;
        max-width: 350px; /* Controla el ancho del formulario dentro de su sección */
    }
}
