@import '../vars';

@--row-gutter: 6px;
.z-form-row {
  .ant-form-item-children,
  .ant-input-number {
    display: inline-block;
  }
  .ant-form-item-children,
  .ant-input-number,
  .ant-time-picker {
    width: 100%;
  }
  .ant-calendar-picker {
    width: 100% !important;
  }
  .ant-form-explain,
  .ant-form-extra {
    font-size: 12px;
  }
  margin-left: -@--row-gutter;
  margin-right: -@--row-gutter;
  & > div {
    padding-left: @--row-gutter;
    padding-right: @--row-gutter;
  }
}

.z-form-label-vertical .ant-form-item {
  margin-bottom: 22px;
  &.ant-form-item-with-help {
    margin-bottom: 0px;
  }
}
.z-form-label-horizontal {
  .ant-form-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 22px;
    &.ant-form-item-with-help {
      margin-bottom: 0px;
    }
  }
  .ant-form-item-control-wrapper {
    flex: 1;
  }
}
.z-form-label-inline {
  .ant-radio-group,
  .ant-checkbox-group {
    display: block !important;
    box-sizing: border-box;
    background-color: #fff;
    border: 1px solid @border-color-base;
    border-radius: 4px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    min-height: @input-height-base;
    padding: 0 15px;
    line-height: @input-height-base;
  }

  &.z-form-control-small {
    .ant-form-item-control {
      line-height: 1.5;
    }

    .ant-radio-group,
    .ant-checkbox-group {
      min-height: @input-height-sm;
      line-height: @input-height-sm;
    }
    .z-form-item {
      .ant-form-item-label {
        transform: scale(0.85) translateY(-50%);
      }
      &.focus .ant-form-item-label,
      &.has-value .ant-form-item-label {
        transform: scale(0.75) translateY(-80%);
      }
      .ant-form-explain {
        transform: scale(0.9);
      }
    }
  }
  &.z-form-control-large {
    .ant-radio-group,
    .ant-checkbox-group {
      min-height: @input-height-lg;
      line-height: @input-height-lg;
    }
  }
  .z-form-item {
    margin-bottom: 12px;
    .ant-form-item-label {
      transform-origin: left center;
      border-radius: 4px 4px 0 0;
      padding: 0 6px;
      position: absolute;
      line-height: 1.4;
      top: 50%;
      left: 11px;
      transform: scale(1) translateY(-50%);
      pointer-events: none;
      z-index: 9;
      text-align: left;
      transition: left 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), top 150ms cubic-bezier(0.4, 0, 0.2, 1);
      background-color: transparent;
      label {
        color: #b7b9bc;
      }
    }

    .ant-form-item-label label:after {
      display: none;
    }
    textarea.ant-input {
      padding: 8px 11px;
    }
    &.focus .ant-form-item-label,
    &.has-value .ant-form-item-label {
      transform: scale(0.85) translateY(-50%);

      top: 0;
      // z-index: 1;
      background-color: white;
      left: 3px;
      // label {
      // 	color: #80868b;
      // }
    }
    &.has-disabled {
      .ant-form-item-label {
        background-color: #f5f5f5;
        label {
          color: #6c6c6c;
        }
      }
    }
    &.focus .ant-form-item-label label {
      color: #2f6baa;
    }
    &.has-value .ant-input {
      color: #202124;
      font-weight: 400;
    }
    .ant-form-explain {
      position: absolute;
      padding: 0 6px;
      background-color: white;
      bottom: -10px;
      right: 11px;
      z-index: 2;
    }
    &.ant-form-item-with-help {
      margin-bottom: 12px;
    }
    .ant-switch {
      margin: 4px 0 0;
    }
  }
  // .ant-form-item,
  // .ant-form-item-with-help {
  // 	margin-bottom: 16px !important;
  // }
  .ant-input:focus,
  .ant-input-number-focused,
  .ant-select-focused {
    box-shadow: none;
    // border-width: 1px !important;
  }
}
