/*-------------------------------- v2 Forms ----------------------------------*/

/* Forms inspired by http://tympanus.net/Development/TextInputEffects/index2.html */

.form_v2 .submitwrap {
  margin: 2em 0 0.5em 0;
}

.form_v2 button {
  display: inline-block;
  font: 700 1em/1.2em -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  height: 3em;
  padding: 0 0.8em;
  vertical-align: middle;
  background-image: none;
  white-space: nowrap;
  border-radius: 5px;
  border: none;
  border-bottom: 2px solid #56ba47;
  color: #ffffff;
  background-color: #87d37c;
  -webkit-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
          transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

.form_v2 button:focus {
  background-color: #66a05e;
  border-bottom-color: #4e7a48;
}

.form_v2 button:disabled {
  background-color: #d0d1d0;
  color: #8c8e8e;
  border-bottom-color: rgb(125, 127, 127);
}

.form_v2 button::-moz-inner-focus {
  outline: none;
  border: none;
}

.form_v2 .buttonwrap button {
  width: 100%;
}

.form_v2 .field:disabled,
.form_v2 .radiowrap input[type="radio"]:disabled + label:before,
.form_v2 .checkwrap input[type="checkbox"]:disabled + label:before {
  background-color: #eeeeee !important;
  box-shadow: none !important;
}

.form_v2 .field:disabled + .fieldlabel,
.form_v2 .field:disabled + .fieldlabel .fieldlabel_content {
  color: #8c8e8e;
}

.form_v2 button[type=submit] {
  cursor: pointer;
}

.form_v2 .radioset,
.form_v2 .checkset {
  margin: 2em 0 0.5em 0;
}

.form_v2 .radioset_label,
.form_v2 .checkset_label {
  display: block;
  margin-bottom: 1.5em;
}

.form_v2 .radiowrap,
.form_v2 .checkwrap {
  position: relative;
  margin: 0.5em 0;
  padding-left: 2.5em;
}

#in_market_fields .radiowrap {
  margin-bottom: 1.5em;
}

#in_market_fields .radiowrap:last-child {
  margin-bottom: 0.5em;
}

.form_v2 .radiowrap input[type="radio"],
.form_v2 .checkwrap input[type="checkbox"] {
  position: absolute;
  z-index: 0;
  opacity: 0;
  left: 0.5em;
}

