/* =============================================
   ESTILOS ESPECÍFICOS PARA EL LOGIN
   ============================================= */

:root {
    --login-primary: #28a745;
    --login-primary-light: rgba(40, 167, 69, 0.1);
    --login-primary-dark: #218838;
    --login-text-dark: #2c3e50;
    --login-text-light: #6c757d;
    --login-border: #e9ecef;
    --login-bg-light: #f8f9fa;
    --login-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --login-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --login-radius: 16px;
}

/* Contenedor principal del login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Fondo decorativo */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(40, 167, 69, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(32, 201, 151, 0.03) 0%, transparent 50%);
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Tarjeta de login */
.login-card {
    display: flex;
    background: white;
    border-radius: var(--login-radius);
    box-shadow: var(--login-shadow);
    overflow: hidden;
    min-height: 680px;
    max-height: 85vh;
    opacity: 0;
    transform: translateY(20px);
    animation: loginFadeIn 0.6s ease 0.2s forwards;
    transition: all 0.3s ease;
}

.login-card:hover {
    box-shadow: var(--login-shadow-hover);
}

@keyframes loginFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   SECCIÓN INFORMACIÓN (IZQUIERDA)
   ============================================= */
.login-info {
    flex: 1.2;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.info-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Logos */
.logos-section {
    margin-bottom: 3.5rem;
}

.company-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
    margin-bottom: 2rem;
    opacity: 0.9;
    filter: brightness(1.1);
}

.brand-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 2rem 0;
}

.system-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.app-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.app-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--login-text-dark);
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--login-primary) 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Descripción del sistema */
.system-description {
    flex: 1;
    margin-bottom: 2.5rem;
}

.system-description h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--login-text-dark);
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.description-text {
    color: var(--login-text-light);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    max-width: 95%;
}

/* Lista de características */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--login-text-dark);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
}

