/* =============================================================================
 * MEDInteraction360 — Login con la composición del login de Tigo
 * -----------------------------------------------------------------------------
 * Copia la estructura del login de Tigo (src/components/auth-form.tsx,
 * src/app/login.css y los bloques LOGIN / LOGIN v2 de estilo-app.css):
 * composición oscura y metalizada en dos columnas, panel de imagen/marca a la
 * izquierda (estado, titular con texto metalizado, chips, flujo animado,
 * marquesina en contorno) y, a la derecha, el formulario en vidrio oscuro con
 * borde metálico que brilla, campos con etiqueta flotante, sello metálico y
 * botón con destello.
 *
 * Colores: los de MEDInteraction360, no los de Tigo. Navy #001260 (y sus
 * sombras hacia el negro para el fondo oscuro), teal #00a290, teal oscuro
 * #008a7a, cian #00a2c0, menta #e7f7f4 / #d3f1eb / #7fd8c9.
 *
 * Solo presentación: el formulario, los name/id, el action, el JS de login,
 * el cambio Gestor ↔ OCP (#chk), el desbloqueo y el acceso demo son los de
 * siempre. Reemplaza el bloque «3. LOGIN» que tenía metalizado.css.
 * Se activa con <body class="mlg-body"> en index.php.
 * ========================================================================== */

body.mlg-body {
    --mlg-teal: #00a290;
    --mlg-teal-dk: #008a7a;
    --mlg-cyan: #00a2c0;
    --mlg-navy: #001260;
    --mlg-mint: #d3f1eb;
    --mlg-mint-2: #7fd8c9;
    /* Banda metálica (la --lg-metal de Tigo en teal / cian del proyecto) */
    --mlg-metal: linear-gradient(135deg, #001260 0%, #008a7a 35%, #00a2c0 50%, #008a7a 65%, #001260 100%);
    --mlg-texto: #e8f1f8;
    --mlg-tenue: #8fa3bd;
    --mlg-panel-h: var(--login-panel-h, 440px);

    margin: 0;
    padding: 0;
    display: block;
    min-height: 100vh;
    font-family: 'Manrope', system-ui, sans-serif;
    color: var(--mlg-texto);
    background: #020820;
}

/* ── Composición: panel de marca + lado del formulario ─────────────────── */
.mlg {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

@media (max-width: 960px) {
    .mlg {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Panel de marca: imagen del sitio bajo acero navy, red de nodos y ECG ── */
.mlg-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    padding: 40px 46px 34px;
    color: #ffffff;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, .05) 42%, rgba(255, 255, 255, 0) 58%),
        radial-gradient(520px 380px at 0 0, rgba(0, 162, 192, .28), rgba(0, 162, 192, 0) 70%),
        radial-gradient(560px 420px at 100% 100%, rgba(0, 162, 144, .26), rgba(0, 162, 144, 0) 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%237fd8c9' stroke-opacity='.14' stroke-width='1'%3E%3Cpath d='M20 30L70 55L120 25M70 55L60 110L120 95L140 140M60 110L25 140M120 95L120 25M20 30L25 140'/%3E%3C/g%3E%3Cg fill='%2300a2c0' fill-opacity='.45'%3E%3Ccircle cx='20' cy='30' r='2.2'/%3E%3Ccircle cx='70' cy='55' r='2.6'/%3E%3Ccircle cx='120' cy='25' r='2'/%3E%3Ccircle cx='60' cy='110' r='2.4'/%3E%3Ccircle cx='140' cy='140' r='1.8'/%3E%3Ccircle cx='25' cy='140' r='2'/%3E%3C/g%3E%3Ccircle cx='120' cy='95' r='2.4' fill='%2300a290' fill-opacity='.6'/%3E%3C/svg%3E") 0 0 / 160px 160px,
        linear-gradient(160deg, rgba(0, 18, 96, .9) 0%, rgba(1, 12, 62, .94) 45%, rgba(2, 8, 32, .97) 100%),
        url("../../images/FONDO-ASELL.jpg") center / cover no-repeat,
        #020820;
}

/* Línea de pulso (ECG) grande y tenue, abajo a la derecha */
.mlg-hero::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: 70px;
    width: 460px;
    height: 200px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='120' viewBox='0 0 256 120'%3E%3Cpath d='M0 72H70l7-12 7 12h12l8-48 10 82 8-50 6 16h22l6-9 7 9H256' fill='none' stroke='%2300a2c0' stroke-opacity='.22' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='114' cy='106' r='3' fill='%2300a290' fill-opacity='.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mlg-hero > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 960px) {
    .mlg-hero {
        gap: 18px;
        padding: 24px 20px 22px;
    }

    .mlg-hero .mlg-oculto-movil {
        display: none;
    }
}

/* Nodos que laten (la «IA trabajando») */
.mlg-nodo {
    position: absolute;
    z-index: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mlg-cyan);
    box-shadow: 0 0 0 0 rgba(0, 162, 192, .6);
    animation: mlg-pulso 2.8s ease-out infinite;
}

.mlg-nodo.is-teal {
    background: var(--mlg-teal);
    animation-delay: 1.2s;
}

@keyframes mlg-pulso {
    0% { box-shadow: 0 0 0 0 rgba(0, 162, 192, .6); transform: scale(1); }
    60% { box-shadow: 0 0 0 14px rgba(0, 162, 192, 0); transform: scale(1.15); }
    100% { box-shadow: 0 0 0 0 rgba(0, 162, 192, 0); transform: scale(1); }
}

/* Marca + estado */
.mlg-marca {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mlg-marca-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mlg-marca-icono {
    position: relative;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    font-size: 21px;
    color: #ffffff;
    background: var(--mlg-metal);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 15px;
    box-shadow: 0 10px 24px -8px rgba(0, 162, 192, .7), inset 0 1px rgba(255, 255, 255, .35);
}

.mlg-marca-icono::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, .25) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, 0) 66%);
}

