Differential covariant formalism for solving Maxwell's equations in curvilinear coordinates: oblique scattering from lossy periodic surfaces