We know that not all fractions have a terminating binary representation. However every fraction can be written as a leading portion followed by a repeating portion. For example \$1/3\$ starts with \$0.\$ and then just repeats \$01\$ endlessly. This corresponds to the bar notation taught in primary school. For example
$$ 1/3 = 0.\overline{01} $$
Where the portion with the bar is the repeating section.
For numbers with a terminating representation, (e.g. \$1/2 = 0.1\$) the repeating section is just \$0\$, since there are endless implicit zeros at the end of a terminating representation.
We will call the minimum1 length of the repeating section the binary period of the fraction.
Your task is to write a program or function which takes a positive integer \$n\$ as input and outputs the binary period of \$1/n\$.
This is code-golf so answers will be scored in bytes with fewer bytes being better.
1: We say minimum because if you duplicate a section again it keeps a valid representation. (e.g. \$0.\overline{01} = 0.\overline{0101}\$)