/**
 * Critical first-paint styles for premium boot.
 * Prevents legacy cream shell from being the visible fallback while session/route resolve.
 */

html[data-ui-state="booting-premium"],
html[data-ui-state="error-premium"] {
  color-scheme: dark;
  background: #050912;
}

html[data-ui-state="booting-premium"] body,
html[data-ui-state="error-premium"] body {
  margin: 0;
  min-height: 100%;
  background: #050912 !important;
  color: #f5f7fb !important;
}

/* Hide legacy boot fragment if still present in #pickit-root */
html[data-ui-state="booting-premium"] #pickit-root > .pk-boot:not(.pk-premium-boot),
html[data-ui-state="booting-premium"] .pk-boot__title,
html[data-ui-state="booting-premium"] .pk-boot__hint {
  display: none !important;
}

html[data-ui-state="booting-premium"] #pickit-root,
html[data-ui-state="error-premium"] #pickit-root {
  opacity: 0;
  pointer-events: none;
}

html[data-ui-state="ready"] #pickit-root {
  opacity: 1;
  pointer-events: auto;
}

html[data-ui-state="ready"] #pickit-root {
  transition: opacity 120ms ease;
}

.pk-premium-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 32px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 140, 255, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 90, 19, 0.1), transparent 50%),
    #050912;
  color: #f5f7fb;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.pk-premium-boot__logo {
  display: block;
  width: 180px;
  height: 48px;
  object-fit: contain;
  object-position: center;
}

.pk-premium-boot__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(194, 204, 218, 0.22);
  border-top-color: #ff5a13;
  animation: pk-premium-boot-spin 0.8s linear infinite;
}

.pk-premium-boot__hint {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #7f8ea3;
  font-weight: 500;
}

.pk-premium-boot__error {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #c2ccda;
}

html[data-ui-state="ready"] .pk-premium-boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, visibility 0s linear 120ms;
}

html[data-ui-state="error-premium"] .pk-premium-boot__spinner {
  display: none;
}

@keyframes pk-premium-boot-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pk-premium-boot__spinner {
    animation: none;
    border-top-color: rgba(194, 204, 218, 0.45);
  }

  html[data-ui-state="ready"] #pickit-root,
  html[data-ui-state="ready"] .pk-premium-boot {
    transition: none;
  }
}
