@import "mixins/mixins";
@import "mixins/utils";
// @import "common/var";

@include b(form) {
  @include m(label-left) {
    & .el-form-item__label {
      text-align: left;
    }
  }
  @include m(label-top) {
    // & .el-form-item__label {
    //   float: none;
    //   display: inline-block;
    //   text-align: left;
    //   padding: 0 0 10px 0;
    // }
    .el-form-item {
      display: flex;
      flex-direction: column;
    }
    .el-form-item__label {
      text-align: left;
      padding: 0;
      line-height: unset;
      margin-bottom: 8px;
      height: auto;
    }
    .el-form-item__content {
      margin-left: 0 !important;
      line-height: unset;
    }
  }
  @include m(label-inline) {
    & .el-form-item {
      display: inline-block;
      margin-right: 10px;
      vertical-align: top;
    }
    & .el-form-item__label {
      float: none;
      display: inline-flex;
    }
    & .el-form-item__content {
      display: inline-block;
      vertical-align: top;
      margin-left: 0 !important;
    }
    &.el-form--label-top .el-form-item__content {
      display: block;
    }
  }
  @include m(inline) {
    & .el-form-item {
      display: inline-block;
      margin-right: 10px;
      vertical-align: top;
    }
    & .el-form-item__label {
      float: none;
      display: inline-block;
    }
    & .el-form-item__content {
      display: inline-block;
      vertical-align: top;
    }
    &.el-form--label-top .el-form-item__content {
      display: block;
    }
  }

  @include e(icon) {
    font-size: $--font-size-title-1;
    //color: $--primary-6;
    color: $--color-text-2;
    width: $--size-5;
    height: $--size-5;
    text-align: center;
    & + & {
      margin-left: 12px;
      color: $--color-text-2;
    }
    &:hover {
      width: $--size-5;
      height: 2$--size-5;
      background-color: $--color-bg-3;
      // border-radius: 50%;
      border-radius: $--border-radius-circle;
      line-height: $--size-5;
      text-align: center;
    }
  }
}
@include b(form-item) {
  margin-bottom: 24px;
  &:last-child{
    margin-bottom: 0;
  }
  @include utils-clearfix;

  .el-radio {
    // radio 在表单里，单选框参照复选框距离左侧的位置
    padding-left: 5px;
  }
  
  @include e(note) {
    height: 18px;
    line-height: 18px;
    padding-left: 12px;
    position: absolute;
    font-size: $--font-size-body-1;
  }
  @include e(waiting) {

  }
  @include e(info) {
    //line-height: 22px;
    font-size: $--font-size-body-1;
    color: $--color-text-3;
    //padding: 0 12px;
    // new
    line-height: 1;
    padding-left: 12px;
    padding-top: 4px;
    position: absolute;
    top: 100%;
    left: 0;

  }
  & .el-form-item {
    margin-bottom: 0;
  }
  
	.hintBox *{
		color:  $--color-text-3;
		font-size: $--font-size-body-1;
	}
  & .el-input__validateIcon {
    display: none;
  }

  @include e(content) {
    line-height: $--input-large-height;
    position: relative;
    font-size: $--font-size-body-3;
    @include utils-clearfix;

    .el-date-editor{
      // 不明白为什么日期选择器是inline-block, inline-block会有base-line，导致父级被撑起
      display: inline-flex;
    }
    .el-upload__picture-wall{
      line-height: 1;
    }
    
    .el-button + .el-button {
      margin-left: 11px;
    }
    
    .el-input-group {
      vertical-align: top;
    }

    .el-checkbox-group {
      min-height: $--input-large-height;
    }

    @include e(waiting) {
      > p {
        &:first-child {
          color: #e6a23c;
          font-size: $--font-size-body-1;
          padding-left: 12px;
          position: absolute;
          &::before {
            content: '\e0ed';
            font-family: 'element-icons' !important;
            animation: rotating 2s linear infinite;
            font-size: $--font-size-body-3;
            display: inline-block;
          }
        }
      }
    }
  }
  
  @include m(medium) {
    .el-form-item__label {
      height: $--input-medium-height;
    }
    .el-form-item__content {
      line-height: $--input-medium-height;
      .el-checkbox-group {
        height: $--input-medium-height;
      }
    }
  }
  @include m(small) {
    .el-form-item__label {
      height: $--input-small-height;
    }
    .el-form-item__content {
      line-height: $--input-small-height;
      .el-checkbox-group {
        height: $--input-small-height;
      }
    }
    &.el-form-item {
      margin-bottom: 18px;
    }
    .el-form-item__error {
      padding-top: 2px;
    }
  }
  @include m(mini) {
    .el-form-item__label {
      height: $--input-mini-height;
    }
    .el-form-item__content {
      line-height: $--input-mini-height;
      .el-checkbox-group {
        height: $--input-mini-height;
      }
    }
    &.el-form-item {
      margin-bottom: 18px;
    }
    .el-form-item__error {
      padding-top: 1px;
    }
  }
  
  @include e(label-wrap) {
    float: left;
    .el-form-item__label {
      display: inline-block;
      float: none;
    }
  }

  @include e(label) {
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: $--font-size-body-3;
    color: $--color-text-1;
    height: $--input-large-height;
    padding: 0 12px 0 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    &__text{
      line-height: 22px;
      flex: 1;
    }
  }

  @include e(error) {
    color: $--danger-6;
    font-size: $--font-size-body-1;
    line-height: 1;
    padding-left: 12px;
    padding-top: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    
    @include m(inline) {
      position: relative;
      top: auto;
      left: auto;
      // display: inline-block;
      // margin-left: 10px;
    }
  }
  @include e(warning) {
    color: $--warning-6;
    font-size: $--font-size-body-1;
    line-height: 1;
    padding-left: 12px;
    padding-top: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    
    @include m(inline) {
      position: relative;
      top: auto;
      left: auto;
    }
  }
  
  @include when(required) {
    @include pseudo('not(.is-no-asterisk)') {
      & > .el-form-item__label .el-form-item__label__text:before,
      & .el-form-item__label-wrap > .el-form-item__label .el-form-item__label__text:before {
        content: '*';
        color: $--danger-6;
        margin-right: 2px;
      }
    }
  }
  
  @include when(error) {
    & .el-input__inner,
    & .el-textarea__inner {
      &, &:focus {
        border-color: $--danger-6 !important;
      }
    }
    & .el-input-group__append,
    & .el-input-group__prepend {
      & .el-input__inner {
        border-color: transparent;
      }
    }
    .el-input__validateIcon {
      color: $--danger-6;
    }
    .el-input__suffix {
      right: 12px;
    }
    & .el-input .el-input__clear {
      color: $--color-white;
      background: $--danger-6;
      width: 16px;
      height: 16px;
      line-height: 16px;
      // border-radius: 50%;
      border-radius: $--border-radius-circle;
      display: inline-block;
      position: relative;
      top: -0.5px;
    }
    .el-input__helper {
      color: $--danger-6;
    }
  }
  @include when(warning) {
    & .el-input__inner,
    & .el-textarea__inner {
      &, &:focus {
        border-color: $--warning-6 !important;
      }
    }
    & .el-input-group__append,
    & .el-input-group__prepend {
      & .el-input__inner {
        border-color: transparent;
      }
    }
    .el-input__validateIcon {
      color: $--warning-6;
    }
    .el-input__suffix {
      right: 12px;
    }
    & .el-input .el-input__clear {
      color: $--color-white;
      background: $--warning-6;
      width: 16px;
      height: 16px;
      line-height: 16px;
      // border-radius: 50%;
      border-radius: $--border-radius-circle;
      display: inline-block;
      position: relative;
      // top: -0.5px;
    }
    .el-input__helper {
      color: $--warning-6;
    }
  }
  @include m(feedback) {
    .el-input__validateIcon {
      display: inline-block;
    }
  }
}

// .el-form--label-32px .el-form-item {
// 	margin-bottom: 32px;
// }
// .el-form--label-24px .el-form-item {
// 	margin-bottom: 24px;
// }
// .el-form--label-16px .el-form-item {
// 	margin-bottom: 16px;
// }

@keyframes rotating {
  0% {
    transform: rotateZ(0deg);
  }
  100% {
    transform: rotateZ(360deg);
  }
}

.el-form-item.more-margin{
  margin-bottom: 36px;
}