.mlg-marca-nombre b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: #ffffff;
}

.mlg-marca-nombre b span {
    color: var(--mlg-mint-2);
}

.mlg-marca-nombre small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mlg-mint-2);
}

.mlg-estado {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--mlg-mint);
    background: rgba(0, 162, 144, .1);
    border: 1px solid rgba(0, 162, 144, .45);
    border-radius: 999px;
}

.mlg-estado i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mlg-teal);
    animation: mlg-latido 2s infinite;
}

@keyframes mlg-latido {
    0% { box-shadow: 0 0 0 0 rgba(0, 162, 144, .7); }
    70% { box-shadow: 0 0 0 7px rgba(0, 162, 144, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 162, 144, 0); }
}

/* Titular con texto metalizado */
.mlg-titulo {
    max-width: 540px;
    margin: 0;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
    color: #ffffff;
}

.mlg-metal {
    color: transparent;
    background: linear-gradient(100deg, #ffffff 0%, #d3f1eb 28%, #ffffff 46%, #7fd8c9 62%, #00a2c0 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: mlg-brillo 6s linear infinite;
}

@keyframes mlg-brillo {
    to { background-position: -200% 0; }
}

.mlg-sub {
    max-width: 480px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: #b6c6d8;
}

.mlg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.mlg-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
    color: #e2edf5;
    background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02));
    border: 1px solid rgba(127, 216, 201, .25);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.mlg-chip i {
    color: var(--mlg-mint-2);
}

/* Flujo del paciente en la plataforma (el «flujo» del login de Tigo) */
.mlg-flujo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 460px;
    margin-top: 26px;
}

.mlg-paso {
    display: flex;
    width: 76px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
    color: #cfe3ee;
}

