
input[type="checkbox"].onoff {
    position: relative;
    width: 40px;
    height: 20px;
    -webkit-appearance: none;
    background: #2e3138;
    outline: none;
    border-radius: 20px!important;
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    transition: 0.7s;
}

.was-validated .form-check-input:valid:checked, 
.form-check-input.is-valid:checked,
input:checked[type="checkbox"] {
  background-color: #08a95a;
  border-color: #08a95a;
}

input[type="checkbox"].onoff:before {
  margin-left: 2px;
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 20px;
  top: 2px;
  left: 1px;
  background: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: .5s;
} 

input:checked[type="checkbox"]:before {
  left: 20px;
}