/* ==========================================================================
   Page / AJAX loader (Pace) — one design for every layout
   Pace (assets/libs/pace/pace.min.js, loaded by _vendor_scripts) tracks page load + AJAX and adds:
     <div class="pace pace-active">
       <div class="pace-progress"><div class="pace-progress-inner"></div></div>
       <div class="pace-activity"></div>
       <div class="wrapper overlay ajax-category"></div>
     </div>
   Its stock "corner indicator" theme (pace-theme-default.min.css: big blue square in the top-right) and
   the dark overlay from _head_css are replaced here by two modes:

   The indicator is always a small tag at the top centre (header area), never in the middle of the page.
   1. While the page itself loads (html.pl-page-loading, set/cleared by the script in _vendor_scripts):
        - slim green -> sun bar along the top,
        - the tag "Loading, please wait… don't click until the page is ready",
        - a light veil that blocks clicks and fades in after ~0.4 s.
   2. After the page has loaded (AJAX: dropdowns, grids, the login company list...):
        - the same top bar,
        - the tag "Loading…" after ~0.6 s; no veil, nothing blocks clicks, so dropdowns keep working.

   Load this file AFTER pace-theme-default.min.css. The "html" prefix keeps these rules stronger than the theme.
   ========================================================================== */
html .pace { pointer-events: none; -webkit-user-select: none; user-select: none; }
html .pace.pace-inactive { display: none; }

/* ---------- top progress bar (both modes) ---------- */
html .pace .pace-progress { display: block; position: fixed; z-index: 10002; top: 0; right: 100%; left: auto; width: 100%; height: 3px; background: linear-gradient(90deg, #5B9B37, #F8BC26); box-shadow: 0 0 10px rgba(248,188,38,.7), 0 0 4px rgba(91,155,55,.6); transition: transform .2s ease; }
html .pace .pace-progress::after { content: ""; position: absolute; right: 0; top: 0; width: 80px; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.85)); opacity: .8; }
html .pace .pace-progress-inner { display: none; }

/* ---------- indicator (replaces the corner square) ----------
   default = AJAX mode: small dark tag at the top centre, click-through */
html .pace .pace-activity,
html .pace.pace-active .pace-activity {
    display: block; position: fixed; z-index: 10001; top: 12px; left: 50%; right: auto; bottom: auto;
    width: max-content; max-width: calc(100vw - 32px); height: auto; box-sizing: border-box;
    padding: 7px 14px 7px 36px; border-radius: 999px;
    background: rgba(10,21,38,.92); color: #FFFFFF;
    font: 600 12.5px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; text-align: left;
    box-shadow: 0 12px 28px -14px rgba(10,21,38,.6), 0 0 0 1px rgba(255,255,255,.06);
    pointer-events: none;
    -webkit-transform: translateX(-50%); transform: translateX(-50%);
    -webkit-transition: none; transition: none;
    animation: plLoaderFade .2s .6s both;
}
/* ring spinner */
html .pace .pace-activity::before {
    content: ""; display: block; position: absolute; box-sizing: border-box;
    top: 50%; left: 13px; bottom: auto; right: auto; margin: -8px 0 0 0;
    width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.16); border-radius: 50%;
    border-top-color: #F8BC26; border-right-color: #5B9B37;
    -webkit-animation: plLoaderSpin .8s linear infinite; animation: plLoaderSpin .8s linear infinite;
}
/* text */
html .pace .pace-activity::after {
    content: "Loading\2026";
    display: inline; position: static; width: auto; height: auto; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: none; white-space: pre-line;
    -webkit-animation: none; animation: none;
}

/* page-load mode: same header tag, with the "please wait" message */
html.pl-page-loading .pace .pace-activity { animation: plLoaderFade .2s .3s both; }
html.pl-page-loading .pace .pace-activity::after { content: "Loading, please wait\2026  don\2019t click until the page is ready";   /* 2 spaces: the first ends the \2026 escape */ }

/* ---------- veil: page-load mode only (blocks clicks until the page is ready) ---------- */
html .pace .overlay.ajax-category,
html .pace.pace-active .overlay.ajax-category { display: none; }
html.pl-page-loading .pace.pace-active .overlay.ajax-category {
    display: block; position: fixed; inset: 0; z-index: 10000 !important; pointer-events: auto;
    background: rgba(246,248,251,.55) !important; -webkit-backdrop-filter: saturate(.85) blur(1px); backdrop-filter: saturate(.85) blur(1px);
    font-size: 0; line-height: normal; cursor: progress;
    animation: plLoaderFade .3s .4s both;
}

@media (prefers-reduced-motion: reduce) {
    html .pace .pace-activity::before { -webkit-animation-duration: 2.4s; animation-duration: 2.4s; }
    html .pace .pace-progress { transition: none; }
}
@keyframes plLoaderSpin { to { transform: rotate(360deg); } }
@keyframes plLoaderFade { from { opacity: 0; } to { opacity: 1; } }
