Controlling propagation and coupling of waveguide modes using phase-gradient metasurfaces