/**
 * Soft page-load overlay — spinner on an opaque cover.
 * Opaque so default/static HTML (brand, nav, labels) never flashes through
 * before boot applies theme, locale, and custom portal branding.
 */

html.plo-lock,
html.plo-lock body {
  overflow: hidden;
}

/*
 * Hide real chrome until boot removes plo-lock (overlay stays visible).
 * Keep <dialog> visible: Safari can drop an open modal from the top layer when
 * visibility:hidden is applied during boot/hash loader — then login jumps and
 * the complete-profile form never appears.
 */
html.plo-lock body > :not(#pageLoadOverlay):not(dialog) {
  visibility: hidden !important;
}
html.plo-lock dialog {
  visibility: visible !important;
}

.plo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1.5rem;
  border: 0;
  /* Match app canvas so the reveal does not flash a foreign color */
  background: var(--c-gray-f0);
  pointer-events: all;
  opacity: 1;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .plo-overlay {
  background: var(--c-gray-0a);
}

.plo-overlay.plo-overlay--out {
  opacity: 0;
  pointer-events: none;
}

.plo-mark {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
}

.plo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--c-mint) 35%, transparent);
  border-top-color: var(--c-mint);
  animation: plo-spin 0.9s linear infinite;
}

.plo-core {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-mint), var(--c-white));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-white) 12%, transparent);
}

@keyframes plo-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .plo-overlay {
    transition: none;
  }
  .plo-ring {
    animation: none;
    border-color: var(--c-mint);
  }
}
