Coupled-mode theory of diffraction-induced transverse effects in nonlinear optical resonators.