.checkbox-item {
  display: block;
  position: relative;
  padding-left: 30px;
  margin-bottom: 7px;
  width: 100%;
  cursor: pointer;
  input[type='checkbox'],
  input[type='radio'] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 1px;
    width: 1px;
    left: 0;
    top: 50%;
    pointer-events: none;
  }

  .checkmark {
    position: absolute;
    top: 49%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    border: 1px solid $primary-color;
    &--radio {
      border-radius: 50%;
    }
  }
  &:hover input ~ .checkmark {
    background-color: lighten($primary-color, 30%);
  }
  input:checked ~ .checkmark {
    background-color: $primary-color;
  }

  .checkmark:after {
    content: '';
    position: absolute;
    display: none;
  }
  input:checked ~ .checkmark:after {
    display: block;
  }

  input:disabled ~ .checkmark {
    box-shadow: inset 0px 0 0px 1px #eaeaea;
  }
  .checkmark:after {
    left: 5px;
    top: 2px;
    width: 7px;
    height: 11px;
    border: 1px solid $barn-black;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    border-radius: 4px;
  }
}

// How to use in HTML
// <div class="form-item">
//   <label class="checkbox-item fs-base">
//     Checkbox Label
//     <input type="checkbox" v-model="checkboxVModel" />
//     <span class="checkmark"></span>
//   </label>
// </div>

//radio button
.radio-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative;
  padding-left: 32px;
  cursor: pointer;
  user-select: none;
  input {
    position: absolute;
    opacity: 1;
    cursor: pointer;
    left: 2px;
    top: 4px;
    height: 2px;
    width: 2px;
    box-shadow: none;
  }
}

.radio {
  position: absolute;
  left: 0;
  background-color: #fff;
  transition: all 0.2s;
  box-shadow: inset 0px 0 0px 6px $gray-400;
  border-radius: 50% !important;
  top: 0px;
  height: 20px;
  width: 20px;
}
.radio-item:hover input ~ .radio {
  background-color: #fff;
}
.radio-item input:checked ~ .radio {
  background-color: $primary-color;
  box-shadow: inset 0px 0 0px 1px $primary-color;
}
.radio-item input:checked ~ .radio:after {
  display: block;
}
.radio-item input:disabled ~ .radio {
  box-shadow: inset 0px 0 0px 1px #eaeaea;
}
.radio:after {
  content: '';
  position: absolute;
  display: none;
}
.radio-item .radio:after {
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fff;
}
