/* Shared by the HTML boot screen, React shells and portal overlays. */
:root {
  --zanbil-page-bg: #fff7f5;
  --zanbil-surface: #ffffff;
  --zanbil-text: #0f172a;
  --zanbil-muted: #70636a;
  --zanbil-accent: #b8443b;
  --zanbil-accent-strong: #98372f;
  --zanbil-tint: #fce9e4;
  --zanbil-border: #efdad4;
  --zanbil-shadow: 0 8px 28px rgba(152, 55, 47, 0.08);
  --zanbil-loading-glow: #f4c6b9;
  --zanbil-loading-glow-secondary: #f5e3c9;
  --zanbil-loading-ring: rgba(152, 55, 47, 0.07);
  --zanbil-loading-background:
    radial-gradient(ellipse at 8% 12%, var(--zanbil-loading-glow), transparent 52%),
    radial-gradient(ellipse at 92% 88%, var(--zanbil-loading-glow-secondary), transparent 52%),
    var(--zanbil-page-bg);
  color-scheme: light;
  background: var(--zanbil-page-bg);
}

:root[data-zanbil-theme="organization"] {
  --zanbil-page-bg: #f3f6fa;
  --zanbil-muted: #53657b;
  --zanbil-accent: #244b73;
  --zanbil-accent-strong: #173755;
  --zanbil-tint: #e7eef6;
  --zanbil-border: #d8e2ee;
  --zanbil-shadow: 0 8px 28px rgba(23, 55, 85, 0.08);
  --zanbil-loading-glow: #c4d7ec;
  --zanbil-loading-glow-secondary: #d0e5e2;
  --zanbil-loading-ring: rgba(23, 55, 85, 0.07);
}

:root body {
  margin: 0;
  padding: 0;
  background: var(--zanbil-page-bg);
}

img[src*="zanbil-logo"] { background: transparent; }

.zanbilLoading {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: var(--zanbil-loading-background);
  color: var(--zanbil-text);
  direction: rtl;
  text-align: center;
  font-family: BYekan, system-ui, sans-serif;
  overflow: auto;
  isolation: isolate;
}

.zanbilLoading::before,
.zanbilLoading::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

.zanbilLoading::before {
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8), transparent 65%);
  background-size: 150% 150%;
  animation: zanbilLoadingGlow 16s ease-in-out infinite alternate;
}

.zanbilLoading::after {
  width: min(82vw, 620px);
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--zanbil-loading-ring);
  border-radius: 50%;
  box-shadow: 0 0 0 48px var(--zanbil-loading-ring), 0 0 0 96px var(--zanbil-loading-ring);
  opacity: 0.35;
}

.zanbilLoadingContent {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.zanbilLoadingLogo { width: 110px; height: 110px; object-fit: contain; margin-bottom: 20px; }
.zanbilLoadingTitle { font-size: 1.2rem; font-weight: 800; line-height: 1.7; color: var(--zanbil-text); }
.zanbilLoadingMessage { font-size: 0.9rem; line-height: 1.9; color: var(--zanbil-muted); margin: 6px 0 22px; }
.zanbilLoadingTrack { width: 160px; height: 4px; overflow: hidden; background: var(--zanbil-border); border-radius: 12px; }
.zanbilLoadingBar { height: 100%; width: 45%; border-radius: inherit; background: var(--zanbil-accent); animation: zanbilLoad 1.5s ease-in-out infinite alternate; }
.zanbilLoadingRetry { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 12px 24px; color: white; background: var(--zanbil-accent); }
.zanbilLoadingRetry:hover { background: var(--zanbil-accent-strong); }
.zanbilLoadingRetry:focus-visible { outline: 3px solid var(--zanbil-accent); outline-offset: 4px; }
@keyframes zanbilLoad { from { transform: translateX(110%); } to { transform: translateX(-220%); } }
@keyframes zanbilLoadingGlow { from { background-position: 0% 20%; } to { background-position: 100% 80%; } }
@media (prefers-reduced-motion: reduce) {
  .zanbilLoading::before { animation: none; background-position: center; }
  .zanbilLoadingBar { animation: none; width: 100%; }
}