.mlg-paso span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 162, 192, .25), rgba(0, 18, 96, .55));
    border: 1px solid rgba(0, 162, 192, .45);
    border-radius: 11px;
    box-shadow: 0 6px 14px -8px rgba(0, 162, 192, .7);
}

.mlg-tramo {
    position: relative;
    flex: 1;
    height: 2px;
    margin-top: 18px;
    background: repeating-linear-gradient(90deg, rgba(0, 162, 192, .45) 0 6px, transparent 6px 11px);
}

.mlg-tramo::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mlg-cyan);
    box-shadow: 0 0 10px var(--mlg-cyan);
    animation: mlg-viaja 2.4s linear infinite;
}

.mlg-tramo:nth-of-type(4)::after { animation-delay: .8s; }
.mlg-tramo:nth-of-type(6)::after { animation-delay: 1.6s; }

@keyframes mlg-viaja {
    0% { left: 0; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { left: calc(100% - 8px); opacity: 0; }
}

/* Texto gigante en contorno que se desplaza (decorativo) */
.mlg-marquesina {
    position: absolute !important;
    bottom: 34px;
    left: 0;
    z-index: 0 !important;
    display: flex;
    white-space: nowrap;
    pointer-events: none;
    animation: mlg-desliza 40s linear infinite;
}

.mlg-marquesina span {
    padding-right: 48px;
    font-size: clamp(56px, 7vw, 104px);
    font-weight: 800;
    letter-spacing: .04em;
    color: transparent;
    -webkit-text-stroke: 1.4px rgba(0, 162, 192, .2);
}

@keyframes mlg-desliza {
    to { transform: translateX(-50%); }
}

.mlg-pie {
    margin: 0;
    font-size: 11px;
    letter-spacing: .06em;
    color: #7d92ad;
}

.mlg-pie b {
    color: var(--mlg-mint-2);
}

/* ── Lado del formulario: acero oscuro con retícula ────────────────────── */
.mlg-lado {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    overflow: hidden;
    padding: 32px 20px;
    background:
        radial-gradient(520px 360px at 85% 10%, rgba(0, 162, 192, .16), rgba(0, 162, 192, 0) 70%),
        radial-gradient(480px 360px at 10% 95%, rgba(0, 162, 144, .2), rgba(0, 162, 144, 0) 70%),
        linear-gradient(115deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .025) 55%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(200deg, #0b1838 0%, #07112a 55%, #040a1c 100%);
    border-left: 1px solid rgba(127, 216, 201, .12);
}

/* Retícula fina detrás de la tarjeta («circuito») */
.mlg-lado::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(127, 216, 201, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 216, 201, .05) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
    mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
    pointer-events: none;
}

.mlg-lado > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 960px) {
    .mlg-lado {
        border-left: 0;
        border-top: 1px solid rgba(127, 216, 201, .12);
        padding: 24px 14px 28px;
    }
}

/* ── Tarjeta de vidrio oscuro con borde metálico que brilla (.main) ────── */
body.mlg-body .main {
    position: relative;
    max-width: 410px;
    overflow: hidden;
    color: var(--mlg-texto);
    background: linear-gradient(160deg, rgba(22, 36, 70, .86), rgba(8, 16, 38, .92));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 22px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), inset 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(0, 0, 0, .25);
}

body.mlg-body .main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 30;
    padding: 1.5px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(232, 241, 248, .5), rgba(127, 216, 201, .25) 30%, rgba(255, 255, 255, .6) 50%, rgba(0, 162, 192, .7) 75%, #001260);
    background-size: 220% 220%;
    animation: mlg-borde 8s ease-in-out infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes mlg-borde {
    50% { background-position: 100% 100%; }
}

