Ferroelectric mechanism of croconic acid: a first-principles and Monte Carlo study.