// Form control focus state
//
@mixin form-control-focus($color: $input-border-focus) {
  &:focus {
    border-color: rgba($input-border-focus, $input-border-focus-alpha);
    outline: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .075), 0 0 0 2px rgba($input-border-focus, $input-shadow-focus-alpha);
  }
}

// Placeholder text
//
@mixin placeholder($color: $input-color-placeholder) {
  &::placeholder {
    opacity: 1; // See https://github.com/twbs/bootstrap/pull/11526
    color: $color;
  }
}


// Form control sizing
//
@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
  #{$parent} {
    height: $input-height;
    padding: $padding-vertical $padding-horizontal;
    border-radius: $border-radius;
    font-size: $font-size;
    line-height: $line-height;
  }

  select#{$parent} {
    height: $input-height;
    line-height: $input-height;
  }

  textarea#{$parent},
  select[multiple]#{$parent} {
    height: auto;
  }
}

@mixin check() {
  @extend %clearfix;
  position: relative;
  padding-left: $check-input-gutter;
  font-weight: $font-weight-normal;
  line-height: $line-height-base;
  text-align: left;

  input[type="checkbox"],
  input[type="radio"] {
    position: absolute;
    width: auto;
    margin-top: $check-input-margin-vertical;
    margin-left: -$check-input-gutter;
  }
}

@mixin check-inline() {
  @include check;
  display: inline-block;
  margin-right: $check-input-margin-horizontal;
}

@mixin check-list() {
  @include check;
  display: block;
  width: auto;
  margin: 0;
  padding-top: $check-list-offset-top;
  padding-bottom: $check-list-offset-top;
  float: none;

  @media screen and (min-width: $screen-sm-min) {
    padding-bottom: 0;
  }
}
