@import './common/variable.scss';
@import './common/color.scss';


// placeholder样式
@mixin selectPlaceholder() {
  font-size: 14px;
  height: 20px;
  line-height: 20px;
  font-weight: 400;
  color: $gray-c9;
}
.normal-input {
  margin-bottom: 39px;
  position: relative;
  &.hover {
    .placeholder {
      bottom: 27px;
      font-size: 12px;
    }
    .line {
      opacity: 0;
    }
    .line-hover {
      width: 100%;
      left: 0;
    }
  }
  // 单选下拉框
  &.select {
    input {
      cursor: pointer;
      &::placeholder {
        @include selectPlaceholder();
      }
    }
  }
  // 多选下拉框
  &.multi-select {
    input {
      cursor: pointer;
    }
  }
  &.error-wrap {
    &.hover {
      .placeholder {
        color: $red-2;
      }
    }
    .line-hover {
      background-color: $red-2;
    }
  }
  // 输入框
  input {
    font-size: 14px;
    height: 27px;
    line-height: 27px;
    font-weight: 400;
    color: $black-deep;
    left: 0;
    padding: 2px 7px;
    outline: none;
    border-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  // 输入框默认展示文字
  .placeholder {
    @include selectPlaceholder();
    position: absolute;
    left: 7px;
    bottom: 10px;
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    font-weight: 400;
    color: $gray-c9;
    z-index: 1;
    transition: bottom .3s ease;
    cursor: pointer;
  }
  // 下边框
  .line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: $gray-c9;
    z-index: 4;
    transition: opacity .3s;
  }
  // 下边框hover
  .line-hover {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: $black-border;
    z-index: 3;
    transition: all .3s;
  }
  .input-wrap {
    // 验证码输入框
    &.input-verify-code {
      .send-btn {
        display: inline-block;
        position: absolute;
        right: 0;
        // 发送按钮
        .send {
          color: $blue;
          font-size: 14px;
          line-height: 20px;
          font-weight: 400;
          text-decoration: none;
          &:hover {
            text-decoration: underline;
          }
        }
        // 剩余时间
        .spare-time {
          color: $gray-2;
          font-size: 14px;
          line-height: 20px;
        }
      }
    }
    // 密码框
    &.input-password {
      position: relative;
      .eye-btn {
        position: absolute;
        right: 0;
        top: 2px;
        display: inline-block;
        cursor: pointer;
        .iconeye-clouse,
        .iconeye_show {
          color: $gray-eye;
          font-size: 8px;
        }
        .iconeye_show {
          color: $gray-eye;
          font-size: 14px;
        }
      }
    }
    // 单选
    &-select {
      position: relative;
      height: 27px;
      line-height: 27px;
      display: flex;
      input {
        flex: 1;
      }
      .select-wrap {
        width: 27px;
        position: relative;
        bottom: 1px;
        right: 1px;
      }
    }
    // 多选级联
    &-multi-select {
      height: 27px;
      line-height: 27px;
      display: flex;
      position: relative;
      .multi-select {
        position: relative;
        // 选择框容器
        .select-wrap {
          position: absolute;
          right: 0;
          bottom: 1px;
          z-index: 5;
        }
        // 父级选项
        &-parent {
          width: 117px;
        }
        // 子级选项
        &-child {
          flex: 1;
          input {
            text-indent: 53px;
          }
        }
      }
    }
  }
  .error-msg {
    position: absolute;
    left: 8px;
    bottom: -20px;
    color: $red-2;
    font-size: 12px;
    height: 20px;
    line-height: 20px;
    font-weight: 400;
  }
}
