.switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switcher__label {
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

@media (max-width: 639px) {
  .switcher__label {
    font-size: 0.75rem;
    line-height: 1rem;
  }
}

.switcher__label--demo {
  color: light-dark(var(--color-orange-700), var(--color-pink-300));
}

.switcher__toggle {
  display: flex;
  align-items: center;
}

.switcher__input {
  display: none;
}

.switcher__input--demo {
}

.switcher__switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
  width: 2.5rem;
  position: relative;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.switcher__switch--demo {
}

.switcher__background {
  pointer-events: none;
  position: absolute;
  height: 1rem;
  width: 2.25rem;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  border-radius: 9999px;
  transition: background 0.2s ease-in-out;
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-gray-200), var(--color-gray-600)) 0%,
    light-dark(var(--color-gray-400), var(--color-gray-700)) 100%
  );
  box-shadow: inset 0 1px 0 0
      light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)),
    inset 0 2px 2px 0 light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)) inset;
}

.switcher__background--demo {
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-orange-400), var(--color-pink-400)) 0%,
    light-dark(var(--color-orange-600), var(--color-pink-600)) 100%
  );
  box-shadow: inset 0 1px 0 0
      light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)),
    inset 0 2px 2px 0 light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)) inset;
}

.switcher__input:checked ~ .switcher__switch .switcher__background {
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-blue-500), var(--color-blue-400)) 0%,
    light-dark(var(--color-blue-600), var(--color-blue-500)) 100%
  );
  box-shadow: 0 2px 4px -1px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1))
      inset;
}

.switcher__knob {
  pointer-events: none;
  position: absolute;
  left: 0;
  display: inline-block;
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 9999px;
  background-color: var(--color-white);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  border: 1px solid light-dark(var(--color-gray-200), var(--color-gray-600));
  transition: transform 0.2s ease-in-out;
  transform: translateX(0);
}

.switcher__knob--demo {
  transform: translateX(1.25rem);
}

.switcher__input:checked ~ .switcher__switch .switcher__knob {
  transform: translateX(1.25rem);
}

.switcher__input:checked ~ .switcher__switch .switcher__background--demo {
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-orange-400), var(--color-pink-200)) 0%,
    light-dark(var(--color-orange-600), var(--color-pink-400)) 100%
  );
  box-shadow: 0 2px 4px -1px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1))
      inset;
}

.switcher__switch:hover .switcher__knob {
  background-color: var(--color-gray-100);
}

.switcher__switch:focus .switcher__knob {
  box-shadow: 0 0 0 2px white,
    0 0 0 4px light-dark(var(--color-blue-600), var(--color-blue-400)),
    0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.switcher__switch--demo:focus .switcher__knob {
  box-shadow: 0 0 0 2px white,
    0 0 0 4px light-dark(var(--color-orange-400), var(--color-pink-400)),
    0 1px 3px 0 rgb(0 0, 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.switcher__switch[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.switcher__switch[disabled] .switcher__background {
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-gray-200), var(--color-gray-600)) 0%,
    light-dark(var(--color-gray-400), var(--color-gray-700)) 100%
  );
  box-shadow: inset 0 1px 0 0
      light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)),
    inset 0 2px 2px 0 light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)) inset;
}

.switcher__switch[disabled] .switcher__background--demo {
  background: linear-gradient(
    to bottom,
    light-dark(var(--color-gray-200), var(--color-gray-600)) 0%,
    light-dark(var(--color-gray-400), var(--color-gray-700)) 100%
  );
  box-shadow: inset 0 1px 0 0
      light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)),
    inset 0 2px 2px 0 light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3)),
    0 0 0 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.1)) inset;
}

.switcher__switch[disabled] .switcher__knob {
  background-color: var(--color-white);
  border-color: light-dark(var(--color-gray-300), var(--color-gray-600));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.switcher__switch[disabled]:hover .switcher__knob,
.switcher__switch[disabled]:focus .switcher__knob,
.switcher__switch[disabled]:focus-within .switcher__knob {
  background-color: var(--color-white) !important;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;
}

.demo-mode-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-mode-switcher__label {
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: light-dark(var(--color-orange-700), var(--color-pink-300));
}

@media (max-width: 639px) {
  .demo-mode-switcher__label {
    font-size: 0.75rem;
    line-height: 1rem;
  }
}

.demo-mode-switcher__toggle {
  display: flex;
  align-items: center;
}

.demo-mode-switcher__input {
  display: none;
}

.demo-mode-switcher__switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
  width: 2.5rem;
  position: relative;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.demo-mode-switcher__background {
  pointer-events: none;
  position: absolute;
  height: 1rem;
  width: 2.25rem;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  border-radius: 9999px;
  transition: background-color 0.2s ease-in-out;
  background-color: light-dark(var(--color-gray-200), var(--color-gray-700));
}

.demo-mode-switcher__input:checked
  ~ .demo-mode-switcher__switch
  .demo-mode-switcher__background {
  background-color: var(--color-pink-500);
}

.demo-mode-switcher__knob {
  pointer-events: none;
  position: absolute;
  left: 0;
  display: inline-block;
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 9999px;
  background-color: white;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  border: 1px solid light-dark(var(--color-gray-200), var(--color-gray-600));
  transition: transform 0.2s ease-in-out;
  transform: translateX(0);
}

.demo-mode-switcher__input:checked
  ~ .demo-mode-switcher__switch
  .demo-mode-switcher__knob {
  transform: translateX(1.25rem);
}

.demo-mode-switcher__switch:focus .demo-mode-switcher__knob {
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-pink-400);
}
