/* =========================================================
   Asaz · pantalla de carga + comportamiento tipo app (compartido)
   ========================================================= */

/* ---------- Pantalla de carga ---------- */
.splash { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; overflow: hidden; color: #fff;
  background: radial-gradient(60% 55% at 50% 38%, rgba(29, 82, 160, .55), transparent 70%),
              radial-gradient(45% 45% at 85% 12%, rgba(212, 167, 44, .28), transparent 65%),
              linear-gradient(165deg, #002858, #00122b);
  transition: opacity .55s ease, transform .55s ease, visibility 0s linear .55s;
  animation: sp-failsafe .5s ease 4.2s forwards; /* sin JavaScript también se oculta */ }
.splash::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.4px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000, transparent 70%); mask-image: radial-gradient(circle at 50% 45%, #000, transparent 70%); }
.splash.done { opacity: 0; transform: scale(1.04); visibility: hidden; pointer-events: none; }
html.no-splash .splash { display: none; }
@keyframes sp-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.sp-inner { position: relative; display: grid; justify-items: center; gap: 20px; padding: 24px; text-align: center; }
.sp-orb { position: relative; width: 168px; height: 168px; display: grid; place-items: center; }
.sp-orb::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 167, 44, .35), transparent 70%); animation: sp-glow 2.2s ease-in-out infinite; }
.sp-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #e4bb4a; border-right-color: rgba(228, 187, 74, .35); animation: sp-spin 1.6s linear infinite; }
.sp-ring.r2 { inset: 14px; border-top-color: rgba(255, 255, 255, .75); border-right-color: transparent; border-left-color: rgba(255, 255, 255, .2); animation-duration: 2.4s; animation-direction: reverse; }
.sp-cap { position: relative; width: 84px; height: auto; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); animation: sp-pop .9s cubic-bezier(.2, 1.3, .3, 1) both, sp-float 3s 1s ease-in-out infinite; }
.sp-logo { width: 150px; height: auto; opacity: 0; animation: sp-rise .8s .45s ease forwards; -webkit-mask-image: linear-gradient(100deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); mask-image: linear-gradient(100deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); -webkit-mask-size: 250% 100%; mask-size: 250% 100%; }
.sp-logo { animation: sp-rise .8s .45s ease forwards, sp-shine 2.4s 1.2s ease-in-out infinite; }
.sp-tag { margin: 0; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: #f3e0a3; opacity: 0; animation: sp-rise .8s .75s ease forwards; font-family: 'Poppins', system-ui, sans-serif; font-weight: 500; }
.sp-bar { width: 170px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; opacity: 0; animation: sp-rise .6s .9s ease forwards; }
.sp-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, #d4a72c, #ffe600); animation: sp-load 1.5s .9s ease-in-out infinite; }

.sp-dot { position: absolute; bottom: -20px; width: 8px; height: 8px; border-radius: 50%; background: rgba(228, 187, 74, .75); box-shadow: 0 0 14px rgba(228, 187, 74, .8); animation: sp-up 6s linear infinite; }
.sp-dot.d1 { left: 8%; animation-duration: 6.5s; } .sp-dot.d2 { left: 22%; width: 5px; height: 5px; animation-duration: 5s; animation-delay: .8s; }
.sp-dot.d3 { left: 37%; animation-duration: 7s; animation-delay: 1.6s; } .sp-dot.d4 { left: 52%; width: 6px; height: 6px; animation-duration: 5.5s; animation-delay: .3s; }
.sp-dot.d5 { left: 66%; animation-duration: 6.2s; animation-delay: 2s; } .sp-dot.d6 { left: 78%; width: 5px; height: 5px; animation-duration: 4.8s; animation-delay: 1.2s; }
.sp-dot.d7 { left: 88%; animation-duration: 7.2s; animation-delay: .5s; } .sp-dot.d8 { left: 45%; width: 4px; height: 4px; animation-duration: 5.2s; animation-delay: 2.6s; }

@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-glow { 50% { transform: scale(1.18); opacity: .55; } }
@keyframes sp-pop { from { transform: scale(.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sp-float { 50% { transform: translateY(-7px); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sp-shine { from { -webkit-mask-position: 130% 0; mask-position: 130% 0; } to { -webkit-mask-position: -30% 0; mask-position: -30% 0; } }
@keyframes sp-load { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }
@keyframes sp-up { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-105vh) scale(.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sp-ring, .sp-dot, .sp-orb::before, .sp-bar i, .sp-cap { animation: none !important; }
  .sp-logo, .sp-tag, .sp-bar { animation: none !important; opacity: 1; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- Base tipo app ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
a, button, summary, label, select, .tab, .pill, .card, .btn { touch-action: manipulation; }
@media (hover: none) {
  .btn:active, .card:active, .course-card:active, .ev-card:active, .tab:active, .pill:active { transform: scale(.975); transition: transform .08s; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html.standalone main, html.standalone .content { animation: page-in .35s ease both; }

/* ---------- Instalar app ---------- */
.install-btn { display: none; }
.install-btn.show { display: inline-flex; }

/* Pantalla de carga: se adapta a pantallas bajas y muy grandes */
@media (max-height: 520px) { .sp-orb { width: 108px; height: 108px; } .sp-cap { width: 56px; } .sp-logo { width: 104px; } .sp-inner { gap: 10px; padding: 12px; } .sp-tag { font-size: .7rem; } }
@media (min-width: 1500px) { .sp-orb { width: 200px; height: 200px; } .sp-cap { width: 100px; } .sp-logo { width: 190px; } .sp-tag { font-size: .95rem; } .sp-bar { width: 220px; } }
