/* Página de ingreso: tarjeta de vidrio sobre el rojo de la marca, con círculos que flotan y el logo como marca de agua. */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
.lg-body { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow-x: hidden; color: #fff;
    font-family: "DM Sans", system-ui, -apple-system, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased;
    background: radial-gradient(1200px 700px at 20% 10%, #c01f10 0, transparent 60%), radial-gradient(900px 600px at 90% 100%, #5c0a02 0, transparent 55%), linear-gradient(160deg, #a8170a, #6e0d04) #8f1208; }

/* Fondo fijo: no se mueve con el scroll y nada se corta. */
.lg-fondo { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.lg-orbe { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); animation: lg-aparece 1.2s ease .2s both, lg-flota 16s ease-in-out 1.4s infinite; }
.lg-o1 { width: 520px; height: 520px; left: -160px; bottom: -190px; }
.lg-o2 { width: 340px; height: 340px; right: -90px; top: -110px; animation-delay: .4s, 1.6s; }
.lg-o3 { width: 210px; height: 210px; right: 14%; bottom: 10%; background: rgba(255, 255, 255, .07); animation-delay: .6s, 1.8s; }
.lg-o4 { width: 150px; height: 150px; left: 12%; top: 12%; background: rgba(255, 200, 170, .08); animation-delay: .8s, 2s; }
.lg-marca { position: absolute; left: 50%; top: 50%; height: 94vh; height: 94dvh; transform: translate(-50%, -50%); opacity: .06; animation: lg-marca-entra 2.2s ease .2s both; }
.lg-marca .lg-revela { height: 100%; }

.lg-pila { position: relative; z-index: 1; display: grid; justify-items: center; gap: 24px; width: min(420px, 100%); }

/* El logo, en blanco (trae sus letras muy tenues: se refuerza con un filtro) y con el «revelado fino». */
.lg-revela { position: relative; aspect-ratio: 560 / 732; }
.lg-revela img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lg-logo { height: 170px; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .25)); }
.lg-frente {     animation: lg-fino 1.5s cubic-bezier(.4, 0, .2, 1) .25s both; }
.lg-fondo-img { filter: blur(3px) !important; opacity: 0; animation: lg-fino-fondo 1.5s ease .25s both; }
/* El logo de arriba entra como todo lo demás (sube y aparece), sin el «revelado fino» (ese efecto queda solo para la marca de agua del computador) */
.lg-logo .lg-frente { animation: none; }
.lg-logo .lg-fondo-img { display: none; }
.lg-logo { animation: lg-sube .8s cubic-bezier(.22, 1, .36, 1) .3s both; }

.lg-cristal { width: 100%; border-radius: 17px; padding: 30px 28px 24px; background: #8f1208; border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 20px 50px rgba(40, 6, 2, .35);
    animation: lg-sube .9s cubic-bezier(.22, 1, .36, 1) .5s both; }