/* Las dos caras (Gestor / OCP): opacas para que la de OCP tape al deslizar */
body.mlg-body .signup {
    background: linear-gradient(160deg, #16244a 0%, #0b1633 100%);
}

body.mlg-body .login {
    background:
        radial-gradient(260px 120px at 100% 0, rgba(0, 162, 192, .14), rgba(0, 162, 192, 0) 70%),
        linear-gradient(160deg, #13203f 0%, #091229 100%);
}

/* El robot se queda en su sitio (lo usa el JS), pero el sello metálico ocupa su lugar */
body.mlg-body .robot-wrap {
    display: none;
}

/* Sello metálico (panel-icon) */
body.mlg-body .panel-icon {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    overflow: hidden;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;
    box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .7), inset 0 1px rgba(255, 255, 255, .35), 0 0 0 4px rgba(0, 162, 192, .12);
}

body.mlg-body .panel-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, 0) 66%);
    pointer-events: none;
}

body.mlg-body .panel-icon-gestor {
    background: var(--mlg-metal);
}

/* OCP: placa plateada (acero claro), como el sello del login v2 de Tigo */
body.mlg-body .panel-icon-ocp {
    color: var(--mlg-navy);
    background: linear-gradient(135deg, #e8f1f8 0%, #9fb3c8 45%, #ffffff 60%, #6f86a3 100%);
}

body.mlg-body .panel-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #f4f9fc;
}

body.mlg-body .panel-subtitle {
    color: var(--mlg-tenue);
}

/* ── Campos ─────────────────────────────────────────────────────────────── */
body.mlg-body .field-group label {
    color: var(--mlg-tenue);
}

body.mlg-body .login-form input[type="text"],
body.mlg-body .login-form input[type="password"] {
    height: 50px;
    padding: 0 14px 0 44px;
    font-size: 14.5px;
    font-weight: 500;
    color: #f4f9fc;
    background: rgba(4, 10, 28, .7);
    border: 1px solid rgba(143, 163, 189, .25);
    border-radius: 14px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
    caret-color: var(--mlg-cyan);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

body.mlg-body .login-form input[type="text"]::placeholder,
body.mlg-body .login-form input[type="password"]::placeholder {
    color: #6f84a0;
}

body.mlg-body .login-form input:hover {
    border-color: rgba(143, 163, 189, .45);
}

body.mlg-body .login-form input:focus {
    background: rgba(4, 10, 28, .9);
    border-color: var(--mlg-cyan);
    box-shadow: 0 0 0 4px rgba(0, 162, 192, .18), 0 0 24px -6px rgba(0, 162, 192, .55);
}

body.mlg-body .login-form input[readonly],
body.mlg-body .main.has-prefill-user #usuario {
    color: #b6c6d8;
    background: rgba(143, 163, 189, .1);
    cursor: not-allowed;
}

body.mlg-body .login-form input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px #050c1f inset;
    -webkit-text-fill-color: #f4f9fc;
}

body.mlg-body .input-wrap i {
    left: 15px;
    color: #6f84a0;
    transition: color .2s, filter .2s;
}

body.mlg-body .input-wrap:focus-within i {
    color: var(--mlg-cyan);
    filter: drop-shadow(0 0 6px rgba(0, 162, 192, .6));
}

/* Etiqueta flotante: vive dentro del campo y sube al escribir o enfocar */
body.mlg-body .input-wrap.mlg-flota input[type="text"],
body.mlg-body .input-wrap.mlg-flota input[type="password"] {
    height: 54px;
    padding: 20px 14px 6px 44px;
}

body.mlg-body .input-wrap.mlg-flota input::placeholder {
    color: transparent;
}

body.mlg-body .input-wrap.mlg-flota label {
    position: absolute;
    top: 50%;
    left: 44px;
    z-index: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #8fa3bd;
    transform: translateY(-50%);
    pointer-events: none;
    transition: top .18s, font-size .18s, color .18s, letter-spacing .18s;
}

body.mlg-body .input-wrap.mlg-flota input:focus ~ label,
body.mlg-body .input-wrap.mlg-flota input:not(:placeholder-shown) ~ label,
body.mlg-body .input-wrap.mlg-flota input:-webkit-autofill ~ label {
    top: 15px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mlg-cyan);
}

