/* =============================================
   ESTILOS SUCURSAL VIRTUAL EMPRESAS
   Login con teclado virtual y formulario seguro
   ============================================= */

/* --- Layout de la página de login --- */
.pagina-empresas {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f8f8;
}

.pagina-empresas .encabezado-login {
    background-color: var(--color-blanco);
    border-bottom: 1px solid var(--color-borde);
    padding: 16px 0;
    box-shadow: var(--sombra-suave);
}

.encabezado-login .contenedor {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.encabezado-login__logo {
    height: 38px;
    width: auto;
}

.encabezado-login__info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.encabezado-login__texto {
    font-size: 0.85rem;
    color: var(--color-texto-claro);
}

.encabezado-login__seguridad {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--color-exito);
    font-weight: 600;
}

/* CSS de la nueva UI minimalista legacy */
.pagina-empresas {
    background: #ffffff;
    font-family: Arial, sans-serif;
}

.encabezado-login {
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
}

.encabezado-login__logo {
    height: 35px;
}

.login-contenido {
    width: 100%;
}

.legacy-login-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.legacy-breadcrumb {
    font-size: 16px;
    font-weight: bold;
    color: #444;
    margin-bottom: 30px;
}

.legacy-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
}

.legacy-col-izq {
    width: 450px;
}

.legacy-col-der {
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}

.legacy-campo {
    margin-bottom: 25px;
}

.legacy-campo label {
    display: block;
    font-size: 11px;
    color: #333;
    margin-bottom: 4px;
}

.legacy-campo input {
    width: 200px;
    max-width: 100%;
    padding: 3px 6px;
    border: 1px solid #999;
    font-size: 12px;
    height: 24px;
}

.legacy-campo-clave {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 10px;
}

.legacy-input-wrapper {
    display: flex;
    flex-direction: column;
}

.legacy-btn-aceptar {
    background-color: #FDDA24;
    border: 1px solid #c9a700;
    color: #000;
    font-weight: bold;
    font-size: 12px;
    padding: 3px 20px;
    height: 24px;
    cursor: pointer;
    margin-bottom: 1px;
}

.legacy-links-recuperacion {
    display: flex;
    gap: 15px;
    font-size: 10px;
    margin-bottom: 15px;
}

.legacy-links-recuperacion a,
.legacy-links-bottom a {
    color: #444;
    text-decoration: underline;
}

.legacy-teclado-wrapper {
    border: none;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.teclado-virtual__panel {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.teclado-virtual__letras {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.teclado-virtual__fila {
    display: flex;
    gap: 2px;
}

/* Tecla base - idéntica al teclado Bancolombia */
.tecla {
    min-width: 20px;
    height: 20px;
    background: #f5f5f5;
    border: 1px solid #999;
    border-bottom: 2px solid #777;
    font-size: 10px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    color: #222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 3px;
    border-radius: 2px;
    box-shadow: 0 1px 0 #bbb;
    line-height: 1;
    transition: background 0.07s;
    user-select: none;
    text-transform: uppercase;
}

.tecla:hover {
    background: #e8e8e8;
}

.tecla:active {
    background: #d0d0d0;
    border-bottom-width: 1px;
    transform: translateY(1px);
    box-shadow: none;
}

/* Teclas especiales más anchas */
.tecla--espaciadora {
    min-width: 36px;
}

.tecla--backspace {
    min-width: 26px;
    font-size: 12px;
}

.tecla--enter {
    min-width: 22px;
    font-size: 14px;
    height: 20px;
}

.tecla--blkMay {
    min-width: 38px;
    font-size: 9px;
}

.tecla--char {
    min-width: 22px;
}

/* Separador vertical entre letras y números */
.teclado-virtual__separador {
    width: 1px;
    background: #ccc;
    margin: 0 5px;
    align-self: stretch;
}

/* Bloque de números derecho */
.teclado-virtual__numeros-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.teclado-virtual__numeros {
    display: grid;
    grid-template-columns: repeat(3, 21px);
    gap: 2px;
    margin-bottom: 0;
}

.tecla--num {
    width: 21px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
}

.legacy-btn-limpiar {
    background: #f5f5f5;
    border: 1px solid #999;
    border-bottom: 2px solid #777;
    border-radius: 2px;
    height: 20px;
    font-size: 10px;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    grid-column: 1 / -1;
}

.legacy-contraste {
    margin-top: 12px;
    text-align: left;
    padding-left: 2px;
}

.legacy-contraste img {
    height: 32px;
}

.legacy-links-bottom {
    display: flex;
    gap: 20px;
    font-size: 10px;
    margin-top: 20px;
}

/* Derecha Banner Textos */
.retenedor-titulo {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.retenedor-texto {
    font-size: 11px;
    color: #444;
    line-height: 1.4;
    margin-bottom: 10px;
}

.retenedor-correo {
    font-size: 12px;
    font-weight: bold;
    color: #000;
    margin-bottom: 20px;
}

.retenedor-img {
    margin-top: 20px;
    max-width: 200px;
}

.retenedor-img-full {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
}

/* Banners (las 4 cajas de colores) */
.legacy-banners-bottom {
    display: flex;
    width: 100%;
    gap: 5px;
    margin-top: 10px;
}

.legacy-banner-item {
    flex: 1;
}

.legacy-banner-item img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: fill;
}

.banner-box {
    font-size: 12px;
    padding: 15px 10px;
    color: black;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.box-blue {
    background: #5bc0de;
}

.box-green {
    background: #5cb85c;
}

.box-pink {
    background: #fca5a5;
}

/* Footer */
.sucursal-footer {
    display: none;
    /* Hide old footer */
}

.legacy-footer-links {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    font-size: 10px;
    color: #666;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.legacy-footer-links a {
    color: #666;
    text-decoration: underline;
}

.legacy-footer-links span {
    margin-left: auto;
}

.alerta-formulario {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.alerta-formulario--error {
    background-color: #fee2e2;
    color: #dc3545;
    border: 1px solid #fca5a5;
}

.alerta-formulario--exito {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* --- Modales --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aparecer 0.2s ease;
}

.modal-contenido {
    background-color: var(--color-blanco);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: var(--sombra-fuerte);
    animation: escalar 0.3s ease;
}

@keyframes escalar {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--color-primario);
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
    margin: 0 auto 20px;
}

.modal-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-negro);
    margin-bottom: 8px;
}

.modal-descripcion {
    font-size: 0.875rem;
    color: var(--color-texto-claro);
    line-height: 1.5;
}

/* =============================================
   MODAL DE VALIDACIÓN BIOMÉTRICA (SELFIE)
   Diseño profesional - estilo portal personas
   ============================================= */

/* Overlay del modal biométrico */
.modal-biometrico-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: aparecer 0.2s ease;
}

/* Contenedor del modal inspirado en Portal Personas */
.login-card-biometrica {
    background: #fff;
    border-radius: 8px;
    padding: 50px 60px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    animation: escalar 0.25s ease;
}

.login-card-biometrica h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #1a1a1a;
}

