/*
 * Namirial design system - ajax loader (SWEIDAW-3530).
 * DS v2 (Namirial Design System 2026): track --nds-border, arc
 * --nds-foreground-accent, text --nds-foreground, dialog onto the DS overlay
 * tokens (radius-lg "large cards, dialogs", shadow-second-floor "popovers, dialogs").
 * Loaded only for the default Namirial template.
 *
 * The var() fallbacks (v2 hex values) MUST stay: template-vouchercreation.xhtml and
 * template-registration-public.xhtml load this file WITHOUT namirial-ds-tokens.css.
 */

.nds-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

.nds-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--nds-border, #d6d9b9);
  border-top-color: var(--nds-foreground-accent, #376100);
  border-radius: 50%;
  animation: nds-spin 0.8s linear infinite;
  box-sizing: border-box;
}

@keyframes nds-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nds-spinner { animation-duration: 2s; }
}

.nds-loader-text {
  color: var(--nds-foreground, #090908);
  font-size: 14px;
}

/* Status dialog restyling, only when it hosts the NDS loader
   (partners keep the default PrimeFaces dialog chrome). */
.ui-dialog:has(.nds-loader) {
  border-radius: var(--nds-radius-lg, 16px);
  border: 0;
  box-shadow: var(--nds-shadow-second-floor, 0 2px 24px 0 rgba(9, 9, 8, 0.15));
}

/* The status dialog has no header text: drop the empty titlebar. */
.ui-dialog:has(.nds-loader) .ui-dialog-titlebar:empty,
.ui-dialog:has(.nds-loader) .ui-dialog-titlebar:not(:has(.ui-dialog-title:not(:empty))) {
  display: none;
}
