/*
 * spinner.css — ANZ v3 Spinner Component
 *
 * Namespace: .anz-v3-spinner
 * Covers: loading states (Pacific Blue + prefers-reduced-motion)
 * All selectors scoped: body.anz-v3 .anz-v3-spinner*
 * No hex values — var(--...) only.
 *
 * Phase 4 pages: loading modal (DIGITAL-6475), any async state
 * Provenance: IA spec §6.3 (motion — prefers-reduced-motion mandatory)
 */


/* ===================================================================
 * SPINNER WRAPPER
 * =================================================================== */

body.anz-v3 .anz-v3-spinner-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  justify-content: center;
  padding: var(--space-8);
}


/* ===================================================================
 * SPINNER — circular rotating ring
 * Pacific Blue per brand §1.2 as primary identity colour
 * =================================================================== */

body.anz-v3 .anz-v3-spinner {
  animation: anz-v3-spin 0.9s linear infinite;
  border: 3px solid var(--anz-grey-2);
  border-radius: var(--radius-pill);
  border-top-color: var(--anz-pacific-blue);
  display: inline-block;
  flex-shrink: 0;
  height: 40px;
  width: 40px;
}

@keyframes anz-v3-spin {
  to {
    transform: rotate(360deg);
  }
}


/* ===================================================================
 * SIZE MODIFIERS
 * =================================================================== */

body.anz-v3 .anz-v3-spinner--sm {
  border-width: 2px;
  height: 20px;
  width: 20px;
}

body.anz-v3 .anz-v3-spinner--lg {
  border-width: 4px;
  height: 64px;
  width: 64px;
}


/* ===================================================================
 * LABEL
 * =================================================================== */

body.anz-v3 .anz-v3-spinner__label {
  color: var(--text-secondary);
  font-size: var(--type-body-s-size);
  line-height: var(--type-body-s-lh);
  text-align: center;
}


/* ===================================================================
 * INLINE VARIANT — spinner next to button text
 * =================================================================== */

body.anz-v3 .anz-v3-spinner--inline {
  border-width: 2px;
  display: inline-block;
  height: 16px;
  margin-right: var(--space-2);
  vertical-align: middle;
  width: 16px;
}


/* ===================================================================
 * FULL-PAGE OVERLAY VARIANT
 * =================================================================== */

body.anz-v3 .anz-v3-spinner-overlay {
  align-items: center;
  background-color: var(--anz-deep-sea);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0.85;
  position: fixed;
  z-index: 600000;
}

body.anz-v3 .anz-v3-spinner-overlay .anz-v3-spinner {
  border-color: var(--anz-cloud-white);
  border-top-color: var(--anz-clear-skies);
}


/* ===================================================================
 * ANZ v3 LOADING MODAL — branded redesign
 * Targets [data-v3-modal="loading"] — legacy markup uses .modal
 * .anz-v3__modal. Renders a centred Cloud White panel on a dimmed
 * Deep Sea backdrop with a Pacific Blue spinner and brand typography.
 * =================================================================== */

body.anz-v3 .modal.anz-v3__modal {
  background-color: rgba(29, 22, 76, 0.72);
  padding: var(--space-6, 24px);
}

body.anz-v3 .modal.anz-v3__modal .modal-dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

body.anz-v3 #ModalLoading .modal-content,
body.anz-v3 .modal.anz-v3__modal .modal-content {
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 64px rgba(29, 22, 76, 0.40) !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: relative !important;
}
body.anz-v3 #ModalLoading .modal-header {
  background: linear-gradient(135deg, #0572E6 0%, #0866ce 100%) !important;
}
body.anz-v3 #ModalLoading .modal-body {
  background-color: #ffffff !important;
  position: relative;
}
/* Pacific-Blue tint band along the top of the body so the modal reads
   as a single branded unit even when Bootstrap holds the body white. */
body.anz-v3 #ModalLoading .modal-body::before {
  background: linear-gradient(180deg, rgba(5,114,230,0.08) 0%, transparent 100%);
  content: "";
  inset: 0 0 auto 0;
  height: 40px;
  position: absolute;
  pointer-events: none;
}

/* Soft bubble ornaments echo the login hero aesthetic */
body.anz-v3 .modal.anz-v3__modal .modal-content::before,
body.anz-v3 .modal.anz-v3__modal .modal-content::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
body.anz-v3 .modal.anz-v3__modal .modal-content::before {
  width: 280px;
  height: 280px;
  right: -110px;
  top: -90px;
  background: rgba(138, 218, 249, 0.18);
}
body.anz-v3 .modal.anz-v3__modal .modal-content::after {
  width: 200px;
  height: 200px;
  left: -70px;
  bottom: -80px;
  background: rgba(255, 255, 255, 0.10);
}

/* Loading-modal specific header/body/title overrides (scoped to #ModalLoading).
 * 2026-04-20 polish batch (R9): the previous selector
 * `body.anz-v3 .modal.anz-v3__modal .modal-header` was too broad and also
 * stripped the Pacific Blue header from ModalMessage (the shared validation-
 * error modal), making it look like a default Bootstrap modal inside a
 * polished ANZ surface. Scoping to #ModalLoading keeps the Loading modal's
 * intentional transparent-header-over-gradient-content look while letting
 * v3-shell.css Tier-1 `.modal-header { background: var(--surface-inverse) }`
 * win for all other anz-v3 modals. */
body.anz-v3 #ModalLoading .modal-header {
  background: transparent;
  border-bottom: 0;
  padding: var(--space-6, 24px) var(--space-6, 24px) var(--space-3, 12px);
  position: relative;
  text-align: center;
  z-index: 1;
}

body.anz-v3 #ModalLoading .modal-title {
  color: var(--anz-cloud-white);
  font-family: 'Aeonik', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

body.anz-v3 #ModalLoading .modal-body {
  background: transparent !important;
  background-color: transparent !important;
  padding: var(--space-6, 24px) var(--space-6, 24px) var(--space-8, 32px);
  position: relative;
  z-index: 1;
}

body.anz-v3 #ModalLoading .modal-header {
  background: transparent !important;
  background-color: transparent !important;
}

body.anz-v3 .modal.anz-v3__modal .anz-v3-spinner-wrap {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5, 20px);
  padding: var(--space-5, 20px) 0;
  position: relative;
  z-index: 2;
  min-height: 140px;
}

body.anz-v3 .modal.anz-v3__modal .anz-v3-spinner {
  border-color: var(--anz-clear-skies-ultrasoft, #E2F6FD);
  border-top-color: var(--anz-pacific-blue);
  border-width: 4px;
  height: 60px;
  width: 60px;
}

body.anz-v3 .modal.anz-v3__modal .anz-v3-spinner__label {
  color: var(--anz-pacific-blue);
  font-family: 'Aeonik', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
  text-align: center;
}


/* ===================================================================
 * REDUCED MOTION — show static indicator instead of spinning ring
 * =================================================================== */

@media (prefers-reduced-motion: reduce) {
  body.anz-v3 .anz-v3-spinner {
    animation: none;
    border-color: var(--anz-pacific-blue);
    border-top-color: var(--anz-pacific-blue);
    opacity: 0.5;
  }
}
