/*********************
 *
 * Contact form
 * with Material Design like Style
 *
 *********************/
 
#contact_form
{
	width: 100%;
	max-width: 40rem;
	
	margin: 1rem auto 0 auto;
}

#contact_form .group
{ 
	position: relative;
	
	margin-bottom: 2.5em;
	margin-bottom: 2.5rem;
	
	width: 100%;
	max-width: 20rem;
}

#contact_form .group.large
{ 
	max-width: 40rem;
}

#contact_form .group input,
#contact_form .group textarea
{
	font-family: inherit;
	font-size: inherit;
	font-weight: normal;
	color: inherit;
		
	padding: .3rem .3rem .3rem .3rem;
	display: block;
	width: 100%;
	border: none;
	outline: none;
	border-bottom: 1px solid #757575;
	border-radius: 0;
	
	-webkit-autofill: white;
}

/** Remove the ugly yellow background for autofill values from Chrome */
input:-webkit-autofill
{
	-webkit-box-shadow: 0 0 0 3em white inset;
}

#contact_form .group textarea
{
	resize: vertical;
}

#contact_form .group input:focus,
#contact_form .group textarea:focus
{
	outline:none;
}

/* Invalid state in Mozilla */
#contact_form .group input:-moz-ui-invalid:not(output),
#contact_form .group textarea:-moz-ui-invalid:not(output)
{
	box-shadow: none;
}

#contact_form .button
{
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* LABEL ======================================= */
#contact_form .group label
{
  color: #B2ADAA;
  font-weight: normal;
  position:absolute;
  z-index: 5;
  pointer-events:none;
  left: .3em;
  bottom: .3em;
  transition:0.2s ease all; 
  -moz-transition:0.2s ease all; 
  -webkit-transition:0.2s ease all;
}

/**
 * In case "input:focus ~ label" does not work
 * (as in old Android Browser) we just "hide" the label
 */
#contact_form .group input:focus,
#contact_form .group input:valid,
#contact_form .group textarea:focus,
#contact_form .group textarea:valid
{
	z-index: 10;
	background: white;
	position: relative;
}

/* active state */
#contact_form .group input:focus ~ label,
#contact_form .group input:valid ~ label,
#contact_form .group textarea:focus ~ label,
#contact_form .group textarea:valid ~ label
{
  top: -1.4em;
  font-size: .85em;
  color: #57991F;
}

/* BOTTOM BARS ================================= */
#contact_form .group .bar
{
	position: relative;
	display:block;
	width: 100%;
	
}

#contact_form .group .bar:before,
#contact_form .group .bar:after
{
	content:'';
	height:2px; 
	width:0;
	bottom: 0; 
	position:absolute;
	background:#57991F; 
	transition:0.2s ease all; 
	-moz-transition:0.2s ease all; 
	-webkit-transition:0.2s ease all;
}

#contact_form .group .bar:before { left:  50%; }
#contact_form .group .bar:after  { right: 50%; }

/* Invalid state in Mozilla */
#contact_form .group input:-moz-ui-invalid:not(output):not(:focus) ~ .bar:before,
#contact_form .group input:-moz-ui-invalid:not(output):not(:focus) ~ .bar:after,
#contact_form .group textarea:-moz-ui-invalid:not(output):not(:focus) ~ .bar:before,
#contact_form .group textarea:-moz-ui-invalid:not(output):not(:focus) ~ .bar:after
{
	background: #CC3629;
	width: 50%;
}

/* active state */
#contact_form .group input:focus ~ .bar:before,
#contact_form .group input:focus ~ .bar:after,
#contact_form .group textarea:focus ~ .bar:before,
#contact_form .group textarea:focus ~ .bar:after
{
	width: 50%;
}
