/* ============================================================================
 * Pantalla de acceso — DassBill
 *
 * El fondo morado se mantiene tal cual estaba. Lo que cambia es la tarjeta:
 * vidrio esmerilado real (backdrop-filter) en vez de una caja blanca opaca.
 *
 * El detalle que hace que se vea caro: el lienzo de particulas va DETRAS de la
 * tarjeta, no delante. Como la tarjeta desenfoca lo que tiene detras, los
 * numeros que pasan por ahi se ven borrosos a traves del vidrio y nitidos
 * fuera. Eso es lo que da la sensacion de profundidad; si el lienzo fuera
 * encima, seria una animacion pegada sobre un rectangulo.
 *
 * El CSS vive aqui y no en un <style> dentro de la vista por una razon
 * practica: en un .cshtml habria que escapar cada @ como @@ (@@media,
 * @@keyframes) y basta olvidar uno para que Razor deje de compilar.
 * ========================================================================== */

:root {
    --lg-morado-1: #667eea;
    --lg-morado-2: #764ba2;
    --lg-vidrio: rgba(255, 255, 255, .11);
    --lg-vidrio-borde: rgba(255, 255, 255, .26);
    --lg-texto: #ffffff;
    --lg-texto-suave: rgba(255, 255, 255, .72);
    --lg-campo: rgba(255, 255, 255, .10);
    --lg-campo-foco: rgba(255, 255, 255, .16);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--lg-texto);
    background: linear-gradient(135deg, var(--lg-morado-1) 0%, var(--lg-morado-2) 100%);
    overflow: hidden;
}

/* ---------------------------------------------------------------- el fondo --
   Dos manchas de luz enormes y muy difusas que se desplazan despacio. No se
   perciben como "algo que se mueve": el fondo simplemente deja de verse plano.
   ---------------------------------------------------------------------- */
.lg-aurora {
    position: fixed;
    inset: -25%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(36% 44% at 14% 26%, rgba(167, 139, 250, .62), transparent 62%),
        radial-gradient(40% 38% at 84% 74%, rgba(56, 189, 248, .42), transparent 64%),
        radial-gradient(30% 32% at 66% 10%, rgba(236, 72, 153, .28), transparent 66%),
        radial-gradient(46% 50% at 50% 100%, rgba(30, 12, 70, .45), transparent 60%);
    filter: blur(16px);
    animation: lgAurora 26s ease-in-out infinite alternate;
}

@keyframes lgAurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(2.5%, -2%, 0) scale(1.06); }
    100% { transform: translate3d(-2%, 2.5%, 0) scale(1.02); }
}

/* Particulas de numeros. Detras de la tarjeta a proposito (ver cabecera). */
#lgParticulas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* --------------------------------------------------------------- la tarjeta */
.lg-envoltorio {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
}

.lg-tarjeta {
    position: relative;
    border-radius: 24px;
    padding: 38px 34px 30px;
    background: var(--lg-vidrio);
    border: 1px solid var(--lg-vidrio-borde);
    /* saturate levanta el color del fondo que se ve a traves; sin eso el
       vidrio apaga el morado y la tarjeta se ve gris sucio. */
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    box-shadow:
        0 24px 60px rgba(23, 12, 54, .38),
        0 2px 8px rgba(23, 12, 54, .20),
        inset 0 1px 0 rgba(255, 255, 255, .30);
    animation: lgEntra .7s cubic-bezier(.21, 1, .32, 1) both;
    overflow: hidden;
}

/* Brillo curvo en el borde superior: es lo que hace leer la superficie como
   vidrio y no como plastico translucido. */
.lg-tarjeta::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), transparent);
    pointer-events: none;
}

/* Reflejo que cruza en diagonal una sola vez al cargar. */
.lg-tarjeta::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 55%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .13), transparent);
    transform: rotate(22deg);
    animation: lgReflejo 2.6s .85s ease-out both;
    pointer-events: none;
}

