//
// input-control
//

.#{$input-prefix-cls}-control {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-height: $input-height;
  padding-right: $input-padding-x;
  padding-left: $input-padding-x;
  font-size: $input-font-size;
  line-height: $input-height - $border-width*2;
  color: $gray-9;
  background-color: $white;
  border: $border-width solid transparent;
  border-radius: $border-radius;

  

  input,
  textarea {
    width: 100%;
    font-size: inherit;
    color: $input-color;
    /* NOTE: 不需要加font-weight */
    // font-weight: 600;
    //line-height: $input-height - $border-width*2;
    // color: inherit;

    &::placeholder {
      color: $input-placeholder-color;
    }
  }

  /* 用于解决picker中type等于button中样式 */
  input[type="button"] {
    border: 0 none;
    background: #fff;
    outline: none;
  }

  &__textarea {
    display: block;

    &__tool {
      // position: relative;
      height: .64rem;
    }

    textarea{
      display: block;
      padding-top: ($list-item-height - $textarea-line-height)/2;
      font-weight: 400;
      line-height: $textarea-line-height;
    }

    .textarea-clear {
      position: absolute;
      right: 0;
      top: 0;
      transform: translateY(50%);
      color: $gray-11;
      font-size: $font-size-sm;
      span:not(.clear-icon) {
        display: none;
      }
  
      .clear-icon {
        font-size: $input-clear-icon-font-size;
        @extend %aid-icon;
  
        &::before{
          content: "\F2B5";
        }
      }
    }
  
    .textarea-count {
      position: absolute;
      right: 0;
      bottom: 0;
      font-size: .28rem;
      color: $gray-11;
  
      span{
        color: $black;
      }
    }
  }
  
  

  // 清除图标
  .#{$input-prefix-cls}-control__clear {
    display: none;
    font-size: $input-clear-icon-font-size;
    color: $gray-11;
    @extend %aid-icon;

    &::before{
      content: "\F2B5";
    }
  }

  &--clear {
    .#{$input-prefix-cls}-control__clear {
      display: block;
    }
  }

  &--focus {
    border-color: $brand-primary;
  }

  // 输入框内容水平居右
  &--text-right {
    input {
      text-align: right;
    }
  }

  // 列表下的 input-control
  .#{$list-prefix-cls}__item & {
    // min-height: $list-item-height;
    padding: 0;
    border: none;
    border-radius: 0;
  }

  // 弹出框下的 input-control
  .#{$modal-prefix-cls} & {
    min-height: $input-modal-height;
    padding-right: $input-modal-padding-x;
    padding-left: $input-modal-padding-x;
    margin-top: $input-modal-margin-top;
    font-size: $input-modal-font-size;
    line-height: $input-modal-height - $border-width-sm*2;
    border: $border-width-sm solid $gray-12;

    input {
      font-weight: 400;
      line-height: $input-modal-height - $border-width-sm*2;
    }
  }

  @include status-disabled;
}



//
// input-item
//

.#{$input-prefix-cls}-item {
  &.#{$list-prefix-cls}__item {
    min-height: 1rem;
    // padding-right: $list-item-padding-x;
    padding-right: $list-item-form-padding-x;
  }

  &__label,
  &__content{
    // 覆盖row col 的 padding值
    padding: 0;
  }

  &__label{
    // line-height: $list-item-height;

    /* NOTE: 修改颜色 */
    // color: $gray-9;
    line-height: 1.44;
    color: $input-color;
  }

  &__content {

    &:not(:last-child) {
      margin-right: $list-content-margin-right;
    }
  }

  // label 在输入框上方
  &--top {
    margin-bottom: $input-label-top-margin-bottom;
    .#{$input-prefix-cls}-item__label {
      display: block;
      margin-bottom: $input-label-margin-bottom;
      font-size: $input-label-font-size;
      line-height: 1;
    }
  }
}



//
// Form validation states
//

.has-success {
  .#{$input-prefix-cls}-control {
    color: $brand-success;
    border-color: $brand-success;
  }
}

.has-warning {
  .#{$input-prefix-cls}-control {
    color: $brand-warning;
    border-color: $brand-warning;
  }
}

.has-danger {
  .#{$input-prefix-cls}-control {
    color: $brand-danger;
    border-color: $brand-danger;
  }
}
