/* Shared modal behavior for every toast in the project. */
html.app-toast-open,
body.app-toast-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

html.app-toast-open:not(.plan-toast-open)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(2, 6, 23, 0.62);
  pointer-events: auto;
}

/* Full-screen brand reveal used only while the app's initial route is ready. */
.app-launch-splash {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #0b1635;
  background: #05021b;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.38s ease,
    visibility 0s linear 0.38s;
}

.app-launch-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* A route gate hides the body before auth is known; keep the launch layer
   explicitly visible so the user sees the branded startup screen. */
html.project-route-pending .app-launch-splash {
  visibility: visible;
}

html.app-launch-skip .app-launch-splash {
  display: none;
}

html.app-launch-pending .container,
html.app-launch-pending #page-content,
html.app-launch-pending .footer-cut {
  visibility: hidden !important;
}

html.app-launch-pending .container {
  opacity: 0 !important;
}

.app-launch-splash__content {
  display: grid;
  justify-items: center;
  width: min(72vw, 220px);
  animation: app-launch-content-in 0.42s ease-out both;
}

.app-launch-splash__logo {
  display: block;
  width: min(52vw, 200px);
  height: auto;
  object-fit: contain;
  border-radius: 0;
  transform: none !important;
  filter: drop-shadow(0 12px 26px rgba(15, 23, 42, 0.12));
  animation: none !important;
}

.app-launch-splash__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 12px;
  margin-top: 20px;
}

.app-launch-splash__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.35;
  animation: app-launch-dot-pulse 1s ease-in-out infinite;
}

.app-launch-splash__dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.app-launch-splash__dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes app-launch-content-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes app-launch-dot-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.72);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-launch-splash__content,
  .app-launch-splash__logo {
    animation: none;
  }

  .app-launch-splash__dots span {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
