body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.form-switch-material {
  --switch-color: white;
  --ball-color: var(--secondary-color);
  --ball-active-color: var(--primary-color);
  --line-color: var(--secondary-color);

  position: relative;
  width: 60px;
  height: 32px;
  margin-right: 10px;
  background: var(--switch-color);
  border-radius: 16px;
  box-shadow: 0 1px 3px hsla(231, 100%, 12%, 0.3);
  cursor: pointer;

  input[type="checkbox"] {
    opacity: 0;
    visibility: hidden;
    appearance: none;

    & ~ .line {
      &::before,
      &::after {
        position: absolute;
        content: "";
        top: 14px;
        width: 24px;
        height: 4px;
        background: var(--line-color);
        transition: 0.3s;
      }

      &::before {
        left: 4px;
        border-radius: 2px 0 0 2px;
        transform: scaleX(0);
        transform-origin: left;
      }

      &::after {
        left: 32px;
        border-radius: 0 2px 2px 0;
        transform-origin: right;
      }
    }

    & ~ .ball {
      position: absolute;
      content: "";
      top: 4px;
      left: 4px;
      width: 24px;
      height: 24px;
      background: var(--switch-color);
      border-radius: 50%;
      box-shadow: inset 0 0 0 4px var(--ball-color);
      transition: 0.3s;
    }

    &:checked {
      & ~ .line {
        &::before {
          transform: scaleX(1);
        }

        &::after {
          transform: scaleX(0);
        }
      }

      & ~ .ball {
        box-shadow: inset 0 0 0 12px var(--ball-active-color);
        transform: translateX(28px);
      }
    }
  }
}

