@import '../../input/style/mixin';

.yee-form-control-validation(@yee-text-color: @yee-input-color; @yee-border-color: @yee-input-border-color; @yee-background-color: @yee-input-bg) {
  .@{yee-prefix}-form-explain,
  .@{yee-prefix}-form-split {
    color: @yee-text-color;
  }
  // 输入框的不同校验状态
  .@{yee-prefix}-input {
    &,
    &:hover {
      background-color: @yee-background-color;
      border-color: @yee-border-color;
    }

    &:focus {
      .yee-active(@yee-border-color);
    }

    &:not([disabled]):hover {
      border-color: @yee-border-color;
    }
  }

  .@{yee-prefix}-calendar-picker-open .@{yee-prefix}-calendar-picker-input {
    .yee-active(@yee-border-color);
  }

  // Input prefix
  .@{yee-prefix}-input-affix-wrapper {
    .@{yee-prefix}-input {
      &,
      &:hover {
        background-color: @yee-background-color;
        border-color: @yee-border-color;
      }

      &:focus {
        .yee-active(@yee-border-color);
      }
    }

    &:hover .@{yee-prefix}-input:not(.@{yee-prefix}-input-disabled) {
      border-color: @yee-border-color;
    }
  }

  .@{yee-prefix}-input-prefix {
    color: @yee-text-color;
  }

  .@{yee-prefix}-input-group-addon {
    color: @yee-text-color;
    background-color: @yee-background-color;
    border-color: @yee-border-color;
  }

  .has-feedback {
    color: @yee-text-color;
  }
}

// Reset form styles
// -----------------------------
// Based on Bootstrap framework
.yee-reset-form() {
  legend {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 0;
    color: @yee-text-color-secondary;
    font-size: @yee-font-size-lg;
    line-height: inherit;
    border: 0;
    border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-base;
  }

  label {
    font-size: @yee-font-size-base;
  }

  input[type='search'] {
    box-sizing: border-box;
  }

  // Position radios and checkboxes better
  input[type='radio'],
  input[type='checkbox'] {
    line-height: normal;
  }

  input[type='file'] {
    display: block;
  }

  // Make range inputs behave like textual form controls
  input[type='range'] {
    display: block;
    width: 100%;
  }

  // Make multiple select elements height not fixed
  select[multiple],
  select[size] {
    height: auto;
  }

  // Focus for file, radio, and checkbox
  input[type='file']:focus,
  input[type='radio']:focus,
  input[type='checkbox']:focus {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
  }

  // Adjust output element
  output {
    display: block;
    padding-top: 15px;
    color: @yee-input-color;
    font-size: @yee-font-size-base;
    line-height: @yee-line-height-base;
  }
}
