/* Boolean switch — GitHub issue #100. Partial: app/views/shared/components/_switch.html.erb */
@layer components {

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

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

.switch__input {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 2.75rem;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
  z-index: 1;
}

.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--color-slate-25);
  transition: background var(--duration-fast) var(--ease-default);
}

.switch__thumb {
  position: absolute;
  top: 0.1875rem;
  inset-inline-start: 0.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--radius-18);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  transition: transform var(--duration-fast) var(--ease-default);
}

.switch__input:checked + .switch__track {
  background: var(--color-primary);
}

.switch__input:checked + .switch__track .switch__thumb {
  transform: translateX(1.25rem);
}

.switch__input:focus-visible + .switch__track {
  box-shadow: var(--shadow-focus-input);
}

.switch__input:disabled + .switch__track {
  opacity: 0.7;
}

.switch__label {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

}
