/*
 * Switch / Toggle
 * With label, disabled state
 */

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast);
}

input:checked + .switch-track {
  background: var(--color-primary);
}

input:checked + .switch-track::after {
  transform: translateX(1.25rem);
}

input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input:disabled + .switch-track {
  opacity: 0.5;
  cursor: not-allowed;
}