.form_v2 .radiowrap input[type="radio"] + label::before,
.form_v2 .checkwrap input[type="checkbox"] + label::before {
  position: absolute;
  left: 0;
  top: -0.1em;
  z-index: 1;

  content: '';
  display: inline-block;
  margin: 0 0.5em 0 0;
  vertical-align: top;
  background-image: none;

  background-color: #ffffff;
  box-shadow: inset 0 0 5px 0px rgba(125, 127, 127, 0.5);
  text-align: center;
  font-weight: 700;
  color: transparent;

  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  width: 1.7em;
  height: 1.7em;
  line-height: 1.25em;

	-webkit-transition: background-color 0.25s, border-color 0.25s, color 0.25s;
          transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.form_v2 .radiowrap input[type="radio"] + label::before {
  border: 0.2em solid transparent;
  border-radius: 0.85em;
}

.form_v2 .checkwrap input[type="checkbox"] + label::before {
  border: 0.2em solid transparent;
  border-radius: 5px;
}

.form_v2 .radiowrap input[type="radio"]:focus + label::before,
.form_v2 .checkwrap input[type="checkbox"]:focus + label::before {
  border-color: rgb(90, 118, 160);
}

.form_v2 .radiowrap.invalid input[type="radio"]:focus + label::before,
.form_v2 .checkwrap.invalid input[type="checkbox"]:focus + label::before {
  background-color: #df5454;
}

.form_v2 .radiowrap input[type="radio"]:checked + label::before,
.form_v2 .checkwrap input[type="checkbox"]:checked + label::before {
  background-color: #87d37c;
  color: #ffffff;
  box-shadow: none;
}

.form_v2 .radiowrap input[type="radio"]:checked + label::before {
  content: '•';
}
.form_v2 .checkwrap input[type="checkbox"]:checked + label::before {
  content: '✔︎';
}

.form_v2 .fieldrow.has2 .fieldwrap {
  float: left;
  width: 49.5%;
  margin-left: 1%;
}
.form_v2 .fieldrow.has2 .fieldwrap:first-child {
  margin-left: 0;
}

.form_v2 .fieldrow.has3 .fieldwrap {
  float: left;
  width: 32.5%;
  margin-left: 1%;
}
.form_v2 .fieldrow.has3 .fieldwrap:first-child {
  margin-left: 0;
}

.form_v2 .fieldalert {
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.5em;
}

.form_v2 .invalid .fieldalert {
  font-size: 0.9em;
  font-weight: 700;
  background-color: #df5454;
  color: #ffffff;
  -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;
}

.form_v2 .fieldwrap .fieldalert {
  position: absolute;
  top: 100%;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  width: 100%;

	-webkit-transition: opacity 0.25s, max-height 0.25s ease-out;
	        transition: opacity 0.25s, max-height 0.25s ease-out;

  margin: -3px 0 0 0;
  padding: 0 1em;
  list-style-type: none;

  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}
.form_v2 .fieldwrap .fieldalert > li {
  margin: 0.5em 0;
}

.form_v2 .field:focus ~ .fieldalert {
  max-height: 150px;
	-webkit-transition: opacity 0.25s, max-height 0.25s ease-in;
         	transition: opacity 0.25s, max-height 0.25s ease-in;
}

.form_v2 .radioset.invalid .fieldalert,
.form_v2 .checkwrap.invalid .fieldalert {
  margin-left: 0.25em;
  display: inline-block;
  padding: 0 0.5em;
  white-space: nowrap;
}

.form_v2 .fieldwrap,
.form_v2 .fieldalert,
.form_v2 .fieldlabel,
.form_v2 .field {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

.form_v2 .fieldwrap {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 2em 0 0.5em 0;
  vertical-align: top;
}

.form_v2 .fieldwrap.inline {
  width: 8em;
  margin: 0;
}

.form_v2 .fieldwrap.inline .fieldalert {
  font-size: 0.8em;
  line-height: 1.2em;
}

.form_v2 .field {
	position: relative;
	display: block;
	padding: 0.8em;
	width: 100%;
  height: 3em;
	color: #4b4b4b;
  background-color: #ffffff;
  box-shadow: inset 0 1px 2px 0px rgba(125, 127, 127, 0.25);
	border-radius: 5px;
	border: none;
	border-bottom: 2px solid rgb(125, 127, 127);
	font: 300 1em/1.2em -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
	-webkit-appearance: none; /* for box shadows to show on iOS */
	-webkit-transition: border-color 0.25s;
        	transition: border-color 0.25s;
}
.form_v2 select.field {
  font-size: 1em;
  height: 3em;
}

.form_v2 .field:focus,
.form_v2 .filled .field {
  outline: none;
  box-shadow: inset 0 0 2px 0px rgba(125, 127, 127, 0.25);
}

.form_v2 .inline .field {
	padding: 0.1em 0.4em;
  height: auto;
  font-size: 0.85em;
  line-height: normal;
}

.form_v2 .inline .fieldlabel {
  padding: 0 0.4em;
  line-height: 1em;
	-webkit-transform: translate3d(0, 1.45em, 0);
        	transform: translate3d(0, 1.45em, 0);
}

.form_v2 textarea.field {
  height: 6em;
}

.form_v2 .fieldlabel {
  display: inline-block;
	font-weight: 300;
	font-size: 0.9em;
  line-height: 1em;
	-webkit-touch-callout: none;
 	-webkit-user-select: none;
   -khtml-user-select: none;
	   -moz-user-select: none;
	    -ms-user-select: none;
        	user-select: none;

  white-space: nowrap;

	width: 100%;
	position: absolute;
	bottom: 100%;
	pointer-events: none;
	overflow: hidden;
  padding: 0 0.8em;
	-webkit-transform: translate3d(0, 2.25em, 0);
        	transform: translate3d(0, 2.25em, 0);
	-webkit-transition: -webkit-transform 0.25s;
        	transition: transform 0.25s ;
	-webkit-transition-timing-function: ease-in-out;
        	transition-timing-function: ease-in-out;
}

.form_v2 .fieldlabel_content {
	position: relative;
	display: block;

  color: #6e6f6f;
  line-height: 1.3em;
  -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;

	-webkit-transition: -webkit-transform 0.25s, color 0.25s;
        	transition: transform 0.25s, color 0.25s;
	-webkit-transition-timing-function: ease-in-out;
          transition-timing-function: ease-in-out;
}
.form_v2 .valid > .fieldlabel > .fieldlabel_content {
	color: #87d37c;
}
.form_v2 .invalid > .fieldlabel > .fieldlabel_content,
.form_v2 .invalid > .radioset_label,
.form_v2 .invalid.checkwrap > label {
  color: #df5454;
}

.form_v2 .fieldlabel_content:after {
  content: attr(data-content);
  position: absolute;
  font-weight: 700;
  bottom: 100%;
  left: 0;
  height: 100%;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8em;
}

.form_v2 .field:focus + .fieldlabel,
.form_v2 .filled .fieldlabel {
	-webkit-transform: translate3d(0, 0, 0);
	        transform: translate3d(0, 0, 0);
}

.form_v2 .field:focus + .fieldlabel .fieldlabel_content,
.form_v2 .filled .fieldlabel_content {
  -webkit-transform: translate3d(0, 100%, 0);
          transform: translate3d(0, 100%, 0);
}

.form_v2 .field:focus,
.form_v2 .filled .field {
  border-color: rgb(125, 127, 127);
}

.form_v2 .valid > .field {
  border-color: #87d37c;
	padding-right: 1.6em;
}

.form_v2 .invalid > .field {
  border-color: #df5454;
	padding-right: 1.6em;
}

.form_v2 .fieldwrap:after {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  position: absolute;
  right: 0;
  padding: 0.8em 0.4em;
  height: 100%;
  top: 0;
  content: ''; /* Must exist so opacity transition will take effect. */
  opacity: 0;
  -webkit-transition: opacity 0.25s ease;
          transition: opacity 0.25s ease;
}

.form_v2 .fieldwrap.inline:after {
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

.form_v2 .fieldwrap.valid:after {
  content: "✓";
  color: #87d37c;
  opacity: 1;
}

.form_v2 .fieldwrap.invalid:after {
  content: "✘";
  color: #df5454;
  opacity: 1;
}

.form_v2 .togglewrap {
  position: relative;
}

.form_v2 .togglebox {
	-webkit-transition: opacity 0.5s, max-height 0.5s ease-out;
	transition: opacity 0.5s, max-height 0.5s ease-out;
}

.form_v2 .togglebox.closed {
  position: absolute;
  z-index: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
	-webkit-transition: max-height 0.5s ease-in;
	transition: max-height 0.5s ease-in;
}

.form_v2 .togglebox.open {
  position: relative;
  max-height: 1000px; /* This would need customizing for longer toggleboxes. */
  z-index: 1;
  opacity: 1;  
}
