/*
    Elevate loader (owner, 14 Nov 2026: "modern and catchy, aligned with the brand").
    The logo's dumbbell mark, "loading the bar": the plates fill in brand red from the outside in, the
    E/3 core lights up, the bar lifts (Elevate) and settles, then unloads outside-first. One source for
    the admin panel, the CRM's public pages, the website and the apps.

      .elv-loader          the mark, block; size with --elv-size (default 88px wide)
      .elv-overlay         full-page: a blurred scrim + a dark card with the mark (+ optional label)
      .elv-bars            compact: five stepped plates in a wave, for buttons and inline text (currentColor)
      .elv-on-light        light surroundings: ink core + a darker ghost (the overlay card is always dark)

    Motion: one 1.8 s loop, transform/opacity/fill only. prefers-reduced-motion: no movement, a slow
    fade of the whole mark (bars: a fade, no wave). Accessibility: the wrapper carries role="status" and
    a visually hidden "Loading…"; the SVG is aria-hidden.

    In the CRM: the public pages link it from header.php, the admin from admin/header.php. The markup:
    startLoader() in js/custom.js and admin/assets/js/plugins/scripts.js (the overlay keeps the class
    "loader", which stopLoader() takes down), elevateBars() and elevateLoaderMark() in app/functions.php.
    The website (websites/elevate-training) carries its own copy of this file: change both.
*/
.elv-loader {
    --elv-size: 88px;
    --elv-plate: #EF3B36;
    --elv-core: #ffffff;
    --elv-ghost: rgba(255, 255, 255, .14);
    --elv-shadow: rgba(239, 59, 54, .30);   /* dark: a soft brand-red glow under the bar */
    --elv-dur: 1.8s;
    display: inline-block;
    width: var(--elv-size);
    line-height: 0;
}
.elv-loader.elv-on-light,
.elv-on-light .elv-loader {
    --elv-core: #181513;
    --elv-ghost: rgba(24, 21, 19, .10);
    --elv-shadow: rgba(24, 21, 19, .18);
}
.elv-loader svg { width: 100%; height: auto; overflow: visible; display: block; }
.elv-loader .elv-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: elv-rise var(--elv-dur) cubic-bezier(.3, .7, .2, 1) infinite; }
.elv-loader .elv-p,
.elv-loader .elv-c { fill: var(--elv-ghost); transform-box: fill-box; transform-origin: 50% 50%; }
.elv-loader .elv-p { animation: elv-plate var(--elv-dur) cubic-bezier(.2, .8, .2, 1) infinite; }
.elv-loader .elv-c { animation: elv-core var(--elv-dur) cubic-bezier(.2, .8, .2, 1) infinite; }
.elv-loader .elv-p2 { animation-delay: .11s; }
.elv-loader .elv-p3 { animation-delay: .22s; }
.elv-loader .elv-c  { animation-delay: .34s; }
.elv-loader .elv-floor { fill: var(--elv-shadow); transform-box: fill-box; transform-origin: 50% 50%; animation: elv-floor var(--elv-dur) cubic-bezier(.3, .7, .2, 1) infinite; }

@keyframes elv-plate {
    0%        { fill: var(--elv-ghost); transform: scaleY(.62); }
    9%        { fill: var(--elv-plate); transform: scaleY(1.1); }
    15%, 66%  { fill: var(--elv-plate); transform: scaleY(1); }
    80%, 100% { fill: var(--elv-ghost); transform: scaleY(1); }
}
@keyframes elv-core {
    0%        { fill: var(--elv-ghost); transform: scale(.9); }
    10%       { fill: var(--elv-core); transform: scale(1.04); }
    16%, 60%  { fill: var(--elv-core); transform: scale(1); }
    74%, 100% { fill: var(--elv-ghost); transform: scale(1); }
}
@keyframes elv-rise {
    0%, 34%   { transform: translateY(0); }
    46%, 56%  { transform: translateY(-12%); }
    64%       { transform: translateY(1.5%); }
    70%, 100% { transform: translateY(0); }
}
@keyframes elv-floor {
    0%, 34%   { transform: scaleX(1); opacity: .9; }
    46%, 56%  { transform: scaleX(.72); opacity: .45; }
    64%       { transform: scaleX(1.04); opacity: 1; }
    70%, 100% { transform: scaleX(1); opacity: .9; }
}

