Optimized solutions for thermal and visual comfort in the design of a nearly zero-energy building