

//Custom Checkbox
.checkbox-item {
  position: relative;
  width: 24px;
  height: 24px;
  border: $border-width solid $link-color;
  border-radius: $border-radius;
  background-color: $input-bg;
  text-align: center;

  input {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0;

    &:disabled {
      cursor: not-allowed;
    }
  }

  input:checked ~ .checkbox-item-indicator {
    @include io-icomoon('check');
    background-color: $input-bg;
    background-image: none;
    color: $petrol;
    pointer-events: none;

    &::before {
      display: block;
      position: absolute;
      top: 2px;
      left: 3px;
      height: 24px;
      font-size: 20px;
    }
  }
}





//////// LEGACY CUSTOM CHECKBOXES ////////

.custom-checkbox-lg {
  min-height: $custom-checkbox-size;
  line-height: $custom-checkbox-size;

  .custom-control-label:before,
  .custom-control-label:after {
    height: $custom-checkbox-size;
    width: $custom-checkbox-size;
  }
}

.testio-checkbox {


  &.testio-checkbox-white {

    label {
      color: $white;
    }

    .custom-control-label:before {
      border-color: $white;
      transition: none;
      background-color: transparent;
    }

    .custom-control-input:checked ~ .custom-control-label {
      color: $white;
      background-color: transparent;

      &:before {
        border-color: $blue-dark;
        background-color: $blue-dark;
        color: $white;
      }
    }
  }

  .custom-control-label {
    cursor: pointer;
    &:before {
      border-color: $petrol;
      transition: none;
      background-color: $input-bg;
    }

    &:hover {
      &:before {
        border-color: $link-hover-color;
      }
    }
  }

  &.custom-checkbox-sm {
    min-height: $custom-checkbox-size-sm;
    line-height: $custom-checkbox-size-sm;


    .custom-control-label:before,
    .custom-control-label:after {
      top: 0;
      left: -(2 * $custom-control-indicator-size);
      border-radius: .25rem;
      height: $custom-checkbox-size-sm;
      width: $custom-checkbox-size-sm;
    }

    .custom-control-input:checked ~ .custom-control-label {
      &:before {
        padding-top: 0px;
        padding-left: 1px;
      }
    }
  }

  .custom-control-input.custom-control-input-dark:checked ~ .custom-control-label {
    &:before {
      background-color: $petrol;
      color: $white;
    }
  }

  .custom-control-input:checked ~ .custom-control-label {
    @include io-icomoon("check");
    color: $label-default-color;
    background-color: $input-bg;

    &:before {
      background-color: transparent;
      border-color: $petrol;
      color: $input-color;
      font-size: $font-size-icon;
      padding: $spacing-xxs;
    }

    &:after {
      background-image: none;
      color: $input-color;
    }
  }
}

//Custom Radiobutton
.radio-inline input[type="radio"], .checkbox-inline input[type="checkbox"] {
  margin-right: 4px;
}
.radio-inline,
.checkbox-inline {
  &.list-group-item{
    padding-left: 4px;
    margin-left: 0px;
  }
}

// Dark theme
.dark-form-control {
  background-color: transparent;
  border-color: $petrol;
  color: $white;
}

.radiobox-item {
  position: relative;
  width: 24px;
  height: 24px;
  border: $border-width solid $link-color;
  border-radius: 24px;
  background-color: $input-bg;
  text-align: center;

  input {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0;

    &:disabled {
      cursor: not-allowed;
    }
  }

  input:checked ~ .radiobox-item-indicator {
    @include io-icomoon('check');
    background-color: $input-bg;
    background-image: none;
    color: $petrol;
    pointer-events: none;

    &::before {
      display: block;
      position: absolute;
      top: 4px;
      left: 5px;
      font-size: 16px;
    }
  }
}

.has-danger {
  .custom-control-label:before,
  .custom-control-input:checked ~ .custom-control-label:before,
  .custom-control-input:checked ~ .custom-control-label:after, {
    border-color: $danger;
    color: $danger;
  }
}

.required-field::after {
  content: " *";
  display: inline;
}

.optional-field::after {
  content: " (optional)";
  display: block;
}

.checkbox-without-label {
  width: $custom-checkbox-size;
  height: $custom-checkbox-size;
}

.checkbox-inline.no-indent,
.checkbox-inline.no-indent+.checkbox-inline.no-indent {
  margin-left: 0;
}

.checkbox-inline.no-indent {
  padding-left: 0;
  padding-right: 1.25rem;
}

.checkbox-inline.no-indent:last-child {
  padding-right: 0;
}

.vertical-boolean {
  .radio_buttons, .boolean, .check_boxes {
    margin-right: .50rem;
  }

  .radio, .checkbox {
    display: block;
  }
}
