/**
 * ë • progress overlay
 * Theme-owned progress indicator. It is opt-in via [data-ehq-progress] or
 * window.ehqProgress, so plugin AJAX/fetch flows do not create duplicate overlays.
 */

.ehq-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 4, 10, 0.64);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    font-family: var(--ehq3-font, "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    animation: ehq-progress-fadein 160ms ease-out both;
}

.ehq-progress-overlay.is-active {
    display: flex;
}

.ehq-progress-overlay.is-closing {
    animation: ehq-progress-fadeout 220ms ease-in both;
}

@keyframes ehq-progress-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ehq-progress-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.ehq-progress-card {
    background: var(--ehq3-card, #0b0e16);
    border: 1px solid var(--ehq3-line-strong, rgba(255, 255, 255, 0.16));
    border-radius: var(--ehq3-r-lg, 16px);
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: var(--ehq3-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.6));
    min-width: 240px;
    max-width: 360px;
    transform: translateY(0);
    animation: ehq-progress-pop 240ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes ehq-progress-pop {
    from { transform: translateY(12px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.ehq-progress-ring-wrap {
    position: relative;
    width: 88px;
    height: 88px;
}

.ehq-progress-ring {
    width: 88px;
    height: 88px;
    transform: rotate(-90deg);
}

.ehq-progress-ring-track {
    stroke: var(--ehq3-line-strong, rgba(255, 255, 255, 0.16));
    stroke-width: 7;
    fill: transparent;
}

.ehq-progress-ring-bar {
    stroke: var(--ehq3-primary, #f2cf2f);
    stroke-width: 7;
    fill: transparent;
    stroke-linecap: round;
    /* circumference = 2 * PI * r (r=38) = 238.76 */
    stroke-dasharray: 238.76;
    stroke-dashoffset: 238.76;
    transition: stroke-dashoffset 280ms cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: drop-shadow(0 2px 8px rgba(242, 207, 47, 0.26));
}

.ehq-progress-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--ehq3-text, #ffffff);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.ehq-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ehq3-text, #ffffff);
    text-align: center;
    letter-spacing: 0.01em;
    max-width: 280px;
    word-break: break-word;
}

.ehq-progress-sub {
    font-size: 11px;
    color: var(--ehq3-text-dim, #f2f6fc);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

/* Reduced motion (v0.4.17 polish — a11y).
   Drops the spring "pop" entrance and ring-fill easing for users who
   request reduced motion. The overlay still appears/disappears via the
   opacity-only fade, which is not a vestibular trigger. */
@media (prefers-reduced-motion: reduce) {
    .ehq-progress-card {
        animation: none;
        transform: none;
    }
    .ehq-progress-ring-bar {
        transition-duration: 0.01ms;
    }
}
