/*
 * GravityHR branded loader — shared by all three portals (keep the copies identical).
 * Markup is injected by js/gravity-loader.js.
 */
.gl-overlay {
    --gl-backdrop: rgba(248, 250, 252, 0.62);
    --gl-label-bg: rgba(255, 255, 255, 0.92);
    --gl-label-text: #0f172a;
    --gl-label-border: rgba(16, 185, 129, 0.18);
    --gl-track: rgba(16, 185, 129, 0.14);
    --gl-accent: #10b981;
    --gl-glow: rgba(16, 185, 129, 0.38);

    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gl-backdrop);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    backdrop-filter: blur(6px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
    cursor: progress;
}

.gl-overlay.gl-dark {
    --gl-backdrop: rgba(3, 7, 18, 0.58);
    --gl-label-bg: rgba(17, 24, 39, 0.92);
    --gl-label-text: #f9fafb;
    --gl-label-border: rgba(16, 185, 129, 0.28);
    --gl-track: rgba(16, 185, 129, 0.22);
    --gl-glow: rgba(16, 185, 129, 0.5);
}

.gl-overlay.gl-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s ease, visibility 0s;
}

.gl-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    transform: translateY(6px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

.gl-visible .gl-stack {
    transform: none;
}

/* ── Mark ─────────────────────────────────────────────── */
.gl-mark {
    width: 6rem;
    height: 6rem;
    overflow: visible;
}

.gl-orbit-track {
    fill: none;
    stroke: var(--gl-track);
    stroke-width: 1.5;
}

.gl-orbit {
    transform-origin: 48px 48px;
    animation: gl-orbit 1.6s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.gl-orbit-tail {
    fill: none;
    stroke: url(#gl-comet);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 28 72;
    stroke-dashoffset: 28;
}

.gl-orbit-dot {
    fill: var(--gl-accent);
    filter: drop-shadow(0 0 4px var(--gl-glow));
}

.gl-tile {
    transform-origin: 48px 48px;
    filter: drop-shadow(0 8px 18px var(--gl-glow));
    animation: gl-breathe 1.6s ease-in-out infinite;
}

.gl-g {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    animation: gl-draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* ── Label ────────────────────────────────────────────── */
.gl-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--gl-label-border);
    background: var(--gl-label-bg);
    color: var(--gl-label-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.35);
    max-width: min(22rem, calc(100vw - 2rem));
}

.gl-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-dots {
    display: inline-flex;
    gap: 3px;
}

.gl-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gl-accent);
    animation: gl-dot 1.2s ease-in-out infinite;
}

.gl-dots i:nth-child(2) { animation-delay: 0.15s; }
.gl-dots i:nth-child(3) { animation-delay: 0.3s; }

/* ── Admin boot screen (index.html) ───────────────────── */
.gl-boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: #f8fafc;
}

.gl-boot-bar {
    width: 9rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    overflow: hidden;
}

.gl-boot-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, #86d083, #10b981);
    transition: width 0.15s ease-out;
}

.gl-boot-text {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
}

.gl-boot-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Keyframes ────────────────────────────────────────── */
@keyframes gl-orbit {
    to { transform: rotate(360deg); }
}

@keyframes gl-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.94); }
}

@keyframes gl-draw {
    0%   { stroke-dashoffset: 100; }
    45%  { stroke-dashoffset: 0; }
    60%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -100; }
}

@keyframes gl-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .gl-orbit { animation-duration: 3.2s; animation-timing-function: linear; }
    .gl-tile,
    .gl-dots i { animation: none; }
    .gl-g { animation: none; stroke-dashoffset: 0; }
    .gl-stack { transition: none; }
}
