/* ============================================ */
/* PALETA DE COLORES BASADA EN EL LOGO CONNEX */
/* ============================================ */
:root {
    --connex-dark: #1a2b3c;
    --connex-primary: #1e4a6b;
    --connex-secondary: #2c6e8f;
    --connex-accent: #3d8faa;
    --connex-light: #f0f4f8;
    --connex-white: #ffffff;
    --connex-gray: #5a6e7c;
    --connex-success: #2c8c6e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e8f0f8 0%, #d4e4f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
}

/* ============================================ */
/* CONTENEDOR PRINCIPAL */
/* ============================================ */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.login-card {
    background: var(--connex-white);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-3px);
}

/* ============================================ */
/* LADO IZQUIERDO - MARCA */
/* ============================================ */
.brand-side {
    background: linear-gradient(145deg, #1a3a4f 0%, #0f2a3a 100%);
    padding: 40px 30px;
    height: 100%;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.brand-logo {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo img {
    max-width: 240px;
    width: 100%;
    height: auto;
    filter: brightness(1.05) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
}

/* Características */
.features-list {
    margin-top: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 18px;
    border-radius: 18px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.feature-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}

.feature-text p {
    font-size: 0.75rem;
    opacity: 0.75;
    margin: 0;
}

/* ============================================ */
/* LADO DERECHO - FORMULARIO */
/* ============================================ */
.form-side {
    padding: 45px 40px;
    background: var(--connex-white);
    position: relative;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: left;
    margin-bottom: 30px;
}

.form-header .logo-mobile {
    display: none;
}

.form-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--connex-dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-header p {
    color: var(--connex-gray);
    font-size: 0.85rem;
}

/* Inputs */
.input-group-custom {
    margin-bottom: 22px;
}

.input-group-custom label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--connex-dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--connex-gray);
    font-size: 1rem;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 16px 13px 45px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    background: var(--connex-white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--connex-primary);
    box-shadow: 0 0 0 4px rgba(30, 74, 107, 0.1);
}

.input-wrapper input:focus + .input-icon {
    color: var(--connex-primary);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--connex-gray);
    cursor: pointer;
    z-index: 2;
    font-size: 1rem;
}

.password-toggle:hover {
    color: var(--connex-primary);
}

/* Checkbox */
.checkbox-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--connex-primary);
}

.checkbox-label span {
    font-size: 0.8rem;
    color: var(--connex-dark);
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--connex-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--connex-accent);
    text-decoration: underline;
}

/* Botón */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(105deg, var(--connex-primary) 0%, var(--connex-secondary) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 74, 107, 0.25);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 74, 107, 0.35);
}

/* Alertas */
.alert-custom {
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger-custom {
    background: #fee9e6;
    color: #c2410c;
    border-left: 4px solid #c2410c;
}

.alert-success-custom {
    background: #e0f2e9;
    color: #2c8c6e;
    border-left: 4px solid #2c8c6e;
}

.alert-info-custom {
    background: #e6f3f8;
    color: var(--connex-primary);
    border-left: 4px solid var(--connex-primary);
}

/* ============================================ */
/* OVERLAY DE BIENVENIDA */
/* ============================================ */
.welcome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--connex-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 0 28px 28px 0;
    animation: fadeIn 0.4s ease;
}

.welcome-content {
    text-align: center;
    padding: 20px;
    width: 90%;
    max-width: 320px;
    animation: scaleIn 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.welcome-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, var(--connex-success), var(--connex-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(30, 74, 107, 0.25);
}

.welcome-icon i {
    font-size: 2.2rem;
    color: white;
}

.welcome-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--connex-dark);
    margin-bottom: 8px;
}

.welcome-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--connex-primary);
    margin-bottom: 20px;
    word-break: break-word;
    padding: 0 10px;
}

.spinner-custom {
    width: 35px;
    height: 35px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--connex-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

.redirect-text {
    margin-top: 15px;
    color: var(--connex-gray);
    font-size: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-header.hide-header {
    display: none;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 992px) {
    .brand-side {
        display: none;
    }
    
    .form-side {
        padding: 35px 25px;
        min-height: auto;
        border-radius: 28px;
    }
    
    .form-header .logo-mobile {
        display: block;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .form-header .logo-mobile img {
        max-height: 50px;
        width: auto;
    }
    
    .form-header h2,
    .form-header p {
        text-align: center;
    }
    
    .form-header h2 {
        font-size: 1.6rem;
    }
    
    .welcome-overlay {
        border-radius: 28px;
    }
    
    .welcome-content {
        padding: 15px;
        max-width: 280px;
    }
    
    .welcome-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .welcome-icon i {
        font-size: 1.8rem;
    }
    
    .welcome-content h2 {
        font-size: 1.3rem;
    }
    
    .welcome-name {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .spinner-custom {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .form-side {
        position: relative;
        overflow: hidden;
        min-height: 500px;
    }
    
    .welcome-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: white !important;
        border-radius: 28px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .welcome-content {
        width: 85%;
        max-width: 280px;
        margin: 0 auto;
        padding: 20px 15px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 12px;
    }
    
    .form-side {
        padding: 28px 20px;
    }
    
    .form-header h2 {
        font-size: 1.4rem;
    }
    
    .form-header p {
        font-size: 0.8rem;
    }
    
    .input-group-custom label {
        font-size: 0.8rem;
    }
    
    .input-wrapper input {
        padding: 11px 14px 11px 40px;
        font-size: 0.85rem;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .checkbox-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .welcome-content {
        width: 90%;
        max-width: 260px;
        padding: 15px 12px;
    }
    
    .welcome-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 12px;
    }
    
    .welcome-icon i {
        font-size: 1.6rem;
    }
    
    .welcome-content h2 {
        font-size: 1.2rem;
    }
    
    .welcome-name {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .spinner-custom {
        width: 28px;
        height: 28px;
        border-width: 2.5px;
    }
    
    .redirect-text {
        font-size: 0.7rem;
        margin-top: 12px;
    }
}

@media (max-width: 380px) {
    .form-side {
        padding: 22px 16px;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .welcome-content {
        max-width: 240px;
    }
    
    .welcome-icon {
        width: 50px;
        height: 50px;
    }
    
    .welcome-icon i {
        font-size: 1.4rem;
    }
    
    .welcome-content h2 {
        font-size: 1.1rem;
    }
    
    .welcome-name {
        font-size: 0.85rem;
    }
}