.switch {
  position: relative;
  display: inline-block;
  width: 4rem;
  height: 2rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 2rem;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 1.6rem;
  width: 1.6rem;
  left: 0.3rem;
  top: 0.2rem;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #4fca75;
}

.switch input:checked + .slider:before {
  -webkit-transform: translateX(1.9rem);
  -ms-transform: translateX(1.9rem);
  transform: translateX(1.9rem);
}
