/* The same brand mark is used by the initial screen and in-page loaders. */
@keyframes app-loading-spin { to { transform: rotate(1turn); } }
@keyframes site-loading-reveal { to { visibility: inherit; } }

.site-loading-status::before,
.site-loading-region[aria-busy="true"]:has(> iframe)::before {
  content: "";
  width: 48px;
  height: 48px;
  background: url("/img/favicon.svg") center / 36px 36px no-repeat;
  visibility: hidden;
  animation: site-loading-reveal 0s 160ms forwards;
  pointer-events: none;
}

.site-loading-status::before {
  display: block;
  margin: 0 auto 8px;
}

.site-loading-region[aria-busy="true"]:has(> iframe) {
  position: relative;
  isolation: isolate;
}
.site-loading-region[aria-busy="true"]:has(> iframe)::before {
  position: absolute;
  z-index: -1;
  inset-block-start: clamp(0px, calc(50% - 24px), 100px);
  inset-inline-start: calc(50% - 24px);
  border-radius: 50%;
  background-color: #f4f6fb;
}

.owner-boot-loading {
  position: fixed;
  z-index: 2;
  inset: 40% 0 auto;
  text-align: center;
  pointer-events: none;
}
body:not(.auth-pending) > .owner-boot-loading,
body:has(> #workspace:not([hidden])) > .owner-boot-loading,
body.auth-pending:has(> .owner-boot-loading) > #login-screen { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .site-loading-status::before,
  .site-loading-region[aria-busy="true"]:has(> iframe)::before {
    animation: site-loading-reveal 0s 160ms forwards, app-loading-spin 1.4s 160ms linear infinite;
  }
}
