  We compute the KMS (equilibrium) states for the canonical time evolution on
C*-algebras from actions of congruence monoids on rings of algebraic integers.
We show that for each $\beta\in[1,2]$, there is a unique KMS$_\beta$ state, and
we prove that it is a factor state of type III$_1$. There is a phase transition
at $\beta=2:$ For each $\beta\in (2,\infty]$, the set of extremal KMS$_\beta$
states decomposes as a disjoint union over a quotient of a ray class group in
which the fibers are extremal traces on certain group C*-algebras associated
with the ideal classes. Moreover, in most cases, there is a further phase
transition at $\beta=\infty$ in the sense that there are ground states that are
not KMS$_\infty$ states. Our computation of KMS and ground states generalizes
the results of Cuntz, Deninger, and Laca for the full $ax+b$-semigroup over a
ring of integers, and our type classification generalizes a result of Laca and
Neshveyev in the case of the rational numbers and a result of Neshveyev in the
case of arbitrary number fields.