body.mlg-body .field-group {
    margin-bottom: 12px;
}

/* ── Botón principal con banda metálica y destello ─────────────────────── */
body.mlg-body .btn-ingresar {
    position: relative;
    height: 50px;
    margin-top: 8px;
    overflow: hidden;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--mlg-metal);
    background-size: 140% 100%;
    background-position: 50% 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 14px;
    box-shadow: 0 16px 34px -14px rgba(0, 162, 192, .7), inset 0 1px rgba(255, 255, 255, .3);
    transition: background-position .5s, transform .18s, box-shadow .18s, filter .18s;
}

body.mlg-body .btn-ingresar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    animation: mlg-destello 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mlg-destello {
    0%, 55% { left: -60%; }
    100% { left: 130%; }
}

body.mlg-body .btn-ingresar:hover {
    background-position: 0 0;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 20px 40px -14px rgba(0, 162, 192, .85), inset 0 1px rgba(255, 255, 255, .3);
}

/* OCP: la misma banda, del lado navy */
body.mlg-body .btn-ingresar-ocp {
    background: linear-gradient(135deg, #00a2c0 0%, #001260 55%, #020820 100%);
    background-size: 140% 100%;
    box-shadow: 0 16px 34px -14px rgba(0, 18, 96, .9), inset 0 1px rgba(255, 255, 255, .25);
}

body.mlg-body .btn-ingresar-ocp:hover {
    box-shadow: 0 20px 40px -14px rgba(0, 162, 192, .6), inset 0 1px rgba(255, 255, 255, .25);
}

/* Botones secundarios (desbloqueo / tipo de autenticación): placa de vidrio */
body.mlg-body .btn-alt {
    color: #e2edf5;
    background: linear-gradient(135deg, rgba(30, 48, 88, .9), rgba(12, 22, 48, .9));
    border: 1px solid rgba(143, 163, 189, .25);
    border-radius: 12px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .06);
    transition: border-color .15s, background .15s, color .15s;
}

body.mlg-body .btn-alt:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 138, 122, .35), rgba(12, 22, 48, .9));
    border-color: var(--mlg-cyan);
}

body.mlg-body .btn-alt i {
    color: var(--mlg-mint-2);
}

body.mlg-body .unlock-label,
body.mlg-body .auth-options-label {
    color: var(--mlg-tenue);
}

/* Aviso de error sobre fondo oscuro */
body.mlg-body .login-alert {
    color: #fecaca;
    background: rgba(127, 29, 29, .4);
    border: 1px solid rgba(248, 113, 113, .3);
    border-radius: 12px;
}

/* Cambio Gestor ↔ OCP: franja de acero abajo */
body.mlg-body .access-switch {
    color: var(--mlg-mint);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
    border-top: 1px solid rgba(127, 216, 201, .15);
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

body.mlg-body .access-switch:hover {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 162, 144, .2), rgba(0, 162, 144, .06));
}

body.mlg-body .login .access-switch {
    color: var(--mlg-mint);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}

body.mlg-body .login .access-switch:hover {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 162, 192, .2), rgba(0, 162, 192, .06));
}

body.mlg-body #faceCaptureBox {
    border-radius: 22px;
}

/* ── Acceso demo / TV (temporal): mismo vidrio, borde punteado menta ────── */
body.mlg-body .demo-card {
    max-width: 410px;
    color: var(--mlg-texto);
    background: linear-gradient(160deg, rgba(22, 36, 70, .7), rgba(8, 16, 38, .8));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px dashed rgba(127, 216, 201, .35);
    border-radius: 18px;
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8);
}

body.mlg-body .demo-fast-label {
    color: var(--mlg-tenue);
}

