/* ============================================================
   busy.css — PS-1425: the busy pop-up (busy.js).

   A full-screen layer that blocks the page at once (transparent), then — once the wait has lasted long enough to
   be worth saying — dims the page and shows a centred card with a rotating spinner and "Processing, please wait".
   Above Bootstrap's modals (1050) and the side drawers, so an action started inside a dialog is covered too.
   Colours come from the theme tokens, so light and dark follow the theme toggle.
   ============================================================ */

.secuura-busy {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: transparent;
  cursor: progress;
  outline: none;
  transition: background-color 150ms ease;
}

.secuura-busy--visible {
  background-color: hsl(var(--foreground) / 0.35);
}

.secuura-busy__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 15rem;
  max-width: calc(100vw - 2rem);
  padding: 1.75rem 2rem;
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.2);
  font-family: var(--font-sans);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease;
}

.secuura-busy--visible .secuura-busy__card {
  opacity: 1;
  visibility: visible;
}

.secuura-busy__spinner {
  display: inline-block;
  width: 2.5rem;
  height: 2.5rem;
  border: 4px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: secuura-busy-spin 800ms linear infinite;
}

.secuura-busy__message {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
}

@keyframes secuura-busy-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Reduced motion: no rotation and no fades — a still ring and the message say the same thing. */
@media (prefers-reduced-motion: reduce) {
  .secuura-busy,
  .secuura-busy__card { transition: none; }
  .secuura-busy__spinner {
    animation: none;
    border-color: hsl(var(--primary));
  }
}
