@import 'src/mixins/index';

.label {
  min-width: 20px;
  min-height: 20px;
  display: flex;
}

.input {
  @include visuallyHidden;
  @include focusVisible {
    & + .shape {
      @include focusOutline;
    }
  }
}

.input + .shape {
  position: relative;
  @include highlightOff;
  display: inline-block;
  min-width: 20px;
  width: 20px;
  height: 20px;
  border: 1px solid chaser-color('Mid Neutral 3');
  background-color: chaser-color('White');
  border-radius: 3px;
  cursor: pointer;
}

.input:checked + .shape {
  background-color: chaser-color('Blue');
  border-color: transparent;
}

.input:indeterminate + .shape {
  background-color: chaser-color('Blue');
  border-color: transparent;
  position: relative;

  &::before {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background-color: chaser-color('White');
  }
}

.input:disabled + .shape {
  background-color: chaser-color('Light Neutral 2');
  border: 1px solid chaser-color('Mid Neutral 3');
  cursor: default;

  &:hover {
    border-color: chaser-color('Mid Neutral 3');
  }
  &::before {
    background-color: chaser-color('Mid Neutral 3');
  }
}

.checkedIcon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  margin: auto;
  color: chaser-color('White');
}

.input:disabled:checked + .shape {
  background-color: chaser-color('Light Neutral 2');
  border-color: chaser-color('Mid Neutral 3');
  cursor: default;

  .checkedIcon {
    color: chaser-color('Mid Neutral 3');
  }
}

.input + .shape:hover {
  border: 1px solid chaser-color('Mid Neutral 2');
}

.text {
  font-size: 14px;
  margin-left: 10px;
  line-height: 20px;
}
