/* Case à cocher — design FF.pen, id Pencil QjpqE l6p2u ptpGR */
.ff-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--ff-space-2);
  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-checkbox input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.ff-checkbox__box {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ff-border-strong);
  border-radius: var(--ff-radius-xs);
  background-color: var(--ff-surface);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.ff-checkbox__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--ff-on-crystal-fill);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

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

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

.ff-checkbox input[type="checkbox"]:checked + .ff-checkbox__box::after {
  opacity: 1;
}

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

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

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

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

.ff-checkbox input[type="checkbox"]:checked:disabled + .ff-checkbox__box,
.ff-checkbox.is-disabled input[type="checkbox"]:checked + .ff-checkbox__box {
  border-color: var(--ff-text-disabled);
  background-color: var(--ff-text-disabled);
}

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

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

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