/* PACESOFT RUNNING — PWA SPLASH v1.2 iOS */

html.pwa-splash-pending {
  min-height: 100%;
  background: #07112b;
}

html.pwa-splash-pending body {
  visibility: hidden !important;
}

html.pwa-splash-active,
html.pwa-splash-active body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.pwa-launch-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.5rem
           calc(1.5rem + env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(20, 195, 255, .24), transparent 35%),
    radial-gradient(circle at 18% 82%, rgba(255, 31, 151, .28), transparent 38%),
    linear-gradient(145deg, #050b20 0%, #0b173b 52%, #101d46 100%);
  opacity: 0;
  transform: scale(1.018);
  transition: opacity .35s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}

.pwa-launch-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .23;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 24%, #000 76%, transparent 100%);
}

.pwa-launch-splash::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -34%;
  z-index: -1;
  width: min(118vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(23, 188, 255, .2), transparent 62%);
  filter: blur(10px);
}

.pwa-launch-splash.is-visible {
  opacity: 1;
  transform: scale(1);
}

.pwa-launch-splash.is-leaving {
  opacity: 0;
  transform: scale(.985);
  pointer-events: none;
}

.pwa-splash-content {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pwa-splash-logo-wrap {
  position: relative;
  width: clamp(112px, 30vw, 148px);
  aspect-ratio: 1;
  margin-bottom: 1.55rem;
}

.pwa-splash-logo-wrap img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 27%;
  box-shadow:
    0 26px 65px rgba(0, 0, 0, .42),
    0 0 0 1px rgba(255, 255, 255, .16),
    0 0 44px rgba(30, 174, 255, .2);
  animation: pwa-splash-float 2.4s ease-in-out infinite;
}

.pwa-splash-logo-halo {
  position: absolute;
  inset: -22%;
  z-index: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 10deg,
    rgba(255, 155, 18, .48),
    rgba(255, 26, 139, .56),
    rgba(124, 48, 255, .48),
    rgba(0, 190, 255, .52),
    rgba(255, 155, 18, .48)
  );
  filter: blur(32px);
  opacity: .58;
  animation: pwa-splash-halo 4.8s linear infinite;
}

.pwa-splash-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .28em;
  color: rgba(220, 232, 255, .74);
}

.pwa-splash-kicker::before,
.pwa-splash-kicker::after {
  content: '';
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65));
}

.pwa-splash-kicker::after {
  transform: scaleX(-1);
}

.pwa-splash-brand h1 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.45rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .28);
}

.pwa-splash-brand p {
  margin: .78rem 0 0;
  color: rgba(226, 235, 255, .78);
  font-size: clamp(.92rem, 3.6vw, 1rem);
  line-height: 1.45;
}

.pwa-splash-loader {
  position: relative;
  width: min(76%, 245px);
  height: 4px;
  margin-top: 2rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .28);
}

.pwa-splash-loader-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9a13, #ff218f 46%, #18bfff);
  box-shadow: 0 0 18px rgba(28, 192, 255, .45);
  animation: pwa-splash-progress 1.25s cubic-bezier(.55, 0, .35, 1) infinite;
}

.pwa-splash-dots {
  display: flex;
  gap: .42rem;
  margin-top: 1.15rem;
}

.pwa-splash-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .64);
  animation: pwa-splash-dot 1.1s ease-in-out infinite;
}

.pwa-splash-dots span:nth-child(2) {
  animation-delay: .14s;
}

.pwa-splash-dots span:nth-child(3) {
  animation-delay: .28s;
}

.pwa-splash-orb {
  position: absolute;
  z-index: -1;
  width: min(56vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(24px);
  opacity: .2;
  pointer-events: none;
}

.pwa-splash-orb-one {
  top: -12%;
  right: -14%;
  background: #18bfff;
  animation: pwa-splash-drift-one 7s ease-in-out infinite alternate;
}

.pwa-splash-orb-two {
  left: -18%;
  bottom: -16%;
  background: #ff218f;
  animation: pwa-splash-drift-two 8s ease-in-out infinite alternate;
}

@keyframes pwa-splash-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.012); }
}

@keyframes pwa-splash-halo {
  to { transform: rotate(360deg); }
}

@keyframes pwa-splash-progress {
  0% { left: -45%; width: 34%; }
  52% { width: 56%; }
  100% { left: 112%; width: 32%; }
}

@keyframes pwa-splash-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: .42; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes pwa-splash-drift-one {
  to { transform: translate(-12%, 14%) scale(1.12); }
}

@keyframes pwa-splash-drift-two {
  to { transform: translate(16%, -10%) scale(.9); }
}

@media (min-width: 768px) {
  .pwa-splash-content {
    transform: translateY(-2vh);
  }

  .pwa-splash-logo-wrap {
    margin-bottom: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-launch-splash,
  .pwa-splash-logo-wrap img,
  .pwa-splash-logo-halo,
  .pwa-splash-loader-bar,
  .pwa-splash-dots span,
  .pwa-splash-orb {
    animation: none !important;
    transition-duration: .01ms !important;
  }

  .pwa-splash-loader-bar {
    left: 0;
    width: 100%;
  }
}


/* Durante la splash i campi di accesso restano non interattivi.
   Vengono riattivati soltanto dopo la dissolvenza completa. */
html.pwa-splash-pending [data-pwa-auth-form],
html.pwa-splash-active [data-pwa-auth-form],
html.pwa-splash-leaving [data-pwa-auth-form] {
  pointer-events: none;
  user-select: none;
}
