/* Forms
// ============ */


/* mixins at top */
@define-mixin bracket-title{
  font-size: 0.7em;
  color: $primarycolour;
  font-family: $regularweight;
  margin: 7px 20px 10px 0;
  padding: 0 0 0 14px;
  height: 10px;
  border-bottom: 1px solid $borders;
  position: relative;
  span{
    background: $white;
    padding: 0 13px;
  }
  &:before, &:after{
    position: absolute;
    left: 0px;
    top: 9px;
    content: '';
    background: $borders;
    width: 1px;
    height: 7px;
    display: block;
  }
  &:after{
    left: auto;
    right: 0;
  }
}
/* end mixins */

input[type="checkbox"], input[type="radio"]{
  position: relative;
  -webkit-appearance: none;
  border: 1px solid #ccc;
  height: 16px;
  width: 16px;
  margin-top: 0 !important;
  margin-right: 10px;
  font-size: 1.1rem;
  border-radius: 3px;
  transition: all 0.3s;
  background: #fff;
  outline: none;
  overflow: hidden;
  color: #fff;
  vertical-align: middle;
  display: inline-block;
  display: inline-flex;
  &:focus{
    outline: none;
    
  }
  &:checked:focus{
    border-color: transparent !important;
  }
}


fieldset{
  border: 0;
}
legend{
  @mixin bracket-title;
}

.checkbox-inline, .radio-inline{
  span{
    padding-left: 4px;
  }
}

input[type="radio"]{
  border-radius: 50%;
}
input[type="checkbox"]:checked, input[type="radio"]:checked{
  background: #1B234C;
  border-color: #1B234C;
  
  &:focus{
    outline: none;
    border-color: #fff;
  }
}
input[type="checkbox"]:before, input[type="checkbox"]:checked:before,
input[type="radio"]:before, input[type="radio"]:checked:before{
  position:absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 11px;
  text-align: center;
  content: "\e652";
  color: #fff;
  font-family: 'icomoon';
  font-size: 0.7rem;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input[type="radio"]:before, input[type="radio"]:checked:before{
  content: "•";
  top: 0;
  font-size: 0.85rem;
}

.input-group {
  position: relative;
  display: table;
  border-collapse: separate;

  .form-control {
    display: table-cell;
    float: left;
    width: 99%;
    position: relative;
  }
}

.input-group-btn {
  position: relative;
  white-space: nowrap;
  vertical-align: middle;
  width: 1%;
  display: inline-block;
}

.btn.search-icon {
  height: 48px;

  &:hover {
    .icon-search {
      color: $white;
    }
  }
}

.search-container {
  padding: 0 60px;

  input {
    position: relative;
    left: -12px;
  }
}

/* Inputs / Selects / Forms etc.
// ============================== */

input[type=text], input[type=email], input[type=password], button, input[type=search], input[type=url],
input[type=number], textarea, select, input[type=date], input[type=month], input[type=week], input[type^=datetime] {
  /*this causes crazy stuff in firefox, probably best not to set it here */
  /*padding: 0.6em */
  appearance: none;
  box-sizing: border-box;
}

/* ==============================
// Styling
// ============================== */

input[type=text], input[type=email], input[type=password], input[type=search], input[type=url],
input[type=number], textarea, select, input[type=date], input[type=month],
input[type=week], input[type^=datetime] {
  font-size: 1em;
  font-family: $primaryfont;
  font-weight: 300;
  letter-spacing: 0.03rem;
  border-radius: $borderradius;
  appearance: none;
}

input[type=text], input[type=email], input[type=password], input[type=search], input[type=url],
input[type=number], textarea, select, input[type=date], input[type=month], input[type=week], input[type^=datetime] {
  width: 100%;
  border: 1px solid $borders;
}

input:focus::-webkit-input-placeholder,
input:focus:-moz-placeholder,
input:focus::-moz-placeholder,
input:focus:-ms-input-placeholder {
  color: $primarycolour;
}

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number] {
  padding: 6px 12px;
  &:focus {
    border: 1px solid $black;
    outline: none;
    background: $fieldhighlight;
  }
}
.form{
  input[type=email], input[type=password]{
    margin-bottom: 0.5em;
  }
}
label {
  display: block;
  font-family: $primaryfontbook;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
/*  background: $superweak;*/
  padding: $defaultpadding;
  font-size: 0.6em;
  margin-bottom: 0;
  + input {
    position: relative;
    top: -2px;
  }
}

.label--solid{
  font-size: 0.6em;
  padding: 0.43em 0.9em 0.33em 0.9em !important;
  border-radius: 0 !important;
  display: inline-block !important;
}

.label--primary{
  background: $primarycolour;
  color: $white;
}
  
.label--highlight{
  background: $highlightcolour;
  text-shadow: none;
  color: $white;
}
  
.label--default{
  color: $darkgrey;
  text-shadow: none;
  background: $superweak;
}

button {
  line-height: normal;

  &:focus {
    border: 1px solid darken($highlightcolour, 8);
    outline: none;
  }
}

button, input[type=submit], input[type=reset] {
  @extend %button;
  @extend %button--default;
}

.label + .select, .label + .textarea{
  margin-top: -2px;
}


.textarea{
  resize: vertical;
  padding: 6px 12px;
  min-height: 110px;
}

.select{
  position: relative;
  height: 42px;
  margin-bottom: 10px;
  clear: both;
  select{
    height: 100%;
    width: 100% !important;
    font-size: 16px;
    &:empty + .arrow{
      display: none;
    }
  }
}

.custom-select{
  border-radius: $borderradius;
}