/* Arranque, inicio de sesión y animación de entrada */
#app.oculto { visibility: hidden; }
#acceso { position: fixed; inset: 0; z-index: 60; overflow: hidden; color: #f2f4fb; background: #0b0e1a; }
#acceso.visible { background: radial-gradient(900px 600px at 85% -10%, rgba(139,92,246,.28), transparent 65%), radial-gradient(800px 600px at -5% 105%, rgba(34,211,238,.16), transparent 65%), var(--fondo); }
#acceso.abriendo { animation: cerrarCirculo .8s cubic-bezier(.7, 0, .25, 1) forwards; }
@keyframes cerrarCirculo { from { clip-path: circle(150vmax at var(--cx) var(--cy)); } to { clip-path: circle(0 at var(--cx) var(--cy)); } }

/* Pantalla del ícono, como al abrir una app */
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.splash img { width: 132px; height: 132px; filter: drop-shadow(0 18px 40px rgba(124, 58, 237, .55)); animation: iconoEntra .75s cubic-bezier(.2, 1.4, .4, 1) both; }
.splash b { font-size: 20px; font-weight: 650; letter-spacing: .01em; animation: subir .5s .35s both; }
.splash i { width: 120px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; position: relative; animation: subir .5s .5s both; }
.splash i::after { content: ''; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); animation: carga 1s .5s ease-in-out infinite; }
@keyframes iconoEntra { from { opacity: 0; transform: scale(.45); } to { opacity: 1; transform: none; } }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes carga { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Escena */
.escena { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 430px); gap: 5vw; align-items: center; padding: 3vh 8vw; }
.escena::before, .escena::after { content: ''; position: absolute; pointer-events: none; transform: skewX(-24deg); background: rgba(255, 255, 255, .045); }
.escena::before { left: 12%; top: -10%; width: 22%; height: 130%; background: rgba(255, 255, 255, .02); }
.escena::after { right: -6%; top: -10%; width: 30%; height: 130%; background: rgba(139, 92, 246, .05); }
.cielo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.estrella { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .5; animation: brillar 2.8s ease-in-out infinite; }
.petalo { position: absolute; top: -30px; width: 13px; height: 10px; border-radius: 80% 10% 80% 10%; background: linear-gradient(135deg, #fbcfe8, #f472b6); opacity: .85; animation: caer linear infinite; }
@keyframes brillar { 50% { opacity: .12; } }
@keyframes caer { to { transform: translate(90px, 110vh) rotate(560deg); } }

.arte { position: relative; min-width: 0; opacity: 0; transform: translateX(-46px); transition: 1s cubic-bezier(.2, .8, .2, 1); }
.arte svg { width: 100%; height: min(78vh, 640px); display: block; stroke: none; }
.lista .arte { opacity: 1; transform: none; }
.flota { animation: flotar 4.2s ease-in-out infinite; }
.f2 { animation-delay: -1.3s; animation-duration: 5s; } .f3 { animation-delay: -2.4s; animation-duration: 4.6s; }
.planeta { animation: flotar 7s ease-in-out infinite; }
.casilla { animation: latir 3.4s ease-in-out infinite; }
@keyframes flotar { 50% { transform: translateY(-15px); } }
@keyframes latir { 50% { opacity: .55; } }

.tarjetaAcceso { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 30px 30px 26px; border-radius: 26px; background: #151a30; border: 1px solid var(--borde); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); backdrop-filter: blur(16px); opacity: 0; transform: translateY(34px) scale(.97); transition: .75s .15s cubic-bezier(.2, .9, .25, 1); }
.lista .tarjetaAcceso { opacity: 1; transform: none; }
.tarjetaAcceso.sacude { animation: sacudir .42s; }
@keyframes sacudir { 20% { translate: -10px 0; } 40% { translate: 9px 0; } 60% { translate: -6px 0; } 80% { translate: 4px 0; } }
.ola, .volver, .intro { display: none; }
.avatarAcceso { align-self: center; width: 96px; height: 96px; padding: 4px; border-radius: 50%; background: conic-gradient(from 0deg, #8b5cf6, #22d3ee, #fb923c, #8b5cf6); animation: girarAro 7s linear infinite; }
.avatarAcceso img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; background: #151a30; border: 3px solid #151a30; animation: girarAro 7s linear infinite reverse; }
@keyframes girarAro { to { transform: rotate(360deg); } }
.tarjetaAcceso h2 { font-size: 24px; text-align: center; margin-top: 4px; }
.tarjetaAcceso .sub { text-align: center; color: #aab2c8; margin-top: -8px; margin-bottom: 6px; }
.caja { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #aab2c8; transition: .15s; }
.caja:focus-within { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); color: #f2f4fb; }
.caja input:not([type=checkbox]) { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; border-radius: 0; color: #f2f4fb; font-size: 15px; box-shadow: none; }
.caja input:focus { outline: none; }
.caja button { display: grid; place-items: center; color: inherit; } .caja button.on { color: #22d3ee; }
.recordar { display: flex; align-items: center; gap: 8px; color: #aab2c8; font-size: 13px; cursor: pointer; }
.recordar input { width: 17px; height: 17px; accent-color: #8b5cf6; margin: 0; }
.errorAcceso { min-height: 18px; color: #fca5a5; font-size: 13px; text-align: center; }
.btnAcceso { position: relative; height: 50px; border-radius: 15px; background: linear-gradient(135deg, #7c4df0, #18b6d4); background-size: 170% 100%; color: #fff; font-size: 16px; font-weight: 650; overflow: hidden; transition: .25s; }
.btnAcceso:hover { background-position: 100% 0; box-shadow: 0 10px 26px rgba(124, 58, 237, .45); }
.btnAcceso:active { transform: scale(.98); }
.btnAcceso svg { position: absolute; left: 50%; top: 50%; margin: -13px; width: 26px; height: 26px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: .25s; }
.btnAcceso span { transition: .2s; }
.btnAcceso.cargando span { opacity: .55; }
.btnAcceso.listo { background: #10b981; } .btnAcceso.listo span { opacity: 0; } .btnAcceso.listo svg { opacity: 1; transform: none; }
.escena footer { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: rgba(255, 255, 255, .45); font-size: 12px; }

/* Entrada a la app */
.entrando #riel { animation: desdeIzq .7s .15s cubic-bezier(.2, .9, .25, 1) both; }
.entrando #vista > * { animation: subir .6s .3s both; }
.entrando .cuadro { animation: subir .55s both; }
.entrando .cuadro:nth-child(1) { animation-delay: .35s; } .entrando .cuadro:nth-child(2) { animation-delay: .43s; } .entrando .cuadro:nth-child(3) { animation-delay: .51s; } .entrando .cuadro:nth-child(4) { animation-delay: .59s; } .entrando .cuadro:nth-child(5) { animation-delay: .67s; }
@keyframes desdeIzq { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }

/* Teléfono: bienvenida a pantalla completa y luego la tarjeta con ola */
@media (max-width: 640px) {
  .escena { display: block; padding: 0; }
  .escena::before, .escena::after, .escena footer { display: none; }
  .arte { position: absolute; left: 0; right: 0; top: 6vh; transition: .6s cubic-bezier(.2, .8, .2, 1); }
  .arte svg { height: 44vh; }
  .paso2 .arte { top: -2vh; transform: scale(.82); }
  .intro { display: flex; flex-direction: column; gap: 8px; position: absolute; left: 24px; right: 24px; bottom: calc(34px + env(safe-area-inset-bottom)); opacity: 0; transform: translateY(26px); transition: .6s .2s; }
  .lista .intro { opacity: 1; transform: none; }
  .paso2 .intro { opacity: 0; transform: translateY(-20px); pointer-events: none; transition: .3s; }
  .intro h1 { font-size: 36px; line-height: 1.12; font-weight: 700; }
  .intro p { color: #cdd4e8; margin-bottom: 18px; }
  .tarjetaAcceso, .lista .tarjetaAcceso { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: #151a30; box-shadow: none; backdrop-filter: none; opacity: 1; transform: translateY(115%); transition: .6s cubic-bezier(.2, .9, .25, 1); }
  .paso2 .tarjetaAcceso { transform: none; }
  .ola { display: block; position: absolute; left: 0; right: 0; top: -69px; width: 100%; height: 70px; fill: #151a30; stroke: none; }
  .volver { display: grid; place-items: center; position: fixed; left: 16px; top: calc(16px + env(safe-area-inset-top)); width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; opacity: 0; pointer-events: none; }
  .paso2 .volver { opacity: 1; pointer-events: auto; }
  .tarjetaAcceso { transform: translateY(115%); }
  .avatarAcceso { width: 84px; height: 84px; margin-top: -42px; position: relative; z-index: 2; }
  .tarjetaAcceso.sacude { animation: sacudir .42s; }
}
@media (prefers-reduced-motion: reduce) {
  #acceso *, .entrando * { animation: none !important; transition: none !important; }
  .petalo { display: none; }
}
