Quadrupole second-harmonic generation for a focused beam of arbitrary transverse structure and polarization