Mouse click out of element animations

Im currently making a form and I added a div under each text field to make a line.
When we click inside of the text field, the div borders colors (line) changes colors, from gray to white.
But I would like to set back the initial border color of the div when we click anywhere else except the text field.
Its basically the same contact form of Plastic Design agency.

Here is my public share link: LINK
(how to access public share link)