body.mlg-body .demo-fast-btn {
    color: #e2edf5;
    background: linear-gradient(135deg, rgba(30, 48, 88, .9), rgba(12, 22, 48, .9));
    border: 1px solid rgba(143, 163, 189, .25);
    border-radius: 10px;
    transition: border-color .15s, color .15s;
}

body.mlg-body .demo-fast-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 138, 122, .35), rgba(12, 22, 48, .9));
    border-color: var(--mlg-cyan);
}

body.mlg-body .demo-fast-btn i,
body.mlg-body .demo-tv-link i {
    color: var(--mlg-mint-2);
}

body.mlg-body .demo-tv-link {
    color: #e2edf5;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(143, 163, 189, .2);
    border-radius: 12px;
    transition: border-color .15s, background .15s, color .15s;
}

body.mlg-body .demo-tv-link:hover {
    color: #ffffff;
    background: rgba(0, 162, 144, .14);
    border-color: var(--mlg-teal);
}

@media (max-width: 480px) {
    body.mlg-body .main,
    body.mlg-body .demo-card {
        max-width: 100%;
    }

    body.mlg-body .login-form input[type="text"],
    body.mlg-body .login-form input[type="password"] {
        font-size: 16px; /* evita zoom automático en iOS */
    }
}

@media (prefers-reduced-motion: reduce) {
    .mlg *,
    body.mlg-body .main::before,
    body.mlg-body .btn-ingresar::after {
        animation: none !important;
    }
}

/* =============================================================================
 * LOGIN 2026-10-20-c — jerarquía, foco, contraseña visible y celular
 * Selector Gestor / Gerencial OCP arriba (solo cambia #chk), ojo para ver la
 * contraseña, aviso de Bloq Mayús, foco visible, aviso de error legible y
 * estado «Ingresando…». En celular el panel de marca queda como cabecera.
 * ========================================================================== */

/* ── Selector del tipo de acceso ─────────────────────────────────────────── */
body.mlg-body .mlg-acceso {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 410px;
    padding: 4px;
    background: rgba(4, 10, 28, .6);
    border: 1px solid rgba(143, 163, 189, .22);
    border-radius: 16px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
}

body.mlg-body .mlg-acceso-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--mlg-tenue);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 12px;
    transition: background .2s, color .2s, box-shadow .2s;
}

body.mlg-body .mlg-acceso-op span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mlg-body .mlg-acceso-op:hover {
    color: #ffffff;
}

body.mlg-body .mlg-acceso-op.is-activo {
    color: #ffffff;
    background: var(--mlg-metal);
    background-size: 140% 100%;
    box-shadow: 0 8px 18px -10px rgba(0, 162, 192, .8), inset 0 1px rgba(255, 255, 255, .3);
}

