* {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  height: 100vh;
  background-color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
}

.toggle {
  width: 150px;
  height: 50px;
  background-color: #e24848;
  border-radius: 50px;
  box-shadow: inset 0 2px 10px #555;
  position: relative;
  transition: background-color 0.5s;
}

.circle {
  width: 5px;
  height: 5px;
  border: 27px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: -5px;
  box-shadow: 0 0 5px #aaa;
  transition: left 0.5s;
}

#check:checked ~ .toggle .circle {
  left: calc(100% - 54px);
}

#check:checked ~ .toggle {
  background-color: #3eb963;
}
