@import '../styles/themes/themes.less';

@keyframes form-error-appear-animation {
  from {
    opacity: 0;
    transform: translateY(-30%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.@{bk-prefix}-form {
  text-align: left;

  &--vertical {

    .@{bk-prefix}-form-label {
      float: unset;
      width: auto;
      padding-right: 0;
      margin-bottom: 6px;
      line-height: 20px;
      text-align: left;

    }
  }
}

.@{bk-prefix}-form-item {
  margin-bottom: 24px;

  &--vertical {

    .@{bk-prefix}-form-label {
      float: unset;
      width: auto;
      padding-right: 0;
      margin-bottom: 6px;
      line-height: 20px;
      text-align: left;
    }
  }

    &--default {

    .@{bk-prefix}-form-label {
      float: left;
      padding-right: 22px;
      line-height: 32px;
      text-align: right;
    }
  }

  &.is-required {
    .@{bk-prefix}-form-label {
      &:after {
        position: absolute;
        top: 0;
        width: 14px;
        color: #ea3636;
        text-align: center;
        content: '*';
      }
    }
  }

  &.is-error {
    .@{bk-prefix}-input,
    .@{bk-prefix}-textarea,
    .@{bk-prefix}-cascader,
    .@{bk-prefix}-date-picker-editor,
    .@{bk-prefix}-select-tag,
    .@{bk-prefix}-tag-input {
      border-color: #ea3636;
      transition: all .15s;
    }
  }

  &:after,
  &:before {
    display: table;
    content: ''
  }

  &:after {
    clear: both
  }
}

.@{bk-prefix}-form-label {
  position: relative;
  box-sizing: border-box;
  float: left;
  padding-right: 22px;
  font-size: 14px;
  font-weight: normal;
  line-height: 32px;
  color: #63656e;
  text-align: right;
  vertical-align: middle;
}
.@{bk-prefix}-form-label-description {
  cursor: pointer;
  border-bottom: 1px dashed #979ba5;
}
.@{bk-prefix}-form-label-description-popper {
  max-width: 400px;
}

.@{bk-prefix}-form-content {
  position: relative;
  line-height: 32px;
  text-align: left;
}

.@{bk-prefix}-form-error {
  position: absolute;
  left: 0;
  padding-top: 4px;
  font-size: 12px;
  line-height: 1;
  color: #ea3636;
  text-align: left;
  animation: form-error-appear-animation .15s;
}
.@{bk-prefix}-form-error-tips {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  line-height: 1;
  color: #ea3636;
}

.@{bk-prefix}-compose-form-item {
  display: inline-block;
  display: inline-block;

  & > .@{bk-prefix}-input,
  & > .@{bk-prefix}-textarea,
  & > .@{bk-prefix}-select,
  & > .@{bk-prefix}-cascade,
  & > .@{bk-prefix}-color-picker,
  & > .@{bk-prefix}-date-picker,
  & > .@{bk-prefix}-tag-input,
  & > .@{bk-prefix}-tag-selector,
  & > .@{bk-prefix}-search-select {
    float: left;
    width: auto;
    margin-left: -1px;
  }

  .@{bk-prefix}-input,
  .@{bk-prefix}-form-password,
  .@{bk-prefix}-textarea,
  .@{bk-prefix}-select,
  .@{bk-prefix}-cascade,
  .@{bk-prefix}-color-picker,
  .@{bk-prefix}-date-picker .@{bk-prefix}-date-picker-editor,
  .@{bk-prefix}-tag-input,
  .@{bk-prefix}-search-select {
    border-radius: 0;
  }

  .@{bk-prefix}-input.control-active,
  .@{bk-prefix}-select.is-focus,
  .@{bk-prefix}-cascade.is-focus,
  .@{bk-prefix}-color-picker.@{bk-prefix}-color-picker-show-dropdown,
  .@{bk-prefix}-color-picker:hover,
  .@{bk-prefix}-date-picker .@{bk-prefix}-date-picker-editor:focus,
  .@{bk-prefix}-tag-input.active,
  .@{bk-prefix}-tag-selector,
  .@{bk-prefix}-search-select.is-focus {
    z-index: 1;
    opacity: 1;
  }

  .@{bk-prefix}-compose-form-item-head {
    &.@{bk-prefix}-input,
    &.@{bk-prefix}-select,
    &.@{bk-prefix}-cascade,
    &.@{bk-prefix}-color-picker,
    &.@{bk-prefix}-date-picker .@{bk-prefix}-date-picker-editor,
    &.@{bk-prefix}-tag-input,
    &.@{bk-prefix}-tag-input,
    &.@{bk-prefix}-search-select {
      margin-left: 0;
      border-top-right-radius: 0px;
      border-bottom-right-radius: 0px;
    }
  }

  .@{bk-prefix}-compose-form-item-tail {
    &.@{bk-prefix}-input,
    &.@{bk-prefix}-select,
    &.@{bk-prefix}-cascade,
    &.@{bk-prefix}-color-picker,
    &.@{bk-prefix}-date-picker,
    &.@{bk-prefix}-tag-input,
    &.@{bk-prefix}-tag-input,
    &.@{bk-prefix}-search-select {
      border-top-right-radius: 2px;
      border-bottom-right-radius: 2px;
    }
  }
}
