Microwave heating of a high-temperature plasma confined in a large-scale open magnetic trap, including all important wave effects like diffraction, absorption, dispersion and wave beam aberrations, is described for the first time within the first-principle technique based on consistent Maxwells equations. With this purpose, the quasi-optical approach is generalized over weakly inhomogeneous gyrotrotropic media with resonant absorption and spatial dispersion, and a new form of the integral quasi-optical equation is proposed. An effective numerical technique for this equations solution is developed and realized in a new code QOOT, which is verified with the simulations of realistic electron cyclotron heating scenarios at the Gas Dynamic Trap at the Budker Institute of Nuclear Physics (Novosibirsk, Russia).