/* Loaded before JavaScript so startup and page transitions use the same spinner. */
body { margin: 0; }

.app-loading {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 240px;
  padding: 24px 16px;
}

.app-loading--fullscreen {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--color-soft, #F8F6FF);
}

.app-loading-spinner {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-lavender, #E8E3FF);
  border-top-color: var(--color-purple, #5B3FD6);
  border-radius: 50%;
  animation: app-loading-spin .8s linear infinite;
}

.app-loading-overlay { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; background: #F8F6FFDD; }

/* Recovery must remain styled when a page's JavaScript or stylesheet cannot load. */
.app-recovery { box-sizing: border-box; display: grid; place-items: center; min-height: 420px; padding: 32px 20px; color: #1E1B4B; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.app-recovery--fullscreen { min-height: 100vh; min-height: 100svh; background: #F8F6FF; }
.app-recovery-card { box-sizing: border-box; width: 100%; max-width: 440px; padding: 36px 28px; border: 1px solid #E8E3FF; border-radius: 24px; background: #fff; box-shadow: 0 16px 48px #1E1B4B08; text-align: center; }
.app-recovery .public-wordmark { display: inline-flex; align-items: center; gap: 9px; color: #1E1B4B; font-size: 19px; font-weight: 750; text-align: left; }
.app-recovery .public-wordmark b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #5B3FD6; color: #fff; font-size: 21px; }
.app-recovery .public-wordmark small { display: block; margin-top: 3px; font-size: 8px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; }
.app-recovery-icon { display: grid; place-items: center; width: 80px; height: 80px; margin: 32px auto 20px; border-radius: 24px; background: #F8F6FF; color: #5B3FD6; }
.app-recovery h1 { margin: 0 0 12px; font-size: clamp(23px, 4vw, 28px); line-height: 1.2; letter-spacing: -.8px; }
.app-recovery p { margin: 0 auto 26px; max-width: 330px; color: #655B85; font-size: 14px; line-height: 1.7; }
.app-recovery-button { min-height: 44px; padding: 12px 24px; border: 0; border-radius: 12px; background: #5B3FD6; color: #fff; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.app-recovery-button:hover { background: #4930B8; }
.app-recovery-button:focus-visible { outline: 3px solid #5B3FD6; outline-offset: 4px; }
.app-recovery-button:disabled { background: #E8E3FF; color: #655B85; cursor: default; }
@keyframes app-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .app-loading-spinner { animation: none; }
}
