/*
 * Shared patient-form checkbox controls.
 *
 * Keep this opt-in via .codesa-form-controls so dashboard switches, radios, and
 * hidden product-option controls retain their purpose-built rendering.
 */
.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  position: relative;
  border: 2px solid #94a3b8;
  border-radius: 0.3rem;
  background-color: #fff;
  background-image: none;
  color: #fff;
  cursor: pointer;
  transform: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]::after {
  content: "";
  display: block;
  box-sizing: border-box;
  position: absolute;
  top: 46%;
  left: 50%;
  width: 0.36rem;
  height: 0.66rem;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  font-family: inherit;
  font-size: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg);
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:checked {
  border-color: var(--codesa-checkbox-accent, #0d6efd);
  background-color: var(--codesa-checkbox-accent, #0d6efd);
  background-image: none;
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:checked::after {
  content: "";
  opacity: 1;
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--codesa-checkbox-accent, #0d6efd);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.14);
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:focus,
.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:focus-visible {
  border-color: var(--codesa-checkbox-accent, #0d6efd);
  outline: 3px solid rgba(13, 110, 253, 0.28);
  outline-offset: 2px;
  box-shadow: none;
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:disabled {
  border-color: #cbd5e1;
  background-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.65;
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:checked:disabled {
  border-color: var(--codesa-checkbox-accent, #0d6efd);
  background-color: var(--codesa-checkbox-accent, #0d6efd);
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:indeterminate {
  border-color: var(--codesa-checkbox-accent, #0d6efd);
  background-color: var(--codesa-checkbox-accent, #0d6efd);
}

.codesa-form-controls .form-check:not(.form-switch):not(.option-choice) .form-check-input[type="checkbox"]:indeterminate::after {
  top: 50%;
  width: 0.72rem;
  height: 0;
  border: 0;
  border-top: 2px solid currentColor;
  opacity: 1;
  transform: translate(-50%, -50%);
}
