/* Overlay global — feedback la salvări / acțiuni lente */
@keyframes revgo-nav-spin {
    to { transform: rotate(360deg); }
}

/* PWA: loader instant în <head>, înainte de JS — evită flash fără feedback */
html.revgo-nav-boot::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 20001;
    background: rgba(248, 250, 252, 0.95);
    pointer-events: none;
}

html.revgo-nav-boot::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 2.75rem;
    height: 2.75rem;
    margin: -1.375rem 0 0 -1.375rem;
    z-index: 20002;
    border: 0.2em solid rgba(13, 110, 253, 0.2);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: revgo-nav-spin 0.75s linear infinite;
    pointer-events: none;
}

@media (display-mode: standalone) {
    html.revgo-nav-boot::before {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.revgo-global-loading {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.revgo-global-loading.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.revgo-global-loading.is-active.is-nav-pending {
    pointer-events: none;
}

.revgo-global-loading.is-active.is-immediate {
    transition: none;
}

.revgo-global-loading__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: min(24rem, 100%);
    padding: 1.75rem 2rem;
    text-align: center;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 2rem rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.revgo-global-loading__panel .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.2em;
}

.revgo-global-loading__message {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
}

body.revgo-loading-active {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .revgo-global-loading {
        padding: 1rem;
        background: rgba(248, 250, 252, 0.92);
    }

    .revgo-global-loading__panel {
        width: min(18rem, 100%);
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
        box-shadow: 0 0.75rem 2.5rem rgba(15, 23, 42, 0.18);
    }

    .revgo-global-loading__panel .spinner-border {
        width: 2.75rem;
        height: 2.75rem;
    }

    .revgo-global-loading__message {
        font-size: 1rem;
    }
}

@media (display-mode: standalone) {
    .revgo-global-loading {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Detalii: ce se întâmplă, timp scurs, bară de progres, pași */
.revgo-global-loading__detail {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.revgo-global-loading__bar {
    position: relative;
    width: 100%;
    height: 0.375rem;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.revgo-global-loading__bar > span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 38%;
    background: #0d6efd;
    border-radius: 999px;
    animation: revgo-bar-slide 1.3s ease-in-out infinite;
}

.revgo-global-loading__bar.is-determinate > span {
    width: 0;
    animation: none;
    transition: width 0.25s ease;
}

@keyframes revgo-bar-slide {
    0% { left: -40%; }
    100% { left: 102%; }
}

.revgo-global-loading__steps {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.revgo-global-loading__steps li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.revgo-global-loading__steps li::before {
    content: '○';
    width: 1rem;
    text-align: center;
}

.revgo-global-loading__steps li.is-active {
    color: #0f172a;
    font-weight: 600;
}

.revgo-global-loading__steps li.is-active::before {
    content: '●';
    color: #0d6efd;
}

.revgo-global-loading__steps li.is-done {
    color: #15803d;
}

.revgo-global-loading__steps li.is-done::before {
    content: '✓';
}

.revgo-global-loading__meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
}

.revgo-global-loading__elapsed {
    font-variant-numeric: tabular-nums;
}

.revgo-global-loading__dismiss {
    padding: 0;
    font-size: 0.75rem;
}

.revgo-global-loading.is-nav-pending .revgo-global-loading__dismiss {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .revgo-global-loading__bar > span { animation-duration: 3s; }
}
