/* Loading indicators for every Ornix app (core/static/ornix/js/preloader.js):
   - a thin orange bar across the top whenever a page or form is loading;
   - a centred spinner with the Ornix mark if it takes more than a moment;
   - a spinner inside the button that was pressed (and no second press). */
.ox-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2147483000; pointer-events: none; opacity: 0;
  transition: opacity 0.2s ease; }
.ox-bar::before { content: ''; position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #FF5B35, #FA7017);
  box-shadow: 0 0 8px rgba(255, 91, 53, 0.6); }
.ox-loading .ox-bar { opacity: 1; }
.ox-loading .ox-bar::before { animation: ox-bar 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
@keyframes ox-bar { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }

.ox-veil { position: fixed; inset: 0; z-index: 2147482999; display: grid; place-items: center; pointer-events: none;
  background: rgba(255, 255, 255, 0.55); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
.ox-veil.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.2s ease; }
.ox-spinner { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.ox-spinner::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(11, 42, 74, 0.12);
  border-top-color: #FF5B35; animation: ox-spin 0.8s linear infinite; }
.ox-spinner img { width: 26px; height: 29px; }
.ox-veil-text { margin-top: 12px; font: 600 0.9rem/1.2 'DM Sans', Inter, Arial, sans-serif; color: #0B2A4A; text-align: center; }
@keyframes ox-spin { to { transform: rotate(360deg); } }

/* The first load of a page: invisible for the first moment, so fast pages never flash it. */
/* Never blocks taps, and always clears by itself after a few seconds even if the script can't run. */
.ox-first { position: fixed; inset: 0; z-index: 2147482998; display: grid; place-items: center; background: #fff; pointer-events: none;
  animation: ox-appear 0.25s ease 0.45s both, ox-vanish 0.3s ease 5s forwards; }
@keyframes ox-vanish { to { opacity: 0; visibility: hidden; } }
.ox-first.is-done { animation: none; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s linear 0.25s; }
@keyframes ox-appear { from { opacity: 0; } to { opacity: 1; } }
.staff-body .ox-first, .staff-body .ox-veil { background: rgba(244, 246, 249, 0.75); }
.staff-body .ox-first { background: #F4F6F9; }

/* The button that was pressed */
.ox-busy { position: relative !important; pointer-events: none !important; color: transparent !important; }
.ox-busy::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: ox-spin 0.7s linear infinite; }
.ox-busy.ox-busy-dark::after { border-color: rgba(11, 42, 74, 0.2); border-top-color: #0B2A4A; }

@media (prefers-reduced-motion: reduce) {
  .ox-loading .ox-bar::before { animation: none; width: 60%; }
  .ox-spinner::before, .ox-busy::after { animation-duration: 2s; }
}
@media print { .ox-bar, .ox-veil, .ox-first { display: none !important; } }
