Covariant and gauge-invariant analysis of cosmic microwave background anisotropies from scalar perturbations