/* Advoke CV — Switch Component */

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

.switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.switch__track {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  padding: 2px;
  background-color: var(--ink-300);
  border-radius: var(--radius-full);
  transition: background-color var(--duration-base) var(--ease-out);
  position: relative;
}

.switch__thumb {
  width: 20px;
  height: 20px;
  background-color: var(--white);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform var(--duration-base) var(--ease-spring);
  will-change: transform;
}

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

.switch input[type="checkbox"]:checked + .switch__track .switch__thumb {
  transform: translateX(20px);
}

.switch input[type="checkbox"]:focus-visible + .switch__track {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.switch:hover .switch__track {
  background-color: var(--ink-400);
}

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

.switch input[type="checkbox"]:disabled + .switch__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch input[type="checkbox"]:disabled ~ .switch__label {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch__label {
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  cursor: pointer;
}

.switch__label-text {
  display: block;
}

.switch__label-hint {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.switch--sm .switch__track {
  width: 36px;
  height: 20px;
}

.switch--sm .switch__thumb {
  width: 16px;
  height: 16px;
}

.switch--sm input[type="checkbox"]:checked + .switch__track .switch__thumb {
  transform: translateX(16px);
}

.switch--sm .switch__label {
  font-size: var(--text-sm);
}

.switch--lg .switch__track {
  width: 52px;
  height: 28px;
}

.switch--lg .switch__thumb {
  width: 24px;
  height: 24px;
}

.switch--lg input[type="checkbox"]:checked + .switch__track .switch__thumb {
  transform: translateX(24px);
}

.switch--lg .switch__label {
  font-size: var(--text-lg);
}

.switch--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--white);
  width: 100%;
}

.switch--row .switch__label {
  flex: 1 1 auto;
  min-width: 0;
}

.switch--row .switch__track {
  order: 2;
  flex-shrink: 0;
}

.switch-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}