/* ===================================================================
   GRUPO SEAL - ESTILOS EXCLUSIVOS PARA LOGIN (MEJORADO)
   ================================================================== */

/* ===== VARIABLES ESPECÍFICAS PARA LOGIN ===== */
:root {
    /* Paleta de colores GRUPO SEAL */
    --comseproa-primary: #0a253c;
    --comseproa-secondary: #c8c9ca;
    --comseproa-white: #ffffff;
    --comseproa-text-light: #666;
    --comseproa-shadow: rgba(10, 37, 60, 0.1);
    --comseproa-shadow-hover: rgba(10, 37, 60, 0.2);
    
    /* Espaciado específico */
    --login-padding: 15px;
    --login-margin: 20px;
    --login-border-radius: 8px;
    
    /* Transiciones */
    --login-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tamaños del logo */
    --logo-width-desktop: 900px;
    --logo-width-tablet: 500px;
    --logo-width-mobile: 300px;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--comseproa-white) 0%, #f8f9fa 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--comseproa-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LAYOUT PRINCIPAL ===== */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    min-height: 100vh;
    background: var(--comseproa-white);
    box-shadow: 0 20px 40px var(--comseproa-shadow);
    border-radius: 0;
    overflow: hidden;
}

/* ===== SECCIÓN IZQUIERDA (LOGO) ===== */
.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--comseproa-white) 0%, #f8f9fa 50%, var(--comseproa-white) 100%);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Efecto decorativo de fondo */
.left-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--comseproa-shadow) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(10px, -10px) rotate(1deg); }
    66% { transform: translate(-5px, 5px) rotate(-1deg); }
}

.left-section .logo {
    width: var(--logo-width-desktop);
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 10px 20px var(--comseproa-shadow));
    transition: var(--login-transition);
    position: relative;
    z-index: 2;
}

.left-section .logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 15px 30px var(--comseproa-shadow-hover));
}

/* ===== LÍNEA DIVISORIA ===== */
.divider {
    width: 3px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--comseproa-secondary) 20%, 
        var(--comseproa-primary) 50%, 
        var(--comseproa-secondary) 80%, 
        transparent 100%
    );
    position: relative;
    flex-shrink: 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--comseproa-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--comseproa-white), 0 0 0 6px var(--comseproa-secondary);
}

/* ===== SECCIÓN DERECHA (FORMULARIO) ===== */
.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: var(--comseproa-white);
    position: relative;
}

.right-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--comseproa-white) 0%, 
        rgba(10, 37, 60, 0.02) 50%, 
        var(--comseproa-white) 100%
    );
    z-index: 1;
}

.right-section > * {
    position: relative;
    z-index: 2;
}

/* ===== TÍTULO ===== */
.right-section h2 {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--comseproa-primary);
    text-align: center;
    position: relative;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.right-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--comseproa-primary), var(--comseproa-secondary));
    border-radius: 2px;
}

/* ===== ÁREA DE MENSAJES ===== */
#messages-area {
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
}

/* Mensajes del sistema */
.login-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: var(--login-border-radius);
    margin-bottom: 15px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease;
}

.login-message i {
    font-size: 18px;
    flex-shrink: 0;
}

.login-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.login-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    color: #856404;
    border-left: 4px solid #ffc107;
}

.login-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    color: #155724;
    border-left: 4px solid #28a745;
}

.login-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(23, 162, 184, 0.05));
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORMULARIO ===== */
form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ===== CONTENEDORES DE CAMPOS ===== */
.input-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ===== LABELS ===== */
label {
    font-weight: 600;
    font-size: 16px;
    color: var(--comseproa-primary);
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
    transition: var(--login-transition);
}

/* ===== INPUTS ===== */
input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--comseproa-secondary);
    border-radius: var(--login-border-radius);
    font-size: 16px;
    font-family: inherit;
    background: var(--comseproa-white);
    color: var(--comseproa-primary);
    transition: var(--login-transition);
    outline: none;
    position: relative;
}

/* Campo de contraseña con botón de mostrar/ocultar */
.password-container {
    position: relative;
}

.password-container input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--comseproa-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: var(--login-transition);
    z-index: 3;
}

