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

.toggle-with-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-with-title span {
  font-size: 20px;
  color: var(--dark-blue);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 40px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.toggle-switch:focus {
  outline: none;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-switch--outlined .toggle-switch-background {
  display: flex;
  align-items: center;
}

.toggle-switch-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  border-radius: 20px;
  transition: background-color 0.3s ease-in-out;
}

.toggle-switch--outlined .toggle-switch-handle {
  top: auto;
}

.toggle-switch-handle {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 30px;
  height: 30px;
  background-color: var(--dark-blue);
  border-radius: 50%;
  box-shadow: 0 2px 9px var(--dark-blue);
  transition: transform 0.3s ease-in-out;
}

.toggle-switch::before {
  content: "";
  position: absolute;
  top: -25px;
  right: -35px;
  font-size: 12px;
  font-weight: bold;
  color: #aaa;
  text-shadow: 1px 1px #fff;
  transition: color 0.3s ease-in-out;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-switch-handle {
  transform: translateX(45px);
}

.toggle-switch input[type="checkbox"]:checked+.toggle-switch-background {
  background-color: var(--blue);
}

.toggle-switch input[type="checkbox"]:checked+.toggle-switch:before {
  content: "On";
  color: var(--dark-blue);
  right: -15px;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-switch-background .toggle-switch-handle {
  transform: translateX(40px);
  background-color: var(--white);
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-switch input[type="checkbox"]:focus {
  outline: none;
}

.toggle-switch--outlined {
  border: 2px solid var(--blue);
  border-radius: 22px;
  padding: 2px;
  display: inline-block;
  box-sizing: border-box;
  transition: border-color 0.3s ease-in-out;
}