/* =========================================================================
   Loaders visuais do Portal Bertotto (Commit 225)
   - Top loader bar (Pace-style) — feedback de navegacao entre paginas
   - Download overlay com acelerador SVG — feedback de geracao de ZIP
   Cores alinhadas com o portal: azul #2563eb / ciano #06b6d4 / dark #1e3a8a
   ========================================================================= */

/* ============ Top Loader Bar (navegacao entre paginas) ============ */
.portal-toploader {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg,
        #06b6d4 0%,
        #2563eb 50%,
        #06b6d4 100%);
    background-size: 200% 100%;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(37, 99, 235, .5),
                0 0 4px rgba(6, 182, 212, .8);
    transition: width .35s ease, opacity .25s ease;
}
.portal-toploader.is-loading {
    opacity: 1;
    animation: portal-toploader-shimmer 1.8s linear infinite;
}
@keyframes portal-toploader-shimmer {
    0%   { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

/* ============ Download Overlay com Acelerador SVG ============ */
.portal-download-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: portal-download-overlay-in .25s ease-out;
}
.portal-download-overlay.is-active { display: flex; }
@keyframes portal-download-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.portal-download-overlay__card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 44px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
    max-width: 360px;
    animation: portal-download-card-in .3s ease-out;
}
@keyframes portal-download-card-in {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.portal-download-overlay__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 12px 0 4px;
    letter-spacing: -.01em;
}
.portal-download-overlay__sub {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Acelerador SVG — ponteiro vai e volta + arco preenche/esvazia */
.portal-speedometer {
    width: 220px;
    height: 140px;
    display: block;
    margin: 0 auto;
}
.portal-speedometer__arc-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 12;
    stroke-linecap: round;
}
.portal-speedometer__arc {
    fill: none;
    stroke: url(#portal-speed-grad);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: portal-arc-fill 1.8s ease-in-out infinite;
}
.portal-speedometer__needle {
    stroke: #1e3a8a;
    stroke-width: 4;
    stroke-linecap: round;
    transform-origin: 110px 110px;
    transform: rotate(-90deg);
    animation: portal-needle-sweep 1.8s ease-in-out infinite;
}
.portal-speedometer__pivot {
    fill: #1e3a8a;
}
.portal-speedometer__tick {
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-linecap: round;
}

@keyframes portal-needle-sweep {
    0%   { transform: rotate(-90deg); }
    50%  { transform: rotate(90deg); }
    100% { transform: rotate(-90deg); }
}
@keyframes portal-arc-fill {
    0%   { stroke-dashoffset: 220; }
    50%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 220; }
}

/* Pulse no texto pra indicar atividade */
.portal-download-overlay__title::after {
    content: '';
    display: inline-block;
    width: 6px;
    animation: portal-dots 1.2s steps(4, end) infinite;
}
@keyframes portal-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
