/* PoliPlan boot / splash — shared by index.html #app-boot and AppBootLoader */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@700&display=swap');

#app-boot,
.app-boot-loader {
  --boot-bg-center: #f4f5fb;
  --boot-bg-mid: #e7eaf5;
  --boot-bg-edge: #dde2f4;
  --boot-wordmark-dark: #1e293b;
  --boot-wordmark-accent: #3b5bdb;
  --boot-tagline: #64748b;
  --boot-dot: #3b5bdb;
  --boot-blob: rgba(59, 91, 219, 0.16);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(
    ellipse 120% 80% at 50% 38%,
    var(--boot-bg-center) 0%,
    var(--boot-bg-mid) 52%,
    var(--boot-bg-edge) 100%
  );
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  min-height: 100dvh;
  min-height: 100vh;
}

html.dark #app-boot,
html.dark .app-boot-loader {
  --boot-bg-center: #121829;
  --boot-bg-mid: #0e1424;
  --boot-bg-edge: #0b1020;
  --boot-wordmark-dark: #f1f5f9;
  --boot-wordmark-accent: #6b8cff;
  --boot-tagline: #94a3b8;
  --boot-dot: #6b8cff;
  --boot-blob: rgba(107, 140, 255, 0.14);
}

.app-boot-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.app-boot-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--boot-blob);
  filter: blur(72px);
  will-change: transform;
}

.app-boot-blob--1 {
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  top: 6%;
  left: -18%;
}

.app-boot-blob--2 {
  width: min(64vw, 280px);
  height: min(64vw, 280px);
  top: 52%;
  right: -14%;
}

.app-boot-blob--3 {
  width: min(56vw, 240px);
  height: min(56vw, 240px);
  bottom: 8%;
  left: 18%;
}

.app-boot-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  max-width: 100%;
}

.app-boot-hero img,
.app-boot-loader .app-boot-hero img {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.app-boot-copy {
  margin-top: 1.125rem;
  opacity: 0;
  transform: translateY(0.35rem);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.app-boot-copy.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-boot-wordmark {
  margin: 0;
  font-family: 'Lexend', system-ui, -apple-system, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.app-boot-wordmark-pol {
  color: var(--boot-wordmark-dark);
}

.app-boot-wordmark-plan {
  color: var(--boot-wordmark-accent);
}

.app-boot-tagline {
  margin: 0.4rem 0 0;
  font:
    400 0.84375rem/1.45 system-ui,
    -apple-system,
    sans-serif;
  color: var(--boot-tagline);
}

.app-boot-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  min-height: 0.5rem;
}

.app-boot-dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--boot-dot);
  opacity: 0.35;
  animation: app-boot-dot-pulse 1.2s ease-in-out infinite;
}

.app-boot-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.app-boot-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

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

  40% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.app-boot-status {
  margin: 0.65rem 0 0;
  min-height: 1.25rem;
  font:
    500 0.8125rem/1.4 system-ui,
    -apple-system,
    sans-serif;
  color: var(--boot-tagline);
  opacity: 0;
  transform: translateY(0.2rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.app-boot-status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-copy {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .app-boot-dots span {
    animation: none;
    opacity: 0.55;
  }

  .app-boot-status {
    transition: none;
  }
}

/* Inline / non-fullscreen variant (AppBootLoader) */
.app-boot-loader:not(.app-boot-loader--fullscreen) {
  position: relative;
  inset: auto;
  z-index: auto;
  min-height: auto;
  background: transparent;
  padding: 2rem 1.5rem;
}

.app-boot-loader:not(.app-boot-loader--fullscreen) .app-boot-blobs {
  display: none;
}
