label {
  overflow: hidden;
  input[type="checkbox"] {
    display: none;
  }
  input[type="checkbox"] + span {
    display: inline-block;
    height: 21px;
    overflow: hidden;
    cursor: pointer;
    vertical-align: middle;
  }
  input[type="checkbox"] + span::before,
  input[type="checkbox"] + i18n::before {
    content: " ";
    border: 2px solid $grey;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: top;
    margin-right: 5px;
    @include run-transition(all);
    box-sizing: border-box;
  }
  input[type="checkbox"]:checked + span::before,
  input[type="checkbox"]:checked + i18n::before {
    content: " ";
    transform: rotate(40deg);
    -webkit-transform: rotate(40deg);
    border-color: $green;
    height: 25px;
    width: 20px;
    margin-top: -11px;
  }
  input[type="checkbox"]:disabled + span::before {
    border-color: $neutral-grey !important;
  }
}

label.wrapping-checkbox {
  overflow: visible;

  &:not([disabled]) {
    span,
    i18n {
      cursor: pointer;
    }
    &:hover {
      i18n:before {
        box-shadow: 2px 2px 2px rgba($primary-light, 0.7) inset;
      }
    }
  }

  input[type="checkbox"] + span::before,
  input[type="checkbox"] + i18n::before {
    content: " ";
    border: 2px solid $primary-dark;
    width: 15px;
    height: 15px;
    background: $white;
    margin: 0;
    transform: none;
    -webkit-transform: none;
    opacity: 1;
    margin-right: 8px;
    margin-top: 4px;
  }
  input[type="checkbox"] + span::after,
  input[type="checkbox"] + i18n::after {
    @include run-transition(all);
    @include fonticon;
    content: "\e916";
    display: block;
    position: absolute;
    left: -2px;
    bottom: 3px;
    border-radius: 15px;
    width: 14px;
    height: 14px;
    font-size: 19px;
    line-height: 16px;
    text-indent: -1px;
    background: $white;
    color: $primary-dark;
    border: 3px solid $white;
    opacity: 0;
    line-height: -moz-block-height;
    margin-right: 8px;
    margin-top: 4px;
    top: -3px;
  }
  input[type="checkbox"]:checked + span::before,
  input[type="checkbox"]:checked + i18n::before {
    opacity: 0;
  }
  input[type="checkbox"]:checked + span::after,
  input[type="checkbox"]:checked + i18n::after {
    opacity: 1;
  }

  input[type="checkbox"]:disabled + span::before {
    border-color: $neutral-grey !important;
    pointer-events: none;
  }

  &[disabled] {
    input[type="checkbox"] + span::before,
    input[type="checkbox"] + i18n::before {
      border: 2px solid $solid-grey;
    }

    & + i18n {
      color: $solid-grey;
    }
  }
}

// connexion panel label
input#rememberMe,
small {
  cursor: pointer;
}
input#rememberMe + small {
  &:before {
    content: "";
    appearance: auto;
    border: 2px solid $grey;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: top;
    margin-right: 10px;
    box-sizing: border-box;
    margin-left: -7px;
    margin-top: 3px;
    @include run-transition(all);
  }
}
input#rememberMe:checked + small {
  &:before {
    transform: rotate(40deg);
    border-color: #46bfaf;
    height: 25px;
    width: 20px;
    margin-top: -11px;
    border-top-color: transparent;
    border-left-color: transparent;
  }
}
