The similarities between the two cases are probably best expressed in binary quadratic forms with integer coefficients and variable values. The statements about primes are in Cox, Primes of the Form $x^2 + n y^2.$ The shorthand "good, bad, medium" was taught to me for use in writing programs, by Irving Kaplansky. Turns out there is a second edition (2013) of COX.
The form $x^2 + 5 y^2$ integrally represents $5$ and all primes $p \equiv 1,9 \pmod {20}.$ Call these the "good" primes. The form $2x^2 + 2xy + 3 y^2$ integrally represents $2$ and all primes $p \equiv 3,7 \pmod {20}.$ Call these the "medium" primes. The "bad" primes are all $q \equiv 11,13,17,19 \pmod {20}.$
A positive integer $n$ is integrally represented by $x^2 + 5 y^2$ if and only if, in factoring $n,$ the exponent of each bad prime is even, and the sum of all the exponents of medium primes is even.
The form $x^2 + 6 y^2$ integrally represents all primes $p \equiv 1,7 \pmod {24}.$ Call these the "good" primes. The form $2x^2 + 3 y^2$ integrally represents $2,3$ and all primes $p \equiv 5,11 \pmod {24}.$ Call these the "medium" primes. The "bad" primes are all $q \equiv 13,17,19,23 \pmod {20}.$
A positive integer $n$ is integrally represented by $x^2 + 6 y^2$ if and only if, in factoring $n,$ the exponent of each bad prime is even, and the sum of all the exponents of medium primes is even.
There is a resemblance at the level of represented numbers. Each genus has only one class, and each discriminant has just two genera.