@import "bourbon";
@import "variables";
@import "type_mixins";
@import "fonts";

%focus {
  outline: none;
  border-color: $color-blue-3;
}

/*  Forms
---------------------------------------- */
form {
  margin: 0;
}

input {
  @include fontSize($type-M);
}

label {
  display: inline-block;
  @include type-label();
}

select,
textarea,
input:not([type]),
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"] {
  display: block;
  // max-width: 600px;
  width: 100%;
  border: 1px solid $color-gray-3;
  @include fontSize($type-S);
  font-family: $font_regular;
  font-weight: bold;
  border-radius: 2px;
  box-shadow: 1px 1px 3px rgba(0,0,0,.2) inset;

  &.sized {
    width: auto;
    max-width: inherit;
  }

  &:focus,
  &:active {
    @extend %focus;
  }
}

[placeholder] {
  @include placeholder {
    font-family: $font_light;
    @include fontSize($type-M);
    line-height: 1;
  }
}

[placeholder]:focus::-webkit-input-placeholder {
  transition: opacity 0.5s 0.5s ease;
  opacity: 0;
}

[placeholder]:-ms-input-placeholder {
  padding: .5em;
  color: $input-color-placeholder;
}

textarea,
input:not([type]),
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"] {
  padding: 11px 5px;
}

input[type="search"] {
  @include appearance(none);
  height: 40px;
  max-width: 100%;
  background-color: transparent;
  font-family: $font_light;
  line-height: normal;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

.search-box {
  fieldset {
    display: block;
    position: relative;
    border: 0;
    margin: 0;
    padding: 0 40px 0 0;
    background-color: $color-tan_gray-1;
  }
  .search-submit {
    font: 0/0 a;
    color: transparent;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: #00a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Mzc3ODA2NjhCQTExRTI4NzBEODU3RUZEQTY4RTc5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+ZGORLgAAAHxJREFUeNpirLv8gYOBgWENECcD8UsGJMAExIVA7A3E+4BYHF0yBsrWQlfABNV1D5sCkOQDILYD4pvoCpigAk+BOByI/yMpaIdJSgDxciBmhPKvA3ElSFISiPcDsSaShCPIWyDJ7UCsgS4Bc9B6bBIwyU4g3oYuAQIAAQYAuOIcWA9AXnoAAAAASUVORK5CYII=) no-repeat center center;
    border: 0;
    position: absolute;
    top: 0px;
    right: 0px;
  }
}

select,
select.form-control {
  display: block;
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  font-family: $font_regular;
  @include fontSize($type-S);
  line-height: normal;
  color: $color-gray;
  background-color: $color_white;
  background-image: none;
  border: 1px solid $color-gray-3;
  border-radius: 2px;
  @include transition(border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s);
}

input[type="checkbox"] {
  border: 1px solid $color-gray;
  border-radius: 2px;
  background-color: $color_gray-2;
  @include background-image(linear-gradient(bottom, rgba(0,0,0,.05) 0%, rgba(0,0,0,.05) 49.51%, rgba(255,255,255,.05) 50.24%, rgba(255,255,255,.05) 100%));
}


.radio-group,
.checkbox-group {
  clear: both;
  @include clearfix();
  width: 100%;
  border: 0;

  input[type="checkbox"],
  input[type="radio"] {
    position: absolute;
    left: -1000em;

    .ltie9 & {
      position: static;
      // :: avoids ie8 as well
    }

    & + label {
      padding: 0.625rem 0;
      width: 100%;
      position: relative;
      margin-right: 1.2rem;
      padding-left: 1.7rem;
      cursor: pointer;
      &::before {
        @include fa-icon();
        color: $color-gray-4;
        font-size: 21px;
        vertical-align: middle;
        position: absolute;
        left: 2px;
        top: 7px;
      }
    }

    &:checked,
    &:focus {
      outline: none !important;
    }

    &:focus + label {
      color: $color-black;
      &::before {
        color: $color-gray-4;
      }
    }
    &:active + label::before,
    &:focus:active + label::before,
    &:checked + label::before {
      color: $color-blue;
    }
    &:disabled + label,
    &:disabled + label::before {
      color: $color-gray-4 !important;
      opacity: 0.5;
    }
  }

  &.checkbox-inline,
  &.radio-inline {
    input[type="checkbox"] + label,
    input[type="radio"] + label {
      width: auto;
    }
  }

  & input[type="radio"] {
    & + label::before {
      content: $fa-var-circle-thin;
    }
    &:checked + label::before {
      content: $fa-var-check-circle;
    }
  }

  & input[type="checkbox"] {
    & + label::before {
      content: $fa-var-square-o;
    }
    &:checked + label::before {
      content: $fa-var-check-square;
      font-size: 20px;
      height: 21px;
    }
  }
}



legend {
  @include type-5();
  border-bottom: 0;
}

ul.form-group {
  list-style: none;
  padding-left: 0;
}