.password-toggle:hover {
    color: var(--comseproa-primary);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:focus {
    outline: 2px solid var(--comseproa-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

input:focus {
    border-color: var(--comseproa-primary);
    box-shadow: 
        0 0 0 3px rgba(10, 37, 60, 0.1),
        0 8px 25px rgba(10, 37, 60, 0.1);
    transform: translateY(-2px);
}

input:hover:not(:focus) {
    border-color: rgba(10, 37, 60, 0.6);
    box-shadow: 0 4px 15px rgba(10, 37, 60, 0.05);
}

input::placeholder {
    color: var(--comseproa-secondary);
    font-size: 15px;
    transition: var(--login-transition);
}

input:focus::placeholder {
    opacity: 0.7;
    transform: translateX(5px);
}

/* Estados de validación */
input:valid {
    border-color: #28a745;
}

input:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

/* ===== BOTÓN ===== */
button[type="submit"] {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--comseproa-primary) 0%, #0d2d47 100%);
    color: var(--comseproa-white);
    border: none;
    border-radius: var(--login-border-radius);
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--login-transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.5s ease;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #0d2d47 0%, var(--comseproa-primary) 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 10px 25px rgba(10, 37, 60, 0.3),
        0 5px 10px rgba(10, 37, 60, 0.2);
}

button[type="submit"]:hover::before {
    left: 100%;
}

button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 
        0 5px 15px rgba(10, 37, 60, 0.3),
        0 2px 5px rgba(10, 37, 60, 0.2);
}

button[type="submit"]:focus {
    outline: 3px solid rgba(10, 37, 60, 0.3);
    outline-offset: 2px;
}

/* Estado de carga */
button[type="submit"].loading {
    pointer-events: none;
    position: relative;
    color: transparent;
    background: #6c757d !important;
}

button[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--comseproa-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== OPCIONES ADICIONALES ===== */
.additional-options {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    max-width: 400px;
}

.additional-options p {
    color: var(--comseproa-text-light);
    font-size: 14px;
}

.link-button {
    background: none;
    border: none;
    color: var(--comseproa-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--login-transition);
}

.link-button:hover {
    color: #0056b3;
}

/* ===== MODAL DE AYUDA ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideInFromTop 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--comseproa-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: var(--login-transition);
}

.close:hover {
    color: #333;
    transform: scale(1.1);
}

.help-options {
    margin-top: 20px;
}

.help-option {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--login-border-radius);
    background: #f8f9fa;
    transition: var(--login-transition);
}

.help-option:hover {
    box-shadow: 0 4px 15px rgba(10, 37, 60, 0.05);
}

.help-option h4 {
    margin: 0 0 10px 0;
    color: var(--comseproa-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.help-option p {
    margin: 0 0 10px 0;
    color: var(--comseproa-text-light);
    font-size: 14px;
    line-height: 1.5;
}

.help-option code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d63384;
}

.btn-help, .btn-help-inline {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--login-transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-help:hover, .btn-help-inline:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-help-inline {
    margin-top: 10px;
    font-size: 12px;
    padding: 6px 12px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets (hasta 1024px) */
@media screen and (max-width: 1024px) {
    .left-section .logo {
        width: var(--logo-width-tablet);
    }
    
    .right-section {
        padding: 40px 30px;
    }
    
    form, #messages-area, .additional-options {
        max-width: 350px;
    }
}

/* Tablets pequeñas y móviles grandes (hasta 768px) */
@media screen and (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .login-container {
        flex-direction: column;
        min-height: 100vh;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .left-section {
        flex: none;
        min-height: 40vh;
        padding: 30px 20px;
        order: 1;
    }
    
    .left-section .logo {
        width: var(--logo-width-mobile);
    }
    
    .divider {
        display: none;
    }
    
    .right-section {
        flex: 1;
        min-height: 60vh;
        padding: 40px 20px;
        order: 2;
        justify-content: flex-start;
        padding-top: 60px;
    }
    
    .right-section h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    form, #messages-area, .additional-options {
        max-width: 100%;
        width: 100%;
    }
    
    form {
        gap: 20px;
    }
    
    input {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .password-container input {
        padding-right: 45px;
    }
    
    .password-toggle {
        right: 12px;
        font-size: 16px;
    }
    
    button[type="submit"] {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media screen and (max-width: 480px) {
    .left-section {
        min-height: 35vh;
        padding: 20px 15px;
    }
    
    .left-section .logo {
        width: 250px;
    }
    
    .right-section {
        padding: 30px 15px;
        padding-top: 40px;
    }
    
    .right-section h2 {
        font-size: 24px;
        margin-bottom: 25px;
        letter-spacing: 1px;
    }
    
    form {
        gap: 18px;
    }
    
    input {
        padding: 12px 14px;
        border-radius: 6px;
    }
    
    .password-container input {
        padding-right: 40px;
    }
    
    .password-toggle {
        right: 10px;
        font-size: 14px;
    }
    
    button[type="submit"] {
        padding: 14px 18px;
        border-radius: 6px;
        font-size: 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
    }
}

/* Móviles muy pequeños (hasta 320px) */
@media screen and (max-width: 320px) {
    .left-section .logo {
        width: 200px;
    }
    
    .right-section h2 {
        font-size: 22px;
    }
    
    input, button[type="submit"] {
        padding: 12px;
        font-size: 14px;
    }
}

/* ===== LANDSCAPE MÓVIL ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .login-container {
        flex-direction: row;
    }
    
    .left-section {
        flex: 0.4;
        min-height: 100vh;
        order: 1;
    }
    
    .left-section .logo {
        width: 200px;
    }
    
    .divider {
        display: block;
        height: 100vh;
        width: 2px;
    }
    
    .right-section {
        flex: 0.6;
        min-height: 100vh;
        order: 2;
        padding: 20px;
        justify-content: center;
    }
    
    .right-section h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    form {
        gap: 15px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --comseproa-primary: #000000;
        --comseproa-secondary: #666666;
        --comseproa-white: #ffffff;
    }
    
    input, button[type="submit"] {
        border-width: 3px;
    }
}

/* ===== NAVEGACIÓN POR TECLADO ===== */
.keyboard-navigation input:focus,
.keyboard-navigation button:focus,
.keyboard-navigation .password-toggle:focus,
.keyboard-navigation .link-button:focus {
    outline: 3px solid var(--comseproa-primary) !important;
    outline-offset: 2px !important;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }
    
    .login-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .left-section::before {
        display: none;
    }
    
    button[type="submit"] {
        background: #000 !important;
        color: #fff !important;
    }
    
    .modal {
        display: none !important;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(10, 37, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(10, 37, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(10, 37, 60, 0); }
}

/* Aplicar animación de pulse al botón cuando está en focus */
button[type="submit"]:focus:not(.loading) {
    animation: pulse 1.5s infinite;
}

/* ===== FINAL DEL ARCHIVO ===== */