/* full page: shows after 150 ms so quick saves don't flash */
.elv-overlay {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(14, 12, 11, .42);
    -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
    animation: elv-in .22s ease-out .15s both;
}
.elv-overlay .elv-card {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 26px 30px 20px; border-radius: 22px;
    background: #181513; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.elv-overlay .elv-loader { --elv-size: 104px; }
.elv-overlay .elv-label {
    font: 600 11px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .16em; text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}
.elv-overlay .elv-label:empty { display: none; }
/* Arabic: spacing letters out pulls the joined letters apart, and there are no capitals */
.elv-overlay .elv-label:lang(ar), [dir="rtl"] .elv-overlay .elv-label { letter-spacing: 0; text-transform: none; }
@keyframes elv-in { from { opacity: 0; } to { opacity: 1; } }

/* compact: five stepped plates (outer to inner, like the mark) in a wave */
.elv-bars { display: inline-flex; align-items: center; gap: .12em; height: 1em; vertical-align: -.12em; color: inherit; }
.elv-bars i { display: block; width: .16em; border-radius: .05em; background: currentColor; transform-origin: 50% 50%; animation: elv-wave 1s cubic-bezier(.4, 0, .2, 1) infinite; }
.elv-bars i:nth-child(1), .elv-bars i:nth-child(5) { height: .5em; }
.elv-bars i:nth-child(2), .elv-bars i:nth-child(4) { height: .76em; }
.elv-bars i:nth-child(3) { height: 1em; }
.elv-bars i:nth-child(1) { animation-delay: 0s; }
.elv-bars i:nth-child(2) { animation-delay: .08s; }
.elv-bars i:nth-child(3) { animation-delay: .16s; }
.elv-bars i:nth-child(4) { animation-delay: .24s; }
.elv-bars i:nth-child(5) { animation-delay: .32s; }
@keyframes elv-wave {
    0%, 60%, 100% { transform: scaleY(1); opacity: .45; }
    25%           { transform: scaleY(1.35); opacity: 1; }
}

/*
    The CRM's widgets on the website (gift cards, the service picker, the coach pages: team/*.css) put
    everything inside their root back to the browser's defaults at an id's weight
    (#elevate-… :where(:not(svg, svg *)) { all: revert }), which outweighs the rules above: the bars
    again inside them, at the same weight.
*/
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars { display: inline-flex; align-items: center; gap: .12em; height: 1em; vertical-align: -.12em; color: inherit; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i { display: block; width: .16em; border-radius: .05em; background: currentColor; transform-origin: 50% 50%; animation: elv-wave 1s cubic-bezier(.4, 0, .2, 1) infinite; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(1),
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(5) { height: .5em; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(2) { height: .76em; animation-delay: .08s; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(3) { height: 1em; animation-delay: .16s; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(4) { height: .76em; animation-delay: .24s; }
:is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i:nth-child(5) { animation-delay: .32s; }

.elv-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    .elv-loader .elv-bar, .elv-loader .elv-floor, .elv-loader .elv-c, .elv-loader .elv-p { animation: none; }
    .elv-loader .elv-p { fill: var(--elv-plate); }
    .elv-loader .elv-c { fill: var(--elv-core); }
    .elv-loader svg { animation: elv-calm 1.6s ease-in-out infinite; }
    .elv-bars i, :is(#elevate-gift-cards, #elevate-service, #elevate-team-marketplace) .elv-bars i { animation: elv-calm 1.6s ease-in-out infinite; }
    .elv-overlay { animation-duration: .01s; }
}
@keyframes elv-calm { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
