Transverse-momentum and event-shape dependence of D-meson flow harmonics in Pb-Pb collisions at