/* =====================================================================
   Pantallas de acceso (login, registro, recuperar, error) - paleta Caelestia.
   Movil primero: arriba la marca sobre un cielo oscuro con nubes de
   aurora verde; abajo una "hoja" de cristal que sube como en una app
   nativa. En pantallas anchas la hoja se vuelve una tarjeta flotante.
   Usa solo las variables de estilos.css: si cambias la paleta alla,
   estas pantallas la siguen.
   ===================================================================== */

body.pagina-acceso {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: var(--tinta);
    overflow-x: hidden;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Cielo con nubes de aurora ---------- */
.nubes {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(120% 55% at 50% 0%, rgba(0, 255, 127, 0.10) 0%, transparent 70%),
        radial-gradient(circle at top left, #0a1711, var(--papel));
}
.nubes span {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 255, 127, 0.16), rgba(0, 255, 127, 0));
    filter: blur(22px);
    animation: flotar 22s ease-in-out infinite alternate;
}
.nubes span:nth-child(1) { width: 22rem; height: 11rem; top: -2rem; left: -6rem; }
.nubes span:nth-child(2) {
    width: 18rem; height: 9rem; top: 6rem; right: -7rem;
    background: radial-gradient(closest-side, rgba(236, 253, 245, 0.10), rgba(236, 253, 245, 0));
    animation-duration: 28s; animation-delay: -6s;
}
.nubes span:nth-child(3) { width: 14rem; height: 7rem; top: 13rem; left: 20%; opacity: 0.8; animation-duration: 34s; animation-delay: -12s; }

@keyframes flotar {
    from { transform: translate3d(-1.5rem, 0, 0) scale(1); }
    to   { transform: translate3d(2rem, 0.75rem, 0) scale(1.08); }
}

/* ---------- Estructura ---------- */
.acceso {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.acceso-cabecera {
    padding: calc(env(safe-area-inset-top, 0px) + 2.75rem) 1.5rem 2.25rem;
    text-align: center;
}
.acceso-logo {
    display: block;
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 1rem;
    border-radius: 22%;
    box-shadow: 0 0 0 1px var(--linea), 0 0 28px rgba(0, 255, 127, 0.25);
}
.acceso-cabecera .acceso-marca { font-size: 2.5rem; }
.acceso-cabecera .acceso-lema { margin: 0.6rem auto 0; max-width: 18rem; }

/* La hoja de cristal: sube desde abajo y ocupa el resto de la pantalla */
.acceso-hoja {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--superficie);
    color: var(--tinta);
    border: 1px solid var(--linea);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    padding: 1.75rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(0, 255, 127, 0.12);
    animation: subir 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.acceso-hoja::before {
    /* "agarradera" de hoja inferior, como en las apps nativas */
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.3rem;
    margin: -0.75rem auto 1.25rem;
    border-radius: 999px;
    background: var(--linea);
}
.acceso-titulo { margin: 0 0 0.25rem; font-size: 1.375rem; }
.acceso-subtitulo { margin: 0 0 0.5rem; color: var(--texto-suave); }

@keyframes subir {
    from { transform: translateY(2.5rem); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ---------- Campos con etiqueta flotante ---------- */
.formulario-acceso { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.75rem; }

.campo-flotante { position: relative; }
.campo-flotante input {
    width: 100%;
    height: 3.6rem;
    padding: 1.45rem 1rem 0.45rem;
    font-size: 1.0625rem; /* >= 16px: evita el zoom automatico de iOS */
    border: 1px solid var(--linea);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--tinta);
}
.campo-flotante input:focus {
    outline: none;
    border-color: var(--ingreso);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 12px rgba(0, 255, 127, 0.25);
}
/* El autocompletado de Chrome pinta el campo claro: lo devolvemos al cristal oscuro */
.campo-flotante input:-webkit-autofill,
.campo-flotante input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--tinta);
    -webkit-box-shadow: 0 0 0 100px #08140e inset;
    caret-color: var(--tinta);
}
.campo-flotante label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--texto-suave);
    pointer-events: none;
    transform-origin: left center;
    transition: top 0.15s, transform 0.15s, color 0.15s;
}
/* La etiqueta sube cuando hay foco, texto o autocompletado */
.campo-flotante input:focus + label,
.campo-flotante input:not(:placeholder-shown) + label,
.campo-flotante input:-webkit-autofill + label {
    top: 1.05rem;
    transform: translateY(-50%) scale(0.78);
    color: var(--ingreso);
}
.campo-flotante input:not(:focus):not(:placeholder-shown) + label { color: var(--texto-suave); }
.campo-flotante input.con-error { background: var(--gasto-suave); }
.campo-flotante + .error-campo { margin: -0.4rem 0 0 0.25rem; }

/* PIN: digitos grandes y espaciados */
.campo-pin input { font-size: 1.5rem; letter-spacing: 0.5em; font-weight: 700; color: var(--ingreso); }

/* Boton para ver u ocultar la contrasena */
.campo-contrasena input { padding-right: 5.25rem; }
.ver-contrasena {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    min-width: 4.5rem;
    min-height: 2.75rem; /* objetivo tactil comodo */
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ingreso);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}
.ver-contrasena:active { background: var(--ingreso-suave); }

/* ---------- Interruptor estilo iOS/Android ---------- */
.interruptor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.15rem;
    font-weight: 400;
    cursor: pointer;
}
.interruptor input {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    position: relative;
    width: 3rem;
    height: 1.75rem;
    margin: 0;
    border-radius: 999px;
    border: 1px solid var(--linea);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.interruptor input::before {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--texto-suave);
    transition: transform 0.2s, background-color 0.2s;
}
.interruptor input:checked {
    background: var(--ingreso);
    border-color: var(--ingreso);
    box-shadow: 0 0 12px rgba(0, 255, 127, 0.45);
}
.interruptor input:checked::before { transform: translateX(1.25rem); background: var(--papel); }
.interruptor input:focus-visible { outline: 3px solid var(--ingreso); outline-offset: 2px; }

/* ---------- Botones y enlaces ---------- */
.boton-bloque {
    width: 100%;
    min-height: 3.4rem;
    margin-top: 0.4rem;
    border-radius: 14px;
    font-size: 1.0625rem;
}
/* En el telefono no hay "hover": el toque enciende el neon */
.boton-bloque.boton-principal:active {
    transform: scale(0.98);
    background: var(--ingreso);
    color: var(--papel);
    box-shadow: 0 0 18px rgba(0, 255, 127, 0.6);
    text-shadow: none;
}

.acceso-enlaces {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1.75rem;
    text-align: center;
    color: var(--texto-suave);
}
.acceso-enlaces a { padding: 0.35rem 0.5rem; }
.acceso-enlaces .acceso-alterno { margin: 0; }
.enlace-discreto { color: var(--texto-suave); }

.acceso-hoja .aviso { margin: 0.5rem 0 0; }

/* ---------- Pantallas anchas: tarjeta flotante centrada ---------- */
@media (min-width: 40rem) {
    .acceso { justify-content: center; align-items: center; padding: 2rem 1rem; }
    .acceso-cabecera { padding-top: 0; }
    .acceso-hoja {
        flex: none;
        width: 100%;
        max-width: 26rem;
        border-bottom: 1px solid var(--linea);
        border-radius: var(--radio);
        padding: 2rem 1.75rem;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 255, 127, 0.06);
    }
    .acceso-hoja::before { display: none; }
    .acceso-enlaces { margin-top: 0; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .nubes span, .acceso-hoja { animation: none; }
    .campo-flotante label, .interruptor input, .interruptor input::before { transition: none; }
}
