/* Switch
   A toggle built from a native checkbox and a sliding track. Pair with a label
   inside .dp-switch. All colour and motion come from tokens.css. */

.dp-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--dp-space-3);
  font-size: var(--dp-text-base);
  color: var(--dp-navy);
  cursor: pointer;
}

.dp-switch-input {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 1.375rem;
  margin: 0;
  background: var(--dp-neutral-500);
  border-radius: var(--dp-radius-full);
  cursor: pointer;
  transition: background-color var(--dp-transition);
}

.dp-switch-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--dp-white);
  border-radius: var(--dp-radius-full);
  box-shadow: var(--dp-shadow-sm);
  transition: transform var(--dp-transition);
}

.dp-switch-input:checked {
  background: var(--dp-primary-bg);
}

.dp-switch-input:checked::after {
  transform: translateX(1.125rem);
}

.dp-switch-input:focus-visible {
  outline: none;
  box-shadow: var(--dp-shadow-focus);
}

.dp-switch-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dp-switch:has(.dp-switch-input:disabled) {
  color: var(--dp-text-subtle);
  cursor: not-allowed;
}