.feature-icon {
    color: var(--login-primary);
    font-size: 1.2rem;
    width: 26px;
    text-align: center;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

/* Soporte técnico */
.support-info {
    padding-top: 2rem;
    border-top: 1px solid var(--login-border);
    color: var(--login-text-light);
    font-size: 0.95rem;
    margin-top: auto;
}

.support-info i {
    color: var(--login-primary);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* =============================================
   SECCIÓN FORMULARIO (DERECHA)
   ============================================= */
.login-form-section {
    flex: 1;
    padding: 3.5rem;
    display: flex;
    align-items: center;
    background: white;
    position: relative;
    overflow-y: auto;
}

.login-form-section::-webkit-scrollbar {
    width: 6px;
}

.login-form-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.login-form-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Encabezado del formulario */
.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--login-text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.form-subtitle {
    color: var(--login-text-light);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Grupos del formulario */
.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--login-text-dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    letter-spacing: -0.3px;
}

/* Input groups */
.input-group {
    position: relative;
    display: flex;
    border: 2px solid var(--login-border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
    transform: translateY(-2px);
}

.input-group-prepend {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--login-bg-light);
    border-right: 2px solid var(--login-border);
}

.input-group-icon {
    color: var(--login-text-light);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.form-control {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    background: transparent;
    color: var(--login-text-dark);
    outline: none;
    min-height: 56px;
    font-family: inherit;
}

.form-control::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.input-group-append {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--login-bg-light);
    border-left: 2px solid var(--login-border);
}

.btn-eye {
    background: none;
    border: none;
    color: var(--login-text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.btn-eye:hover {
    color: var(--login-primary);
    background: rgba(40, 167, 69, 0.1);
}

.input-hint {
    font-size: 0.9rem;
    color: var(--login-text-light);
    margin-top: 0.75rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-hint::before {
    content: 'ⓘ';
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Checkbox */
.form-options {
    margin: 2.5rem 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--login-bg-light);
    border-radius: 10px;
    border: 1px solid var(--login-border);
    transition: all 0.2s;
}

.form-check:hover {
    background: #f1f3f4;
    border-color: #dae0e5;
}

.form-check-input {
    width: 1.3em;
    height: 1.3em;
    margin: 0;
    border: 2px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.form-check-input:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--login-text-dark);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
}

.form-check-label i {
    color: var(--login-primary);
    font-size: 1.1rem;
}

/* Botón de login */
.form-actions {
    margin-top: 2.5rem;
}

.btn-login {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, var(--login-primary) 0%, #20c997 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    letter-spacing: 0.5px;
    min-height: 58px;
    font-family: inherit;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.25);
}

/* Enlaces */
.form-links {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--login-border);
}

.link-forgot {
    color: var(--login-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
}

.link-forgot:hover {
    color: var(--login-primary-dark);
    background: rgba(40, 167, 69, 0.05);
    text-decoration: none;
}

.link-forgot i {
    font-size: 1.1rem;
}

/* Footer del formulario */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--login-border);
    font-size: 0.9rem;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--login-text-light);
    background: rgba(40, 167, 69, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.security-badge i {
    color: var(--login-primary);
    font-size: 1rem;
}

.version {
    color: var(--login-text-light);
    font-weight: 500;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 992px) {
    .login-card {
        flex-direction: column;
        max-width: 600px;
        margin: 0 auto;
        max-height: 90vh;
    }
    
    .login-info,
    .login-form-section {
        padding: 2.5rem;
    }
    
    .login-info {
        flex: 0 0 auto;
        max-height: 40%;
    }
    
    .login-form-section {
        flex: 1;
        overflow-y: auto;
    }
    
    .logos-section {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .company-logo {
        margin-bottom: 0;
        height: 45px;
    }
    
    .brand-divider {
        width: 1px;
        height: 40px;
        margin: 0;
    }
    
    .system-brand {
        justify-content: center;
    }
    
    .system-description h2 {
        font-size: 1.5rem;
    }
    
    .description-text {
        font-size: 1rem;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 15px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .login-card {
        min-height: auto;
        max-height: none;
        border-radius: 14px;
    }
    
    .login-info,
    .login-form-section {
        padding: 2rem;
    }
    
    .form-header h2 {
        font-size: 1.75rem;
    }
    
    .app-name {
        font-size: 1.75rem;
    }
    
    .system-description h2 {
        font-size: 1.35rem;
    }
    
    .btn-login {
        padding: 1rem;
        min-height: 54px;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 10px;
        padding-top: 30px;
    }
    
    .login-card {
        border-radius: 12px;
    }
    
    .login-info,
    .login-form-section {
        padding: 1.75rem;
    }
    
    .logos-section {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .brand-divider {
        width: 100%;
        height: 1px;
    }
    
    .system-brand {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .app-name {
        font-size: 1.5rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-subtitle {
        font-size: 1rem;
    }
    
    .form-control {
        padding: 0.875rem 1rem;
        min-height: 52px;
    }
    
    .form-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .features-list {
        gap: 1rem;
    }
    
    .feature-item {
        font-size: 0.95rem;
    }
}

/* =============================================
   ESTADOS ESPECIALES
   ============================================= */
.input-group.error {
    border-color: #dc3545 !important;
}

.input-group.error:focus-within {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15) !important;
}

.btn-login.loading {
    position: relative;
    color: transparent;
    cursor: wait;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: loginSpin 1s ease-in-out infinite;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* Notificaciones */
.login-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
}

.login-notification.show {
    transform: translateX(0);
}

.login-notification.error {
    border-left: 4px solid #dc3545;
}

.login-notification.success {
    border-left: 4px solid #28a745;
}

.login-notification i {
    font-size: 1.2rem;
}

.login-notification.error i {
    color: #dc3545;
}

.login-notification.success i {
    color: #28a745;
}

.login-notification span {
    font-weight: 500;
    color: var(--login-text-dark);
}

/* =============================================
   ACCESIBILIDAD
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .btn-login,
    .input-group,
    .form-check {
        animation: none;
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #000;
    }
    
    .input-group {
        border: 2px solid #000;
    }
    
    .btn-login {
        border: 2px solid #000;
    }
}

/* Focus visible para accesibilidad */
.form-control:focus-visible,
.btn-eye:focus-visible,
.btn-login:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .login-container {
        background: white !important;
    }
    
    .login-card {
        box-shadow: none !important;
        border: 1px solid #000;
    }
    
    .btn-login,
    .btn-eye {
        display: none !important;
    }
}