// Forms // --------------------------------------------------
.form--auth {
  margin-bottom: 1em;
}

.form--create {
  padding: 4vw;
}

// Form Validation // -----------------------------
.validation-errs {
  padding: 0;
  list-style: none;
  font-size: 0.75em;
  color: palette(red, salmon);
}

// Stretch inputs/textareas to full width and add height to maintain a consistent baseline ----------------------------
select,
textarea,
input[type="text"],
input[type="search"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="color"] {
  @include font-primary();

  -webkit-appearance: none;
  background-color: $white;
  border-radius: 3px;
  border: 1px solid $gray;
  color: palette(gray, x-dark);
  font-size: 1em;
  line-height: 1.6;
  outline: none;
  padding: 0.5em;
  width: 100%;
}

// Rounded search input
input[type="search"] {
  // Override content-box in normalize
  box-sizing: border-box;
  background: $white url('https://vinli-assets.s3.amazonaws.com/generic/search.svg') 0.5em 50% no-repeat;
  padding-left: 2em;

  &.input--dark,
  &.input--dark-blue {
    background: rgba(black, 0.25) url('https://vinli-assets.s3.amazonaws.com/generic/search.svg') 0.5em 50% no-repeat;
    opacity: 0.5;
    color: $white;
  }
}

input[type="search"]:focus {
  text-align: left;
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 1px 2px rgba(0, 240, 255, 0.4);
}

input[readonly] {
  border: 1px solid rgba($white, 0);
}

.form {
  &--center {
    text-align: center;
    max-width: 670px;
    margin: 0 auto;
  }
}

form .disclaimer {
  padding: 0.5em 0;
}

input.input {
  &--no-margin {
    margin-bottom: 0 !important;
  }

  &--center {
    text-align: center;
  }

  &--search {
    font-size: 0.875em;
    line-height: 1.4;
  }

  &--lg {
    font-size: 1.5em;
  }
}

// Firefox input required field
input:invalid {
  box-shadow: none;
}

// Allow text area's height to grow larger than a normal input // -------------------------------------------
textarea {
  height: auto;
}

select {
  height: auto;
  position: relative;
  background: $white url('https://vinli-assets.s3.amazonaws.com/generic/arrow-down.svg') 98% 50% no-repeat;
  background-size: 15px;
  max-width: 450px;
  -moz-appearance: none;
  padding-right: 2em;
  // removes dropdown arrow from IE
  &::-ms-expand {
    display: none;
  }
}

.select {
  &--sm {
    font-size: font-size(body, x-small);
  }

  &--lg {
    font-size: 1.5em;
  }

  &--light {
    background: $white url('https://vinli-assets.s3.amazonaws.com/generic/arrow-down.svg') 98% 50% no-repeat;
  }

  &--full {
    max-width: 100%;
  }
}

label {
  font-weight: 100;
}

.label {
  @extend %label;

  &--sm {
    color: palette(gray, dark);
    font-size: font-size(body, x-small);
    font-weight: font-weight(heavy);
  }

  &--lg {
    @include font-secondary(upper);

    font-size: 2.5em;
  }

  &--block {
    flex: 0 0 100%;
  }
}

.faux-input {
  line-height: 1.6;
  padding: 0.5em;
  margin: 0;

  .icon {
    margin-right: 0.5em;
  }
}

.float-label {
  border-bottom: 1px solid palette(gray, light);

  &.has-error {
    border-bottom: 1px solid palette(red, salmon);
  }

  &-text {
    display: block;
  }

  input,
  textarea,
  select {
    border: none;

    padding: {
      left: 0;
      right: 0;
    }
  }

  .checkbox-label {
    line-height: 2.5;
    padding: 0.5em;
  }
}

.modal__label {
  display: block;
}

.inline-radio {
  flex: 0 0 80px;

  @include gmq(ipad) {
    margin-top: 1em;
  }
}

.select-input {
  position: relative;
  background: none;
  height: 60px;

  select {
    position: absolute;
  }

  input {
    position: absolute;
    width: 92%;
    border-radius: 3px 0 0 3px;
  }
}

// Input column (cluster multiple inputs together into a single group) // -------------------------------------------------------------------
$input-cols: "25" "33" "40" "50" "60" "75" "100";

@each $w in $input-cols {
  .input-col--#{$w} {
    @if ($w == '50') {
      flex: 1;
    }

    @else {
      flex: 0 0 #{$w + '%'};
    }

    margin-right: 1em;

    &:last-child {
      margin-right: 0;
    }
  }
}

// Input groups with labels // --------------------------------------------------
// To use labels with input groups, wrap a label and an input in an .input-row
.input-row {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 1em;
  text-align: left;

  &--whole {
    flex: 0 0 100%;
  }

  &--half {
    flex: 0 0 50%;
    padding-right: 0.2em;

    &:last-child {
      padding-right: 0;
    }
  }

  &--inline {
    flex-direction: row;
    flex-wrap: no-wrap;
    -ms-flex-wrap: none;

    label {
      margin-right: 1em;
    }
  }
}

.filter-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  flex: 0 0 100%;

  select {
    border: none;
    border-bottom: 1px solid palette(gray, x-light);
    border-radius: 0;
    background: palette(gray, xx-light) url('https://vinli-assets.s3.amazonaws.com/generic/arrow-down.svg') 91% 50% no-repeat;
    padding-left: 1em;

    & + select {
      border-left: 1px solid palette(gray, x-light);
    }
  }
}

.error {
  margin: 20px 0;
  padding: 11px;
  background-color: #f55d52;
  color: white;
  border-radius: 3px;
}

// Editable Text Inputs //
select.select--no-border,
input.input--no-border {
  border: none;
  border-radius: 0;
}

// IE Hacks
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  select,
  textarea,
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="datetime"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="month"],
  input[type="time"],
  input[type="week"],
  input[type="number"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="color"] {
    line-height: 1.7;
    min-height: 43px;
  }
}
