@import 'common/var.scss';

.qf-radio {
  color: #606266;
  font-weight: 500;
  line-height: 1;
  position: relative;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  outline: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  font-size: 14px;

  & + & {
    margin-left: 24px;
  }

  .qf-radio-label {
    font-size: 14px;
    padding-left: 12px;
  }

  .qf-radio-input {
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    display: inline-block;
    line-height: 1;
    position: relative;
    vertical-align: middle;

    &.is-checked .qf-radio-inner {
      border-color: $--color-primary;
      background: $--color-primary;

      &:after {
        transform: translate(-50%, -50%) scale(1);
      }
    }

    &.is-checked + .ql-radio-label {
      color: #409eff;
    }

    &.is-disabled.is-checked .qf-radio-inner {
      background-color: $--color-font-light-3;
      border-color: $--color-font-light-3;
    }

    &.is-disabled .qf-radio-inner {
      background-color: $--color-bg-light;
      cursor: not-allowed;
    }

    &.is-disabled + span.ql-radio-label {
      color: #c0c4cc;
      cursor: not-allowed;
    }

    .qf-radio-inner {
      border: 1px solid $--color-border;
      border-radius: 100%;
      width: 20px;
      height: 20px;
      background-color: #fff;
      position: relative;
      cursor: pointer;
      display: inline-block;
      box-sizing: border-box;

      &:after {
        width: 8px;
        height: 8px;
        border-radius: 100%;
        background-color: #fff;
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0);
        transition: transform 0.15s cubic-bezier(0.71, -0.46, 0.88, 0.6);
        /*-webkit-backface-visibility: hidden;*/
        /*-webkit-transform-style: preserve-3d;*/
      }
    }

    .qf-radio-original {
      opacity: 0;
      outline: none;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0;
    }
  }
}