@keyframes lgEntra {
    from { opacity: 0; transform: translateY(22px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

@keyframes lgReflejo {
    from { left: -60%; }
    to   { left: 145%; }
}

/* ------------------------------------------------------------------ cabecera */
.lg-cabecera {
    position: relative;
    text-align: center;
    margin-bottom: 26px;
}

.lg-logo {
    width: 104px;
    height: 104px;
    margin: 0 auto 16px;
    border-radius: 26px;
    background: #fff;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(23, 12, 54, .30);
    animation: lgFlota 5.5s ease-in-out 1s infinite;
}

.lg-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

@keyframes lgFlota {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.lg-titulo {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-shadow: 0 2px 12px rgba(23, 12, 54, .35);
}

.lg-subtitulo {
    margin: 0;
    font-size: .875rem;
    color: var(--lg-texto-suave);
}

/* -------------------------------------------------------------------- campos */
.lg-campo { margin-bottom: 18px; }

.lg-etiqueta {
    display: block;
    margin-bottom: 7px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lg-texto-suave);
}

.lg-caja {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 13px;
    background: var(--lg-campo);
    border: 1px solid rgba(255, 255, 255, .18);
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.lg-caja:focus-within {
    background: var(--lg-campo-foco);
    border-color: rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .10);
}

.lg-icono {
    flex: 0 0 auto;
    padding: 0 12px 0 15px;
    font-size: 1rem;
    color: rgba(255, 255, 255, .60);
    transition: color .2s;
}

.lg-caja:focus-within .lg-icono { color: #fff; }

.lg-entrada {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 14px 14px 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.lg-entrada::placeholder { color: rgba(255, 255, 255, .42); }

/* Chrome pinta un fondo amarillo solido al autocompletar y se lleva puesto el
   vidrio. El truco del inset shadow es la unica forma de taparlo. */
.lg-entrada:-webkit-autofill,
.lg-entrada:-webkit-autofill:hover,
.lg-entrada:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(120, 90, 190, .55) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.lg-ojo {
    flex: 0 0 auto;
    padding: 0 15px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .60);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.lg-ojo:hover { color: #fff; }

/* Aviso de bloq mayus. En una caja registradora la contrasena se escribe a
   ciegas y con prisa: es el error mas comun y el mas facil de evitar. */
.lg-mayusculas {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: .78rem;
    color: #fde68a;
}

.lg-mayusculas.visible { display: flex; }

/* ---------------------------------------------------------------- recordarme */
.lg-recordar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 22px;
    font-size: .875rem;
    color: var(--lg-texto-suave);
    cursor: pointer;
    user-select: none;
}

.lg-recordar input {
    width: 17px;
    height: 17px;
    accent-color: #a78bfa;
    cursor: pointer;
}

/* -------------------------------------------------------------------- boton */
.lg-boton {
    position: relative;
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .40);
    transition: transform .15s, box-shadow .2s, filter .2s;
}

.lg-boton:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(37, 99, 235, .52);
    filter: brightness(1.06);
}

.lg-boton:active { transform: translateY(0); }

.lg-boton:disabled { cursor: wait; filter: saturate(.7); transform: none; }

/* Brillo que recorre el boton al pasar el mouse. */
.lg-boton span.lg-brillo {
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
}

.lg-boton:hover span.lg-brillo { left: 130%; }

.lg-girando {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lgGira .7s linear infinite;
    vertical-align: -2px;
}

@keyframes lgGira { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- pie y links */
.lg-olvide {
    display: block;
    margin-top: 16px;
    text-align: center;
    font-size: .875rem;
    color: var(--lg-texto-suave);
    text-decoration: none;
    transition: color .2s;
}

.lg-olvide:hover { color: #fff; text-decoration: underline; }

.lg-separador {
    height: 1px;
    margin: 22px 0 16px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
}

.lg-nota {
    text-align: center;
    font-size: .78rem;
    color: rgba(255, 255, 255, .55);
    line-height: 1.5;
}

.lg-pie {
    margin-top: 18px;
    text-align: center;
    font-size: .78rem;
    color: rgba(255, 255, 255, .55);
}

/* -------------------------------------------------------------------- errores */
.lg-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, .18);
    border: 1px solid rgba(252, 165, 165, .45);
    color: #fee2e2;
    font-size: .875rem;
    animation: lgSacude .4s;
}

.lg-error ul { margin: 0; padding-left: 16px; }
.lg-error ul li { list-style: none; margin-left: -16px; }

@keyframes lgSacude {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.lg-validacion {
    display: block;
    margin-top: 6px;
    font-size: .8rem;
    color: #fecaca;
}

/* ------------------------------------------------------------------ pantallas */
@media (max-width: 420px) {
    .lg-tarjeta { padding: 30px 22px 24px; }
    .lg-logo { width: 88px; height: 88px; border-radius: 22px; }
    .lg-titulo { font-size: 1.3rem; }
}

/* Si el equipo es viejo o el navegador no soporta el desenfoque, la tarjeta se
   vuelve solida en vez de quedar transparente e ilegible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .lg-tarjeta { background: rgba(70, 45, 120, .82); }
}

/* Nadie deberia marearse por entrar a cobrar. */
@media (prefers-reduced-motion: reduce) {
    .lg-aurora, .lg-logo, .lg-tarjeta, .lg-tarjeta::after { animation: none !important; }
    #lgParticulas { display: none; }
    .lg-boton { transition: none; }
}
