@import '~antd/es/radio/style/index.less';
@import '../variable.less';

@radio-prefix-cls: ~'@{ant-prefix}-radio';
@radio-group-prefix-cls: ~'@{radio-prefix-cls}-group';
@radio-inner-prefix-cls: ~'@{radio-prefix-cls}-inner';
@radio-button-prefix-cls: ~'@{radio-prefix-cls}-button';

.@{radio-inner-prefix-cls} {
  border-radius: 0;
  &::after {
    border-radius: 0;
  }
}
.@{radio-prefix-cls} {
  // 清空选中时动画效果
  &-checked::after {
    display: none;
  }

  &-wrapper:not(&-checked):hover &-inner,
  &:not(&-checked):hover &-inner,
  &-checked &-inner {
    border: @btn-default-hover-border;
  }
  &-input:focus + &-inner {
    box-shadow: none;
    background-color: @btn-default-focus-background;
    border: @btn-default-hover-border;
  }
}
span.@{radio-prefix-cls} + * {
  padding-right: @radio-label-padding-right;
  padding-left: @radio-label-padding-left;
}

.@{radio-button-prefix-cls}-wrapper {
  color: @text-color-secondary;

  &:hover {
    color: @text-color-secondary;
    background-color: @btn-default-hover-background;
    border-color: @text-color-primary;
  }
  &:active {
    background-color: @btn-default-focus-background;
  }

  &:not(:first-child):hover::before,
  &:hover + &::before {
    background-color: @text-color-primary;
  }

  .@{radio-group-prefix-cls}-large & {
    font-size: @btn-font-size-lg;
    height: @btn-height-lg;
    line-height: @line-height-base;
    padding: @btn-padding-vertical-lg @btn-padding-horizontal-lg;
  }

  .@{radio-group-prefix-cls}-small & {
    font-size: @btn-font-size-sm;
    height: @btn-height-sm;
    line-height: @line-height-base;
    padding: @btn-padding-vertical-sm @btn-padding-horizontal-sm;
  }

  &-checked:not(&-disabled) {
    color: @white-color-title;
    background-color: @primary-color-default;
    border-color: @primary-color-default;
    &:hover {
      color: @white-color-title;
      border-color: @primary-color-hover;
      background-color: @primary-color-hover;
      &::before {
        background-color: @primary-color-hover;
      }
    }
    &:active {
      border-color: @primary-color-focus;
      background-color: @primary-color-focus;
      &::before {
        background-color: @primary-color-focus;
      }
    }
    &::before {
      background-color: @input-focus-border-color;
    }
    &:focus-within {
      box-shadow: none;
    }
  }
  &-checked:not(&-disabled):first-child,
  &-checked:not([class*=' quanta-radio-button-wrapper-disabled'])&:first-child {
    border-color: @input-focus-border-color;
    &:hover {
      border-color: @primary-color-hover;
    }
    &:active {
      border-color: @primary-color-active;
    }
  }
}
