/* ══════ Portada (pantalla de acceso) ══════ */
body.lg{display:block;padding:0;min-height:100vh;min-height:100dvh;background:radial-gradient(120% 70% at 50% 0%,#1d4fbf 0%,#0d2462 45%,#081534 100%);overflow-x:hidden}
.lg-wrap{max-width:440px;margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 18px 28px;display:flex;flex-direction:column;align-items:center}
.lg-scene{position:relative;width:100%;aspect-ratio:400/330;cursor:pointer;-webkit-tap-highlight-color:transparent}
.lg-track{position:absolute;left:0;right:0;bottom:0;width:100%;height:84%}
.lg-train{position:absolute;left:16.6%;width:66.8%;bottom:0;aspect-ratio:200/220;transform-origin:50% 100%;animation:lgArrive 3.8s both}
.lg-tr{width:100%;height:100%;display:block;overflow:visible;filter:drop-shadow(0 10px 18px rgba(0,0,0,.45))}
.lg-halo{opacity:.85;animation:lgHalo 1.1s ease-in-out infinite alternate}
.lg-sp{opacity:0;animation:lgSpark .12s steps(2) 2.3s 9,lgSparkOff .01s 3.35s forwards}
.lg-sp2{animation-delay:2.35s,3.35s}
@keyframes lgArrive{
  0%{transform:translateY(-102%) scale(.035);animation-timing-function:cubic-bezier(.62,.04,.3,1)}
  86%{transform:translateY(0) scale(1);animation-timing-function:ease-out}
  91%{transform:translateY(1.6%) scale(1.004) rotate(.25deg)}
  96%{transform:translateY(-.4%) scale(1)}
  100%{transform:none}}
@keyframes lgHalo{from{opacity:.55}to{opacity:1}}
@keyframes lgSpark{0%{opacity:0;transform:translateY(0)}50%{opacity:1;transform:translateY(-1.5px)}100%{opacity:.2;transform:translateY(1px)}}
@keyframes lgSparkOff{to{opacity:0}}
.lg-title{text-align:center;color:#fff;margin:18px 0 16px;animation:lgUp .6s ease-out 3.35s both}
.lg-title small{display:block;font-size:13px;font-weight:700;letter-spacing:3px;text-transform:uppercase;color:#9fb6ea}
.lg-title h1{margin:2px 0 6px;font-size:30px;line-height:1.1;letter-spacing:-.6px;color:#fff;font-weight:800}
.lg-title h1 span{display:inline-block;background:#f5c400;color:#0b1f4d;border-radius:8px;padding:0 9px;margin-left:4px;font-size:.92em}
.lg-title p{margin:0;font-size:16px;font-weight:700;color:#fff}
.lg-title em{display:block;font-style:normal;font-weight:500;font-size:12.5px;color:#f5c400;letter-spacing:.3px;margin-top:2px}
body.lg form.lg-form{width:100%;max-width:400px;box-sizing:border-box;padding:20px 20px 22px;border-radius:18px;animation:lgUp .6s ease-out 3.6s both}
body.lg form.lg-form label:first-of-type{margin-top:0}
@keyframes lgUp{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
body.lg-done .lg-train,body.lg-done .lg-title,body.lg-done form.lg-form,body.lg-done .lg-sp{animation-duration:0s!important;animation-delay:0s!important;animation-iteration-count:1!important}
body.lg-done .lg-sp{opacity:0!important}
@media (min-width:900px){.lg-wrap{max-width:480px;padding-top:4vh}.lg-title h1{font-size:34px}}
@media (max-height:700px){.lg-scene{width:78%}.lg-title{margin:10px 0}.lg-title h1{font-size:26px}}
@media (prefers-reduced-motion:reduce){.lg-train,.lg-title,body.lg form.lg-form{animation:none!important}.lg-sp{display:none}.lg-halo{animation:none}}
/* Fondo del ingreso: fotos de trenes desenfocadas que se alternan con fundido, bajo un velo azul institucional */
.lg-bg{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:#081534}
.lg-bg i{position:absolute;inset:-4%;background-size:cover;background-position:center;opacity:0;filter:saturate(.85) brightness(.9);animation:lgBg 72s infinite;will-change:opacity,transform}
.lg-bg i:nth-child(2){animation-delay:9s}.lg-bg i:nth-child(3){animation-delay:18s}.lg-bg i:nth-child(4){animation-delay:27s}.lg-bg i:nth-child(5){animation-delay:36s}.lg-bg i:nth-child(6){animation-delay:45s}.lg-bg i:nth-child(7){animation-delay:54s}.lg-bg i:nth-child(8){animation-delay:63s}
.lg-bg:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(8,21,52,.62) 0%,rgba(11,31,77,.72) 45%,rgba(8,21,52,.9) 100%),radial-gradient(120% 70% at 50% 0%,rgba(29,79,191,.35),transparent 60%)}
/* 8 fotos de 9 s cada una (72 s): cada una aparece en su octavo del ciclo */
@keyframes lgBg{0%{opacity:0;transform:scale(1.08)}2%{opacity:1}12.5%{opacity:1}14.5%{opacity:0;transform:scale(1)}100%{opacity:0;transform:scale(1)}}
body.lg .lg-wrap{position:relative;z-index:1}
body.lg .lg-track polygon:first-of-type{opacity:.55}
@media (prefers-reduced-motion:reduce){.lg-bg i{animation:none}.lg-bg i:first-child{opacity:1}}
/* Ajustes: el velo deja ver las fotos en los costados; el contenido va sobre un panel de vidrio esmerilado */
.lg-bg:after{background:radial-gradient(ellipse 46% 78% at 50% 50%,rgba(8,21,52,.82) 0%,rgba(8,21,52,.62) 55%,rgba(8,21,52,.34) 100%),linear-gradient(180deg,rgba(8,21,52,.25) 0%,rgba(8,21,52,0) 30%,rgba(8,21,52,.55) 100%)}
.lg-bg i{filter:saturate(1.05) brightness(.95)}
.lg-foot{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:18px;font-size:11px;color:rgba(255,255,255,.62);letter-spacing:.3px;text-align:center}
.lg-dots{display:flex;gap:6px}
.lg-dots i{display:block;width:22px;height:3px;border-radius:2px;background:rgba(255,255,255,.22);overflow:hidden;position:relative}
.lg-dots i:after{content:'';position:absolute;inset:0;background:#f5c400;transform:scaleX(0);transform-origin:left;animation:lgDot 27s linear infinite}
.lg-dots i:nth-child(2):after{animation-delay:9s}.lg-dots i:nth-child(3):after{animation-delay:18s}
@keyframes lgDot{0%{transform:scaleX(0);opacity:1}33.3%{transform:scaleX(1);opacity:1}33.4%,100%{transform:scaleX(0);opacity:0}}
@media (min-width:900px){
  body.lg .lg-wrap{margin-top:4vh;padding:18px 34px 22px;background:rgba(11,31,77,.32);-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);
    border:1px solid rgba(255,255,255,.14);border-radius:26px;box-shadow:0 30px 80px rgba(3,10,30,.55),inset 0 1px 0 rgba(255,255,255,.08)}
  body.lg form.lg-form{box-shadow:0 18px 40px rgba(3,10,30,.35)}
}
@media (prefers-reduced-motion:reduce){.lg-dots{display:none}}
@media (min-width:900px) and (min-height:760px){body.lg{display:flex;align-items:center;justify-content:center}body.lg .lg-wrap{margin:3vh auto}}
/* Sin el tren dibujado: las fotos dan el contexto; arriba queda el ícono de la app como marca */
.lg-logo{display:block;width:64px;height:64px;border-radius:16px;margin:4vh auto 0;box-shadow:0 10px 30px rgba(3,10,30,.45),0 0 0 1px rgba(255,255,255,.15);animation:lgUp .5s ease-out .05s both}
body.lg .lg-title{margin-top:16px;animation:lgUp .5s ease-out .15s both}
body.lg form.lg-form{animation:lgUp .5s ease-out .25s both}
@media (min-width:900px){.lg-logo{margin-top:6px;width:72px;height:72px}}
@media (prefers-reduced-motion:reduce){.lg-logo{animation:none}}
@media (min-height:640px){body.lg{display:flex;flex-direction:column;justify-content:center;min-height:100vh;min-height:100dvh}body.lg .lg-wrap{width:100%;box-sizing:border-box}.lg-logo{margin-top:0}}
