Singular hypersurfaces characterizing the Lefschetz properties