Transverse effects in nonlinear planar resonators. I. Modal theory