/* ===== LOGIN PAGE STYLES ===== */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
}

.login-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.login-main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin: 2rem 0;
}

/* ===== LEFT PANEL - INFO ===== */
.login-info-panel {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 0;
    position: relative;
}

.login-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-info-content {
    padding: 3rem 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-logo img {
    max-height: 80px;
    filter: brightness(0) invert(1);
}

.login-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.login-features {
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.feature-item i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.1rem;
}

/* ===== RIGHT PANEL - FORM ===== */
.login-form-panel {
    padding: 0;
}

.login-form-content {
    padding: 3rem 2.5rem;
    height: 100%;
}

.login-header-form {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header-form h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

/* ===== AUTHENTICATION METHODS ===== */
.auth-methods {
    margin-bottom: 2rem;
}

.auth-method-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.auth-method-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
}

.auth-method-card.active {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.02);
}

.auth-method-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.auth-method-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.auth-method-icon i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.clave-logo {
    max-width: 40px;
    max-height: 40px;
}

.auth-method-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-dark);
}

.auth-method-info p {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0;
}

/* ===== MAIN CL@VE GATEWAY BUTTON ===== */
.clave-gateway-btn {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    border: none;
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.clave-gateway-btn:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003366 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    color: white;
}

.clave-gateway-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 102, 204, 0.3);
}

.clave-gateway-btn::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;
}

.clave-gateway-btn:hover::before {
    left: 100%;
}

/* ===== CL@VE BUTTONS ===== */
.clave-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-clave {
    background: white;
    border: 2px solid #e9ecef;
    color: var(--color-dark);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.btn-clave:hover {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.05);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-clave i {
    font-size: 1.2rem;
    width: 24px;
    flex-shrink: 0;
}

.btn-clave span {
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.btn-clave small {
    font-size: 0.85rem;
    opacity: 0.7;
    display: block;
    font-weight: 400;
}

.btn-clave-certificado:hover {
    border-color: #28a745;
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.btn-clave-permanente:hover {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.btn-clave-pin:hover {
    border-color: #ffc107;
    color: #856404;
    background: rgba(255, 193, 7, 0.05);
}

/* ===== TEST LOGIN FORM ===== */
#testLoginForm .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#testLoginForm .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#testLoginForm .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
}

/* ===== AUTH TOGGLE ===== */
.auth-toggle {
    text-align: center;
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.auth-toggle .btn-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-toggle .btn-link:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

/* ===== HELP SECTION ===== */
.login-help {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.login-help h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.help-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.25rem 0;
}

.help-link:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

.help-link i {
    width: 16px;
}

/* ===== LOADING MODAL ===== */
#loadingModal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#loadingModal .progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

#loadingModal .progress-bar {
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
}

/* ===== HELP MODALS ===== */
.certificate-help-content .certificate-option {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.certificate-option h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.certificate-option ul li {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
    .login-info-panel {
        order: 2;
    }
    
    .login-form-panel {
        order: 1;
    }
    
    .login-info-content {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .login-form-content {
        padding: 2rem 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .clave-options {
        gap: 0.5rem;
    }
    
    .btn-clave {
        padding: 0.75rem 1rem;
    }
    
    .help-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    .login-main {
        padding: 1rem 0;
    }
    
    .login-container {
        margin: 1rem 0;
        border-radius: 15px;
    }
    
    .login-info-content,
    .login-form-content {
        padding: 1.5rem 1rem;
    }
    
    .auth-method-header {
        flex-direction: column;
        text-align: center;
    }
    
    .auth-method-icon {
        margin-right: 0;
        margin-bottom: 0.75rem;
    }
    
    .btn-clave {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .btn-clave i {
        margin-bottom: 0.5rem;
        font-size: 1.5rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.btn-clave:focus,
.auth-method-card:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .btn-clave,
    .auth-method-card {
        transition: none;
    }
    
    .btn-clave:hover {
        transform: none;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeInUp 0.6s ease-out;
}

.auth-method-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.auth-method-card:nth-child(1) { animation-delay: 0.1s; }
.auth-method-card:nth-child(2) { animation-delay: 0.2s; }
.auth-method-card:nth-child(3) { animation-delay: 0.3s; }
