/* Shared full-page loader for authenticated ArchLenz360 workspaces. */
.auth-loading,
#authGate {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--bg, #f7f7f6);
  color: var(--text-primary, #171717);
  text-align: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-loading.is-hidden,
#authGate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  max-width: 100%;
}

.workspace-loader-spinner {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.workspace-progress-ring {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.workspace-progress-segment {
  fill: none;
  stroke: var(--border-color, #d1d5db);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 8 5;
}

.workspace-progress-segment--active {
  stroke: var(--text-primary, #171717);
  stroke-dasharray: 8 5 8 5 8 70;
  transform-box: fill-box;
  transform-origin: center;
  animation: workspace-progress-advance 1.1s linear infinite;
}

.loading-text {
  margin-top: 0;
  color: var(--text-primary, #171717);
  font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.3rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-align: center;
  overflow-wrap: anywhere;
}

[data-theme="dark"] .auth-loading,
[data-theme="dark"] #authGate {
  background: var(--bg, #0a0a0b);
  color: var(--text-primary, #f5f5f5);
}

[data-theme="dark"] .workspace-progress-segment {
  stroke: var(--border-color, #4b5563);
}

[data-theme="dark"] .workspace-progress-segment--active {
  stroke: var(--text-primary, #fff);
}

@keyframes workspace-progress-advance {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-progress-segment--active {
    animation: none;
  }

  .auth-loading,
  #authGate {
    transition-duration: 0.01ms;
  }
}
