Enhancement of electric and magnetic wave fields at density gradients