body.mlg-body .mlg-acceso-op[data-mlg-acceso="ocp"].is-activo {
    background: linear-gradient(135deg, #00a2c0 0%, #001260 60%, #020820 100%);
}

/* ── Foco visible con teclado ────────────────────────────────────────────── */
body.mlg-body .mlg-acceso-op:focus-visible,
body.mlg-body .btn-ingresar:focus-visible,
body.mlg-body .btn-alt:focus-visible,
body.mlg-body .access-switch:focus-visible,
body.mlg-body .demo-fast-btn:focus-visible,
body.mlg-body .demo-tv-link:focus-visible,
body.mlg-body .mlg-ver-clave:focus-visible,
body.mlg-body .face-close:focus-visible {
    outline: 2px solid #7fd8c9;
    outline-offset: 2px;
}

body.mlg-body .access-switch:focus-visible {
    outline-offset: -3px;
}

/* ── Contraseña: botón para verla y aviso de Bloq Mayús ──────────────────── */
body.mlg-body .input-wrap.mlg-con-ojo input[type="password"],
body.mlg-body .input-wrap.mlg-con-ojo input[type="text"] {
    padding-right: 54px;
}

body.mlg-body .mlg-ver-clave {
    position: absolute;
    top: 50%;
    right: 7px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #8fa3bd;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 10px;
    transform: translateY(-50%);
    transition: color .15s, background .15s;
}

body.mlg-body .mlg-ver-clave:hover,
body.mlg-body .mlg-ver-clave[aria-pressed="true"] {
    color: var(--mlg-cyan);
    background: rgba(0, 162, 192, .1);
}

/* El ícono del botón no es el ícono del campo (ese va a la izquierda) */
body.mlg-body .input-wrap .mlg-ver-clave i {
    position: static;
    left: auto;
    top: auto;
    font-size: 15px;
    color: inherit;
    transform: none;
    filter: none;
    pointer-events: none;
}

body.mlg-body .field-group {
    position: relative;
}

/* Bloq Mayús: placa pequeña sobre el campo (no mueve el resto del panel) */
body.mlg-body .mlg-mayus {
    position: absolute;
    top: -9px;
    right: 10px;
    z-index: 3;
    margin: 0;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #1f1300;
    background: #fbbf24;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

body.mlg-body .mlg-mayus.is-visible {
    opacity: 1;
}

body.mlg-body .mlg-mayus:empty {
    padding: 0;
}

/* ── Aviso de error: más contraste y lectura cómoda ──────────────────────── */
body.mlg-body .login-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #fee2e2;
    background: rgba(127, 29, 29, .55);
    border-color: rgba(248, 113, 113, .5);
}

body.mlg-body .login-alert i {
    flex: 0 0 auto;
    margin: 2px 0 0;
    color: #fca5a5;
}

/* ── Botón principal ocupado ─────────────────────────────────────────────── */
body.mlg-body .btn-ingresar.is-busy,
body.mlg-body .btn-ingresar[aria-busy="true"] {
    cursor: progress;
    filter: saturate(.8);
}

body.mlg-body .btn-ingresar.is-busy::after,
body.mlg-body .btn-ingresar[aria-busy="true"]::after {
    animation: none;
    opacity: 0;
}

/* ── Franja «Acceso Gerencial OCP»: más evidente ─────────────────────────── */
body.mlg-body .access-switch {
    min-height: 54px;
    gap: 12px;
}

body.mlg-body .access-switch-txt {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}

body.mlg-body .access-switch-txt b {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

body.mlg-body .access-switch-txt small {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--mlg-tenue);
}

body.mlg-body .demo-fast-btn,
body.mlg-body .demo-tv-link {
    min-height: 40px;
}

/* ── Celular y tableta angosta: el panel de marca queda como cabecera ────── */
@media (max-width: 960px) {
    .mlg-hero {
        gap: 12px;
        padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 16px;
    }

    .mlg-hero::after,
    .mlg-nodo,
    .mlg-pie {
        display: none;
    }

    .mlg-marca-icono {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 12px;
    }

    .mlg-marca-nombre b {
        font-size: 17px;
    }

    .mlg-titulo {
        max-width: none;
        font-size: 20px;
        line-height: 1.2;
        text-wrap: balance;
    }

    .mlg-lado {
        justify-content: flex-start;
        padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 480px) {
    .mlg-titulo {
        display: none;
    }

    .mlg-estado {
        padding: 4px 10px;
        font-size: 11px;
    }

    body.mlg-body .mlg-acceso-op {
        gap: 6px;
        font-size: 13px;
    }

    body.mlg-body .mlg-acceso-op i {
        display: none;
    }

    body.mlg-body .login-form input[type="text"],
    body.mlg-body .login-form input[type="password"] {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mlg-body .mlg-acceso-op,
    body.mlg-body .mlg-ver-clave,
    body.mlg-body .mlg-mayus {
        transition: none;
    }
}

/* Corrección: las etiquetas flotantes del panel Gestor (z-index: 1) se veían a
   través de los campos del panel OCP al deslizarlo. El panel OCP va encima. */
body.mlg-body .login {
    z-index: 2;
}