.login-card-biometrica .subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

/* Container de Cámara como en Personas */
.camera-container {
    width: 100%;
    max-width: 400px;
    height: 300px;
    background: #000;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-overlay-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 240px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* Captura y Flash */
#imagen-captura-biometrico {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    z-index: 5;
}

.flash-captura {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
}

.flash-captura.activo {
    animation: flashear 0.3s ease;
}

@keyframes flashear {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 0.85;
    }

    100% {
        opacity: 0;
    }
}

/* Placeholder de Cámara */
.camara-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    z-index: 2;
}

/* Barra de progreso de análisis */
.barra-analisis-contenedor {
    margin: 20px auto;
    max-width: 400px;
}

.barra-analisis-etiqueta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.barra-analisis-riel {
    height: 6px;
    background: #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
}

.barra-analisis-progreso {
    height: 100%;
    background: var(--primary-yellow, #FDDA24);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Botones del Modal */
.modal-biometrico__acciones {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-biometrico-secundario,
.btn-biometrico-primario {
    flex: 1;
    padding: 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
}

.btn-biometrico-secundario {
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
}

.btn-biometrico-secundario:hover {
    background-color: #f5f5f5;
    color: #333;
}

.btn-biometrico-primario {
    background-color: #FDDA24;
    color: #000;
    box-shadow: 0 4px 15px rgba(253, 218, 36, 0.3);
}

.btn-biometrico-primario:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 218, 36, 0.4);
}

.btn-biometrico-primario:disabled {
    background-color: #E6E6E6;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Estado de éxito biométrico (spinner estilo Personas) */
.biometrico-exito {
    text-align: center;
    padding: 30px 0;
}

.spinner-container {
    padding: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-yellow, #FDDA24);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .login-card-biometrica {
        padding: 30px 20px;
        width: 95%;
    }

    .modal-biometrico__acciones {
        flex-direction: column-reverse;
    }
}


/* --- Responsive Empresas --- */
@media (max-width: 900px) {
    .login-panel {
        grid-template-columns: 1fr;
    }

    .teclado-virtual__panel {
        flex-direction: column;
    }

    .teclado-virtual__separador {
        display: none;
    }

    .teclado-virtual__numeros {
        width: fit-content;
        margin: 0 auto;
    }

    .sucursal-banner-inferior {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Layout login: columna única, ocultar banner lateral */
    .legacy-flex {
        flex-direction: column;
        gap: 0;
    }

    .legacy-col-izq {
        width: 100%;
    }

    .legacy-col-der {
        display: none;
    }

    /* Teclado escalado al 82% para caber en mobile */
    .legacy-teclado-wrapper {
        /* el panel mide aprox 370px de ancho en estado normal;
           al escalar a 0.82 = 303px que cabe en pantallas de 360+ */
        height: 138px;
        /* 168px * 0.82 aprox — ajustar si cambia el teclado */
    }

    .teclado-virtual__panel {
        flex-direction: row !important;
        /* mantener fila en mobile */
        transform-origin: top left;
        transform: scale(0.82);
    }

    /* Banners inferiores: 2 columnas */
    .legacy-banners-bottom {
        flex-wrap: wrap;
    }

    .legacy-banner-item {
        flex: 0 0 calc(50% - 3px);
    }

    /* Footer links en columna */
    .legacy-footer-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .legacy-footer-links span {
        margin-left: 0;
        width: 100%;
    }

    .encabezado-login__info {
        display: none;
    }
}

@media (max-width: 480px) {
    .legacy-login-container {
        padding: 20px 12px;
    }

    /* Teclado aún más pequeño en teléfonos muy chicos */
    .legacy-teclado-wrapper {
        height: 114px;
        /* 168px * 0.68 aprox */
    }

    .teclado-virtual__panel {
        transform: scale(0.68);
    }

    /* Campo clave: el botón aceptar en segunda línea si no cabe */
    .legacy-campo-clave {
        flex-wrap: wrap;
        gap: 8px;
    }

    .legacy-btn-aceptar {
        height: 28px;
        font-size: 13px;
        padding: 4px 16px;
    }

    .legacy-campo input {
        width: 100%;
        max-width: 220px;
    }

    /* Banners inferiores: 1 columna en muy pequeño */
    .legacy-banner-item {
        flex: 0 0 100%;
    }

    .sucursal-banner-inferior {
        grid-template-columns: 1fr;
    }
}