/* ==========================================================================
   CONFIGURACIÓN GENERAL Y RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    width: 100%;
    height: 100vh;
    overflow: hidden !important; /* Evita scrolls incómodos en layouts compactos */
    background-color: #8b8c8e; /* Fondo gris oscuro característico de Avistock */
}

/* Contenedor flexible centrado */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

/* ==========================================================================
   TARJETA CENTRAL (LOGIN CARD)
   ========================================================================== */
.login-card {
    position: relative !important;
    width: 100%;
    max-width: 440px; /* Ancho estándar profesional */
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 32px 24px 32px !important; /* Alturas comprimidas estratégicamente */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* El Logo de Avistock colocado arriba a la izquierda asomándose */
.login-logo {
    position: absolute !important;
    top: -46px !important;  
    left: -36px !important; 
    z-index: 10 !important; 
}

.login-logo img {
    width: 105px !important;
    height: auto !important;
    display: block !important;
}

/* ==========================================================================
   ENCABEZADOS
   ========================================================================== */
.login-header {
    text-align: center;
    margin-bottom: 14px !important;
}

.login-header img {
    width: 45px !important; /* Compacto y elegante */
    height: auto;
    margin-bottom: 6px;
}

.login-header h2 {
    font-size: 1.15rem !important;
    line-height: 1.3;
    margin: 0 0 4px 0;
    color: #1f2937;
    font-weight: 700;
}

.login-header p, .subtitle {
    color: #6b7280;
    font-size: 0.85rem !important;
    line-height: 1.4;
    margin: 0;
}

/* ==========================================================================
   FORMULARIOS, INPUTS Y ALERTAS
   ========================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px !important; /* Espaciado optimizado entre inputs */
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 3px !important;
}

.input-group label {
    font-size: 0.82rem !important;
    font-weight: 600;
    color: #4b5563;
    text-align: left;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.input-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Estilo estilizado del input con padding para el icono */
.input-wrapper input {
    width: 100%;
    padding: 9px 12px 9px 40px !important; 
    font-size: 0.88rem !important;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    background-color: #f9fafb;
}

.input-wrapper input:focus {
    border-color: #f27438; /* Cambio a naranja corporativo al escribir */
    background-color: #ffffff;
}

/* Visualización de error en Input */
.input-wrapper input.input-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.error-text {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 1px;
    min-height: 12px; 
    display: block;
    text-align: left;
    font-weight: 500;
}

/* Alertas generales de la tarjeta (para mensajes del servidor o fallos globales) */
.alert-box {
    background-color: #fee2e2;
    border-left: 5px solid #ef4444;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: left;
    display: none;
}

/* ==========================================================================
   OPCIONES EXTRAS, BOTONES Y PIE DE PÁGINA
   ========================================================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin: 2px 0;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    cursor: pointer;
    font-weight: 500;
}

.remember-me input {
    accent-color: #f27438;
}

.forgot-pass {
    color: #f27438;
    text-decoration: none;
    font-weight: 600;
}

.forgot-pass:hover {
    text-decoration: underline;
}

/* Botón Principal de Acción Naranja */
.btn-login, .btn-primary {
    width: 100%;
    background-color: #f27438;
    color: #ffffff;
    padding: 11px !important;
    font-size: 0.95rem !important;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-top: 4px !important;
    transition: background-color 0.2s;
}

.btn-login:hover, .btn-primary:hover {
    background-color: #df5e23;
}

/* Pie de tarjeta */
.login-footer {
    text-align: center;
    margin-top: 12px !important;
    font-size: 0.82rem !important;
}

.login-footer p {
    margin: 0;
    color: #4b5563;
}

.login-footer a {
    color: #f27438;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}