Hybrid resonant cavities: A route towards phase engineered THz metasurfaces