/*
 * TRANSiA brand loading overlay.
 *
 * Shown while the browser is fetching the next page (form submits and in-app
 * navigation) and by any script that wants to block the screen during async
 * work — see assets/js/loader.js for the API.
 *
 * The overlay is always in the DOM once the script has run; only `.is-on`
 * makes it visible, so showing and hiding never reflows the page underneath.
 */

.tx-loader {
  position: fixed;
  inset: 0;
  z-index: 12000;            /* above the dialog backdrop (9000) and chatbot */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.tx-loader.is-on {
  opacity: 1;
  visibility: visible;
}

.tx-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* The mark sits inside a ring that traces around it. */
.tx-loader-mark {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.tx-loader-mark img {
  width: 56px;
  height: 56px;
  display: block;
  animation: tx-loader-pulse 1.6s ease-in-out infinite;
}

.tx-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(0, 194, 194, .16);
  border-top-color: #00C2C2;
  border-right-color: #00C2C2;
  animation: tx-loader-spin .9s linear infinite;
}

.tx-loader-text {
  margin: 0;
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #475569;
}

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

@keyframes tx-loader-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(.90);  opacity: .72; }
}

/* Accessibility: the profile toggle and the OS setting both kill the motion.
   The ring stays as a static brand-coloured arc so the overlay still reads as
   "busy" rather than as a frozen screen. */
[data-motion="reduced"] .tx-loader-ring,
[data-motion="reduced"] .tx-loader-mark img {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .tx-loader-ring,
  .tx-loader-mark img {
    animation: none;
  }
}

/* High-contrast profile: drop the translucency so the text stays legible. */
[data-contrast="high"] .tx-loader {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-contrast="high"] .tx-loader-text {
  color: #0F172A;
}