.lg-cristal h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.lg-sub { margin: 0 0 22px; color: rgba(255, 255, 255, .78); }
.lg-form { display: grid; gap: 16px; }
.lg-campo { display: grid; gap: 7px; font-weight: 500; font-size: 13px; min-width: 0; }
.lg-campo > span:first-child { color: rgba(255, 255, 255, .9); }
.lg-caja { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26); transition: border-color .15s, box-shadow .15s; }
.lg-caja:focus-within { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }
.lg-caja > i { position: absolute; left: 14px; display: grid; pointer-events: none; opacity: .8; }
.lg-input { width: 100%; min-width: 0; height: 50px; border: 0; background: none; outline: 0; font: inherit; font-size: 15px; color: #fff; padding: 0 46px 0 44px; border-radius: 8px; }
.lg-input::placeholder { color: rgba(255, 255, 255, .55); }
.lg-input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s; }
.lg-ojo { position: absolute; right: 6px; width: 38px; height: 38px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: #fff; opacity: .8; display: grid; place-items: center; }
.lg-ojo:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.lg-ojo svg[hidden] { display: none; }
.lg-campo-error { color: #ffd2cc; font-weight: 500; }

/* Todos los iconos: línea fina, de un solo color (el del texto). */
.lg-cristal svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lg-error, .lg-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-weight: 500; line-height: 1.35; }
.lg-error { background: #fff; color: #a8170a; }
.lg-aviso { background: none; border: 0; padding: 0; color: #fff; }
.lg-error svg, .lg-aviso svg { margin-top: 1px; }
.lg-error, .lg-aviso { animation: lg-sube .5s cubic-bezier(.22, 1, .36, 1) .3s both; }

.lg-boton { height: 52px; border: 0; border-radius: 8px; background: #fff; color: #8a1106; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 12px 30px rgba(40, 6, 2, .35); transition: transform .15s, opacity .15s; animation: lg-sube .7s cubic-bezier(.22, 1, .36, 1) .85s both; }
.lg-boton:hover { transform: translateY(-1px); }
.lg-boton:active { transform: none; }
.lg-boton.is-cargando { opacity: .9; cursor: progress; }
.lg-boton.is-cargando svg { display: none; }
.lg-boton.is-cargando::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid rgba(138, 17, 6, .25); border-top-color: #8a1106; animation: lg-gira .75s linear infinite; }
@keyframes lg-gira { to { transform: rotate(360deg); } }
.lg-boton::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; left: 0; background: linear-gradient(90deg, transparent, rgba(174, 23, 9, .22), transparent); transform: translateX(-130%) skewX(-18deg); animation: lg-brilla 1.1s ease 1.8s 1 both; pointer-events: none; }
.lg-pie { margin: 18px 0 0; text-align: center; color: rgba(255, 255, 255, .62); font-size: 12.5px; animation: lg-aparece .8s ease 1.1s both; }

/* Entrada: el título, los campos y el botón suben uno tras otro. */
.lg-cristal > h1 { animation: lg-sube .7s cubic-bezier(.22, 1, .36, 1) .55s both; }
.lg-sub { animation: lg-sube .7s cubic-bezier(.22, 1, .36, 1) .65s both; }
.lg-form > .lg-campo:nth-of-type(1) { animation: lg-sube .7s cubic-bezier(.22, 1, .36, 1) .72s both; }
.lg-form > .lg-campo:nth-of-type(2) { animation: lg-sube .7s cubic-bezier(.22, 1, .36, 1) .8s both; }

@keyframes lg-sube { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes lg-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-marca-entra { from { opacity: 0; } to { opacity: .06; } }
@keyframes lg-flota { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(26px, -22px); } }
@keyframes lg-fino { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lg-fino-fondo { 0% { opacity: 0; } 20% { opacity: .5; } 85% { opacity: .35; } 100% { opacity: 0; } }
@keyframes lg-brilla { to { transform: translateX(260%) skewX(-18deg); } }
@keyframes lg-pulsa { 50% { transform: translateX(4px); } }

@media (max-width: 520px) {
    .lg-body { padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
    .lg-logo { height: 132px; }
    .lg-cristal { padding: 26px 22px 20px; }
    .lg-o1 { width: 340px; height: 340px; left: -130px; bottom: -150px; } .lg-o2 { width: 240px; height: 240px; right: -80px; top: -90px; }
}
@media (prefers-reduced-motion: reduce) {
    .lg-fondo *, .lg-pila *, .lg-pila { animation: none !important; }
    .lg-marca { opacity: .06; }
}

/* PIN de 4 números */
.lg-casillas { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lg-casilla { height: 58px; border-radius: 8px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.lg-casilla.llena::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.lg-casilla.actual { border-color: #fff; background: rgba(255, 255, 255, .24); }
.lg-casillas-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; background: transparent; cursor: text; }
.lg-enlace { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.lg-enlace:hover { opacity: .85; }
.lg-pie-pin { display: flex; justify-content: center; gap: 16px; margin-top: 18px; }
.lg-enlace-pin { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
[hidden] { display: none !important; }

/* PIN en celular: teclado numérico propio (en pantallas anchas no se muestra) y texto del enlace según el equipo */
.lg-teclado, .lg-puntos { display: none; }
.lg-solo-cel { display: none; }
@media (max-width: 700px) {
    .lg-casillas { display: none; }
    .lg-puntos { display: flex; justify-content: center; gap: 18px; margin: 6px 0 14px; }
    .lg-puntos i { width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: 0; transform: scale(.4); transition: opacity .12s, transform .12s; }      /* el espacio está reservado, pero cada punto aparece solo al marcar su número */
    .lg-puntos i.llena { opacity: 1; transform: scale(1); animation: lg-punto .6s ease-in-out both; }      /* aparece grande y se achica hasta su tamaño */
    @keyframes lg-punto { 0% { opacity: 0; transform: scale(.3); } 35% { opacity: 1; transform: scale(1.6); } 100% { opacity: 1; transform: scale(1); } }
    @media (prefers-reduced-motion: reduce) { .lg-puntos i.llena { animation: none; } }
    /* Pantalla del PIN: el nombre arriba y chico, los puntos, el teclado ancho en la parte baja y dos enlaces en las esquinas de abajo (como una app de banco) */
    .lg-body:has(#lg-pin:not([hidden])) { display: flex; flex-direction: column; align-items: stretch; padding: calc(22px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); }
    .lg-body:has(#lg-pin:not([hidden])) .lg-pila { flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: none; gap: 0; }
    html:has(#lg-pin:not([hidden])) { overflow: hidden; height: 100%; }
    .lg-body:has(#lg-pin:not([hidden])) { height: 100vh; height: 100svh; min-height: 0; overflow: hidden; }          /* todo se ve de una vez: sin scroll */
    .lg-body:has(#lg-pin:not([hidden])) .lg-logo { height: clamp(56px, 10.5svh, 88px); margin-bottom: clamp(12px, 3svh, 22px); flex: none; }
    .lg-cristal:has(#lg-pin:not([hidden])) { flex: 1; display: flex; flex-direction: column; width: 100%; padding: 0; background: none; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
    #lg-pin:not([hidden]) { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; min-height: 0; }
    #lg-pin h1 { font-size: 16px; font-weight: 500; letter-spacing: 0; margin: 0 0 18px; }
    #lg-pin .lg-info { width: 22px; height: 22px; margin-left: 2px; }
    #lg-pin .lg-info svg { width: 17px; height: 17px; }
    #lg-form-pin { flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; gap: 0; }
    .lg-puntos { gap: 20px; margin: 10px 0 0; }
    .lg-puntos i { width: 11px; height: 11px; }
    .lg-teclado { --tecla: clamp(44px, 7.2svh, 58px); display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 300px; gap: clamp(2px, .8svh, 6px) 0; margin: clamp(46px, 14svh, 112px) 0 auto; justify-items: center; }          /* arriba, justo bajo los puntos; los enlaces quedan al fondo */
    .lg-teclado button { width: var(--tecla); height: var(--tecla); border-radius: 50%; border: 0; background: transparent; color: #fff; font: inherit; font-size: 25px; font-weight: 600; display: grid; place-items: center; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
    .lg-teclado button:active { background: rgba(255, 255, 255, .22); }
    .lg-teclado svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .lg-pie-pin { position: fixed; left: 24px; right: 24px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; z-index: 2; }          /* fijos al borde de abajo: nunca quedan tapados ni requieren scroll */
    .lg-marca { display: none; }          /* sin la imagen grande de fondo */
    .lg-enlace-pin { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
    .lg-solo-pc { display: none; }
    .lg-solo-cel { display: inline; }
}

/* Ayuda del PIN: el texto va en un ícono de información junto al nombre, no como leyenda */
.lg-info { display: inline-grid; place-items: center; vertical-align: middle; width: 26px; height: 26px; margin-left: 4px; padding: 0; border: 0; background: transparent; color: rgba(255, 255, 255, .8); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lg-info svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-info-txt { margin: 6px 0 4px; padding: 8px 12px; border-radius: 7px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .3); font-size: 13px; }
.lg-info-txt[hidden] { display: none; }
#lg-pin h1 { margin-bottom: 8px; }


/* Al acertar el PIN los puntos hacen una onda y la pantalla se desvanece antes de entrar; al errar, los puntos tiemblan */
@media (max-width: 700px) {
    .lg-puntos.lg-ok i { animation: lg-onda .55s cubic-bezier(.3, 1.5, .5, 1) both; box-shadow: 0 0 12px rgba(255, 255, 255, .8); opacity: 1; transform: scale(1); }
    .lg-puntos.lg-ok i:nth-child(2) { animation-delay: .08s; } .lg-puntos.lg-ok i:nth-child(3) { animation-delay: .16s; } .lg-puntos.lg-ok i:nth-child(4) { animation-delay: .24s; }
    #lg-pin.lg-saliendo h1, #lg-pin.lg-saliendo .lg-teclado, #lg-pin.lg-saliendo .lg-pie-pin { opacity: 0; transition: opacity .35s ease .15s; pointer-events: none; }
    .lg-puntos.lg-tiembla { animation: lg-tiembla .5s ease; }
    .lg-puntos.lg-tiembla i { opacity: 1; transform: scale(1); transition: none; }          /* clave inválida: los puntos se quedan blancos y solo tiemblan */
    #lg-pin .lg-error { background: none; border: 0; padding: 0; border-radius: 0; margin: 0; color: #fff; font-size: 13px; font-weight: 500; justify-content: center; text-align: center; animation: none; }          /* el aviso del PIN es solo texto blanco, sin recuadro */
    #lg-pin .lg-error svg { display: none; }
    .lg-pin-aviso { min-height: 38px; width: 100%; display: flex; align-items: center; justify-content: center; }          /* el lugar del aviso siempre está reservado: al aparecer el texto, nada se mueve */
}
@keyframes lg-onda { 0% { transform: scale(1); } 40% { transform: scale(2.1); } 100% { transform: scale(1); } }
@keyframes lg-tiembla { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .lg-puntos.lg-ok i, .lg-puntos.lg-tiembla { animation: none; } }
