/* ==========================================================================
   PRESTAPLUS PRO - ESTILOS EXCLUSIVOS DEL LOGIN (SPLIT SCREEN 42/58)
   Fiel a la referencia corporativa (Azul / Celeste / Blanco)
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.login-page-body {
    overflow-x: hidden;
    background: #ffffff !important;
}

body::before {
    display: none !important;
    content: none !important;
}

/* ===== CONTENEDOR PRINCIPAL SPLIT SCREEN (100% ALTO VISIBLE) ===== */
.login-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ==========================================================================
   PANEL IZQUIERDO: FORMULARIO (~42% DEL ANCHO)
   ========================================================================== */
.login-panel-left {
    flex: 0 0 42% !important;
    width: 42% !important;
    max-width: 42% !important;
    height: 100% !important;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 60px;
    box-shadow: 12px 0 35px rgba(15, 23, 42, 0.05);
    z-index: 10;
    overflow-y: auto;
}

.login-card-inner {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: auto 0;
}

/* Logotipo PrestaPlus PRO */
.login-brand-logo {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.login-logo-img {
    height: 52px;
    max-height: 56px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
}

/* Encabezados del Formulario */
.login-header-group {
    margin-bottom: 26px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f2b5c;
    margin: 0 0 8px 0;
    line-height: 1.25;
    letter-spacing: -0.4px;
}

.login-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

/* Contenedor Flipbox */
.login-box {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 390px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    perspective: 1000px !important;
    animation: none !important;
    transition: min-height 0.4s ease !important;
}

.login-content .login-box .login-form,
.login-content .login-box .forget-form {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    padding: 0 !important;
    background: transparent !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease !important;
}

.login-content .login-box .login-form {
    transform: rotateY(0deg) !important;
    opacity: 1 !important;
    z-index: 2 !important;
    pointer-events: auto !important;
}

.login-content .login-box .forget-form {
    transform: rotateY(180deg) !important;
    opacity: 0 !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

.login-content .login-box.flipped .login-form {
    transform: rotateY(-180deg) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.login-content .login-box.flipped .forget-form {
    transform: rotateY(0deg) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 2 !important;
}

/* Campos de entrada */
.login-form-group {
    margin-bottom: 20px;
}

.login-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #334155 !important;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.25s ease, transform 0.25s ease;
    z-index: 3;
}

.login-input {
    width: 100%;
    height: 50px;
    padding: 10px 16px 10px 48px !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14.5px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    transition: all 0.25s ease !important;
    box-shadow: none !important;
}

.login-input::placeholder {
    color: #94a3b8 !important;
    font-size: 14px;
}

.login-input:hover {
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
}

.login-input:focus {
    background-color: #ffffff !important;
    border-color: #0070ba !important;
    box-shadow: 0 0 0 4px rgba(0, 112, 186, 0.12) !important;
    outline: none !important;
}

.login-input-icon-wrap:focus-within .login-icon {
    color: #0070ba;
    transform: scale(1.1);
}

/* Fila Checkbox + Enlace */
.login-utility-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.login-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: #475569;
    margin: 0;
    user-select: none;
}

.login-checkbox-label input[type="checkbox"] {
    accent-color: #0070ba;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.login-checkbox-text {
    font-weight: 500;
}

.login-link-forgot,
.login-link-back {
    font-size: 13.5px;
    font-weight: 600;
    color: #0070ba !important;
    text-decoration: none !important;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.login-link-forgot:hover,
.login-link-back:hover {
    color: #005288 !important;
    text-decoration: underline !important;
}

/* Botón Iniciar Sesión */
.login-btn-container {
    margin-top: 12px;
    margin-bottom: 0;
}

.login-btn-submit {
    height: 50px;
    background: linear-gradient(135deg, #0070ba 0%, #005699 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.6px !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 112, 186, 0.35) !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    cursor: pointer !important;
}

.login-btn-submit:hover {
    background: linear-gradient(135deg, #007ecf 0%, #0060aa 100%) !important;
    box-shadow: 0 6px 18px rgba(0, 112, 186, 0.45) !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.login-btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 112, 186, 0.3) !important;
}

.login-btn-icon {
    font-size: 16px;
}

/* Alertas */
#alertLogin {
    font-size: 13.5px;
    font-weight: 500;
    color: #dc2626 !important;
    margin-top: 8px;
    margin-bottom: 8px;
    min-height: 18px;
}

/* Pie de página discreto */
.login-footer {
    margin-top: 36px;
    text-align: center;
}

.login-footer p {
    font-size: 12.5px;
    color: #94a3b8;
    margin: 0;
}

/* ==========================================================================
   PANEL DERECHO: FOTOGRAFÍA CORPORATIVA REAL (~58% DEL ANCHO)
   ========================================================================== */
.login-panel-right {
    flex: 0 0 58% !important;
    width: 58% !important;
    max-width: 58% !important;
    height: 100% !important;
    position: relative;
    background-image: 
        linear-gradient(135deg, rgba(8, 28, 68, 0.74) 0%, rgba(13, 49, 108, 0.68) 50%, rgba(4, 18, 48, 0.78) 100%),
        url("../images/login_bg_corporate.jpg");
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 80px;
    color: #ffffff;
    overflow: hidden;
}

.login-right-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
}

/* Título principal en blanco */
.login-right-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Línea decorativa celeste */
.login-accent-bar {
    width: 68px;
    height: 4px;
    background-color: #38bdf8; /* Celeste */
    border-radius: 2px;
    margin-bottom: 22px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

/* Texto secundario */
.login-right-desc {
    font-size: 17px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.94);
    margin: 0;
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   LOADING MODAL
   ========================================================================== */
#divLoading {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 99999 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
}

#divLoading > div {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

#divLoading img {
    width: 52px;
    height: 52px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (PC, TABLET, CELULAR)
   ========================================================================== */

/* Tablet & Pantallas medianas (768px a 1024px) */
@media (max-width: 1024px) {
    .login-panel-left {
        flex: 0 0 46% !important;
        width: 46% !important;
        max-width: 46% !important;
        padding: 35px 30px;
    }

    .login-panel-right {
        flex: 0 0 54% !important;
        width: 54% !important;
        max-width: 54% !important;
        padding: 45px 40px;
    }

    .login-right-title {
        font-size: 32px;
    }

    .login-right-desc {
        font-size: 15px;
    }
}

/* Celular (< 768px): Formulario arriba y fotografía corporativa debajo */
@media (max-width: 767.98px) {
    .login-content {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
    }

    .login-panel-left {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto;
        padding: 40px 24px 30px 24px;
        box-shadow: none;
        justify-content: center;
    }

    .login-card-inner {
        max-width: 100%;
    }

    .login-brand-logo {
        justify-content: center;
        margin-bottom: 24px;
    }

    .login-header-group {
        text-align: center;
        margin-bottom: 24px;
    }

    .login-title {
        font-size: 26px;
    }

    /* Panel fotográfico corporativo debajo */
    .login-panel-right {
        display: flex !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 320px !important;
        padding: 50px 24px;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .login-right-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .login-right-title {
        font-size: 28px;
    }

    .login-accent-bar {
        margin: 0 auto 20px auto;
    }

    .login-right-desc {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .login-utility-row {
        flex-direction: row;
        justify-content: space-between;
    }
}
