.overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.78);
    animation: aparecerOverlay 0.2s ease-out;
}

.panel {
    width: min(100%, 32rem);
    padding: 2rem 2rem 1.75rem;
    border-radius: 0.875rem;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    text-align: center;
    animation: aparecerPanel 0.25s ease-out;
}

.panelExito {
    border: 1px solid #86efac;
}

.panelError {
    border: 1px solid #fca5a5;
}

.iconoEstado {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    margin-bottom: 0.75rem;
}

.spinner {
    color: #2563eb;
    animation: girar 0.9s linear infinite;
}

.iconoExito {
    color: #16a34a;
}

.iconoError {
    color: #dc2626;
}

.titulo {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
}

.mensaje {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #475569;
    word-break: break-word;
}

.progresoBloque {
    text-align: left;
}

.cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.etiquetaProgreso {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.porcentaje {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #1d4ed8;
    min-width: 2.75rem;
    text-align: right;
}

.porcentajeExito {
    color: #15803d;
}

.porcentajeError {
    color: #dc2626;
}

.pista {
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
}

.relleno {
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease, background 0.2s ease;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.rellenoExito {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.rellenoError {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.rellenoAnimado {
    position: relative;
    overflow: hidden;
}

.rellenoAnimado::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    animation: brillo 1.4s ease-in-out infinite;
}

@keyframes aparecerOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes aparecerPanel {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes girar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes brillo {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}
