/* Interrupteur — design FF.pen, id Pencil TiCtM uYtQP TP5up */
.ff-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--ff-space-3);
  box-sizing: border-box;
  min-height: 44px;
  padding: var(--ff-space-2) var(--ff-space-3);
  border-radius: var(--ff-radius-control);
  color: var(--ff-text);
  font-family: var(--ff-font-body);
  font-size: var(--ff-font-size-m);
  font-weight: 400;
  line-height: normal;
  cursor: pointer;
}

.ff-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.ff-toggle__track {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 52px;
  height: 32px;
  padding: var(--ff-space-1);
  border-radius: var(--ff-radius-pill);
  background-color: var(--ff-border);
  transition: background-color 0.14s ease;
}

.ff-toggle__track::before {
  content: "";
  display: block;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 1px solid var(--ff-border-strong);
  border-radius: var(--ff-radius-pill);
  background-color: var(--ff-surface);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ff-toggle__label {
  color: var(--ff-text);
}

.ff-toggle input[type="checkbox"]:checked + .ff-toggle__track {
  background-color: var(--ff-crystal-strong);
}

.ff-toggle input[type="checkbox"]:checked + .ff-toggle__track::before {
  transform: translateX(20px);
  border-color: transparent;
}

.ff-toggle:hover:not(:has(input:disabled)),
.ff-toggle.is-hover:not(.is-disabled) {
  background-color: var(--ff-surface-alt);
}

.ff-toggle:active:not(:has(input:disabled)),
.ff-toggle.is-active:not(.is-disabled) {
  background-color: var(--ff-border);
}

.ff-toggle input[type="checkbox"]:focus-visible + .ff-toggle__track,
.ff-toggle.is-focus .ff-toggle__track {
  outline: 2px solid var(--ff-focus);
  outline-offset: 2px;
}

.ff-toggle input[type="checkbox"]:disabled + .ff-toggle__track,
.ff-toggle.is-disabled .ff-toggle__track {
  background-color: var(--ff-surface-alt);
}

.ff-toggle:has(input:disabled) .ff-toggle__label,
.ff-toggle.is-disabled .ff-toggle__label {
  color: var(--ff-text-disabled);
}

.ff-toggle:has(input:disabled),
.ff-toggle.is-disabled {
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .ff-toggle__track,
  .ff-toggle__track::before {
    transition: none;
  }
}
