/* ==========================================================================
   LABSAG CLOUD - SPLIT SCREEN LOGIN (Personalizado con identidad original LABSAG)
   ========================================================================== */

:root {
    --brand-labsag-rgba: rgba(32, 117, 170, 0.85);
    --brand-blue: #0067CE;
    --brand-blue-hover: #004d99;
    --brand-btn: #008CBA;
    --brand-btn-hover: #006f94;
    --brand-orange: #F86F05;
    --text-white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-muted-light: rgba(255, 255, 255, 0.75);
    --radius-md: 6px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-white);
    background-color: #1a567a;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Layout Principal: Split Screen (2 Columnas)
   -------------------------------------------------------------------------- */
.split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Columna Izquierda: Background original back3.jpg + Logo superpuesto en el centro */
.split-left {
    flex: 1.15;
    background-image: url("../images/back3.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.split-left-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.left-logo-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    max-width: 520px;
    width: 100%;
    transition: transform 0.3s ease;
}

.left-logo-hero:hover {
    transform: scale(1.03);
}

.hero-logo-img {
    height: auto;
    max-height: 140px;
    width: 85%;
    max-width: 460px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.left-illustration-full {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Columna Derecha: Fondo rgba(32, 117, 170, 0.85) con todo alineado a la izquierda */
.split-right {
    flex: 0.85;
    background-color: var(--brand-labsag-rgba);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 48px;
    overflow-y: auto;
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Barra Superior (Aviso Reto + Language Picker Original Animado)
   -------------------------------------------------------------------------- */
.right-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    width: 100%;
    position: relative;
}

.pill-notice-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.pill-notice-light:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    transform: translateY(-1px);
}

.pill-notice-light i {
    color: #ffd074;
}

/* Desplegable de Idioma Animado Flotante (No empuja el formulario ni el contenido inferior) */
.languagepicker-wrapper {
    position: relative;
    width: 130px;
    height: 38px;
    z-index: 1000;
}

.languagepicker {
    position: absolute;
    top: 0;
    right: 0;
    width: 130px;
    background-color: #ffffff;
    display: block;
    padding: 0;
    height: 38px;
    overflow: hidden;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    float: none !important;
}

.languagepicker:hover, .langlarge:hover {
    height: 116px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.languagepicker a {
    color: #333333;
    text-decoration: none;
    display: block;
}

.languagepicker li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 38px;
    line-height: 38px;
    font-size: 13px;
    font-weight: 500;
    border-top: 1px solid #eeeeee;
    color: #333333;
    cursor: pointer;
    transition: background 0.15s ease;
}

.languagepicker li:hover {
    background-color: #f1f5f9;
    color: var(--brand-blue);
}

.languagepicker a:first-child li {
    border: none;
    background: #ffffff !important;
}

.languagepicker li img {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Contenedor Central del Formulario (Alineación a la izquierda)
   -------------------------------------------------------------------------- */
.form-center-wrapper {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 0;
    text-align: left;
}

/* Logo exclusivo para móvil */
.mobile-logo-row {
    display: none;
    margin-bottom: 16px;
}

.auth-logo-mobile {
    height: 52px;
    max-width: 240px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Título y Subtítulo alineados a la izquierda */
.auth-brand {
    margin-bottom: 24px;
    text-align: left;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.25;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 12px;
    text-align: left;
}

.auth-instruction {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
    margin-bottom: 18px;
    text-align: left;
}

/* --------------------------------------------------------------------------
   Selector de Roles (Pills Traslúcidas Blancas)
   -------------------------------------------------------------------------- */
.role-pills-container {
    display: flex;
    background: rgba(0, 0, 0, 0.22);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-pill {
    flex: 1;
    text-align: center;
    padding: 9px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.role-pill i {
    font-size: 13px;
}

.role-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.role-pill.active {
    background: #ffffff;
    color: #0f4c75;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Formularios y Campos de Entrada
   -------------------------------------------------------------------------- */
.panel-wrapper {
    display: none;
}

.panel-wrapper.active {
    display: block;
    animation: fadeInForm 0.2s ease-in-out;
}

@keyframes fadeInForm {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-block {
    margin-bottom: 18px;
    text-align: left;
}

.field-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 6px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    text-align: left;
}

.field-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input-box input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    font-size: 14.5px;
    font-family: inherit;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.field-input-box input:focus {
    background-color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.field-input-box .field-icon-right {
    position: absolute;
    right: 14px;
    color: #64748b;
    font-size: 15px;
    pointer-events: none;
}

.field-input-box .btn-toggle-pwd {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.field-input-box .btn-toggle-pwd:hover {
    color: #0f4c75;
}

/* --------------------------------------------------------------------------
   Botón Iniciar Sesión (Estilo LABSAG)
   -------------------------------------------------------------------------- */
.btn-submit-split {
    width: 100%;
    background-color: var(--brand-btn);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-submit-split:hover {
    background-color: var(--brand-btn-hover);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.btn-submit-split:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Footer Derecho
   -------------------------------------------------------------------------- */
.right-footer {
    text-align: left;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12.5px;
    color: var(--text-muted-light);
}

.right-footer a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Modal para el Reto
   -------------------------------------------------------------------------- */
.modal-split-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-split-backdrop.open {
    display: flex;
    animation: fadeInForm 0.2s ease-in-out;
}

.modal-split-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.modal-split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.modal-split-header h3 {
    font-size: 1.1rem;
    color: #0f4c75;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.btn-split-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-split-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-split-body {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.6;
}

.btn-split-action {
    display: inline-block;
    margin-top: 16px;
    background: var(--brand-btn);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
}

.btn-split-action:hover {
    background: var(--brand-btn-hover);
}

/* --------------------------------------------------------------------------
   Responsive Media Queries (Versión Móvil)
   - Esconder completamente la parte izquierda
   - Solo mostrar la parte derecha en todo el viewview
   - Mostrar el logo arriba del título y formulario
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .split-container {
        display: block;
        min-height: 100vh;
        width: 100%;
    }

    .split-left {
        display: none !important; /* Escondido completamente en móvil */
    }

    .split-right {
        width: 100%;
        min-height: 100vh;
        padding: 28px 20px;
        box-shadow: none;
    }

    .form-center-wrapper {
        max-width: 100%;
    }

    .mobile-logo-row {
        display: flex;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .split-right {
        padding: 20px 16px;
    }

    .role-pill {
        font-size: 12px;
        padding: 8px 2px;
    }

    .role-pill i {
        display: none;
    }
}

