@import "../style/typography";
@import "../style/colors";

/* The la-checkbox */

.la-checkbox {
  position: relative;
  display: inline;
  padding-left: 33px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
  user-select: none;

  /* Hide the browser's default checkbox */

  input {
    position: absolute;
    opacity: 0;

    &:checked ~ .la-checkbox__check-mark {
      background-color: $white;

      &:after {
        display: block;
      }
    }
  }

  &:hover input ~ &__check-mark {
    border: solid 1px rgba(3, 20, 34, .3);
    background-color: $midnight-8;
  }

  /* Create a custom checkbox */

  &__check-mark {
    position: absolute;
    top: -2px;
    left: 0;
    width: 25px;
    height: 25px;
    background-color: $white;
    border-radius: 4px;
    border: solid 1px $midnight-5;
    cursor: pointer;

    &--disabled {
      border: solid 1px $midnight-5;
      background-color: $midnight-8;
      opacity: .4;
      cursor: not-allowed;
    }

    &--checked {
      background-color: $seafoam-1 !important;
      border: solid 1px $seafoam-1 !important;

      &:hover {
        background-color: $seafoam-5 !important;
        border: solid 1px $seafoam-5 !important;
      }
    }

    &--checkedAndDisabled {
      background-color: $seafoam-1 !important;
      border: solid 1px $seafoam-1 !important;
      opacity: .4;
      cursor: not-allowed;

      &:hover {
        background-color: $seafoam-1 !important;
        border: solid 1px $seafoam-1 !important;
      }
    }

    &:after {
      position: absolute;
      display: none;
      content: "";
      top: 5px;
      left: 9px;
      width: 6px;
      height: 12px;
      border: solid 1px $white;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
    }
  }
}

