@import "pack/seed-dash/_index";
@import "pack/seed-family/_index";
@import "../../configs/constants";
@import "../../configs/seed-control";
@import "../../mixins/input-styles";

.c-InputField {
  @import "../../configs/color";
  @import "../../resets/base";
  $border-width: 1px;
  $offset: 1px;
  $default-height: 40px;
  $states: $STATES;

  // Scoped functions
  @function get-height($height: $default-height, $border: $border-width, $offset: 1) {
    @return ceil($height - $border * 2 - $offset * 2);
  }

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent;
  border: none;
  box-shadow: none;
  color: currentColor;
  display: block;
  height: get-height();
  margin-bottom: $offset;
  margin-top: $offset;
  padding: 0;
  position: relative;
  top: 0;
  width: 100%;
  z-index: 1;
  &:focus {
    outline: none;
  }
  &::placeholder {
    color: _color(grey, 700);
  }
  @include input-normalize-autofill-styles();

  // Adjust field height
  @each $size, $values in $seed-control-sizes {
    &.is-#{$size} {
      height: get-height(_get($values, height));
    }
  }

  // States
  @each $state in $states {
    @include parent(".is-#{$state} > ") {
      color: _color(state, $state, color);
    }
  }
}
