label {
  width: 80px;
  height: 40px;
  position: relative;
  display: block;
  background: #ebebeb;
  border-radius: 200px;
  box-shadow: inset 0px 5px 15px rgba(0, 0, 0, 0.4),
    inset 0px -5px 15px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: 0.3s;
  &:after {
    content: "";
    width: 30px;
    height: 30px;
    position: absolute;
    top: 5px;
    left: 10px;
    background: linear-gradient(180deg, #ffcc89, #d8860b);
    border-radius: 180px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
  }
  svg {
    position: absolute;
    width: 20px;
    top: 10px;
    z-index: 100;
    &.sun {
      left: 15px;
      fill: #fff;
      transition: 0.3s;
    }
    &.moon {
      left: 50px;
      fill: #7e7e7e;
      transition: 0.3s;
    }
  }
}

input {
  width: 0;
  height: 0;
  visibility: visible;
  &:checked + label {
    background: #242424;
    &:after {
      left: 74px;
      transform: translateX(-100%);
      background: linear-gradient(180deg, #777, #3a3a3a);
    }
    svg {
      &.sun {
        fill: #7e7e7e;
      }
      &.moon {
        fill: #fff;
      }
    }
    + .background {
      background: #242424;
    }
  }
  &:active:after {
    width: 80px;
  }
}

.background {
  transition: 0.3s;
}
