Optimal design of amorphous single-junction and tandem solar cells