.MYUI-Switch {
  box-sizing: border-box;
  display: inline-block;
  height: 30px;
  line-height: 30px;
  position: relative;
  vertical-align: middle;
  font-size: 14px;
  --SWITCH-size_button: 30px;
  --SWITCH--text_color: var(--text_primary);
}

.MYUI-Switch .MYUI-Switch__in {
  display: inline-block;
  height: var(--SWITCH-size_button);
  width: var(--width_swidth);
  box-sizing: border-box;
  position: relative;
  border-radius: 20px;
  transition: background-color 0.3s cubic-bezier(0, 1, 0.5, 1);

  border: 1px solid rgba(var(--background_border_default));
}

.MYUI-Switch .MYUI-Switch__in:before {
  content: attr(data-label-on);
  box-sizing: border-box;
  width: calc(var(--width_swidth)/2);
  height: calc(var(--SWITCH-size_button) - 2px);
  position: absolute;
  top: 0px;
  left: calc(var(--width_swidth)/2.2);
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  text-align: center;

  color: var(--SWITCH--text_color);
  font-size: var(--font_size_footnote);
  line-height: var(--font_size_footnote);
}

.MYUI-Switch input[type="checkbox"]:checked+.MYUI-Switch__in:after {
  left: -1px;
}

.MYUI-Switch .MYUI-Switch__in:after {
  content: attr(data-label-off);
  box-sizing: border-box;
  width: calc(var(--SWITCH-size_button) - 6px);
  height: calc(var(--SWITCH-size_button) - 6px);
  border-radius: 20px;
  position: absolute;
  left: 2px;
  top: 2px;
  z-index: 5;
  background: white;

  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  text-align: center;

  font-size: var(--font_size_footnote);
  line-height: var(--font_size_footnote);
  color: var(--text_secondary);
  transition: transform 0.3s cubic-bezier(0, 1, 0.5, 1);
}

.MYUI-Switch input[type="checkbox"] {
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.MYUI-Switch input[type="checkbox"]:checked+.MYUI-Switch__in {
  background-color: rgba(var(--background_active));
}

.MYUI-Switch input[type="checkbox"]:checked+.MYUI-Switch__in:before {
  content: attr(data-label-off);
  left: 0;
}

.MYUI-Switch input[type="checkbox"]:checked+.MYUI-Switch__in:after {
  content: attr(data-label-on);
  color: rgba(var(--background_active));
  transform: translate3d(calc(var(--width_swidth)/2 - 2px), 0, 0);
}

/* Hover */
.MYUI-Switch input[type="checkbox"]:not(:disabled)+.MYUI-Switch__in:hover {
  cursor: pointer;
}

.MYUI-Switch input[type="checkbox"]:not(:disabled):checked+.MYUI-Switch__in:hover:after {
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4);
}

/* Disabled */
.MYUI-Switch input[type=checkbox]:disabled+.MYUI-Switch__in {
  opacity: 0.6;
  filter: grayscale(50%);
}