.switch {
  background: $color_card;
  height: $size_xl;
  width: $size_xxl;
  border-radius: $size_md;
  transition: background-color $duration_fast;
  cursor: pointer;
  position: relative;
  display: flex;
  outline-offset: $outline_offset;

  &:focus-visible {
    outline: $outline_focus;
  }

  &__dot {
    width: $size_lg;
    height: $size_lg;
    left: $size_xs;
    top: $size_xs;
    background: $color_border;
    border-radius: calc($size_lg / 2);
    position: absolute;
    transition: left $duration_fast, background-color $duration_fast;
  }

  &:hover {
    background-color: $color-border;
  }

  &:hover &__dot {
    background-color: $color_text_secondary;
  }

  &--active {
    background-color: $color_primary;

    &:hover {
      background-color: $color_border;
    }
  }

  &--active &__dot {
    background-color: $color_text;
    left: 20px;
  }

  &--active:hover &__dot {
    background-color: $color_text;
  }
}
