/* Canonical checkbox skin. Master receives an identical copy for its own document root.
   Assessment option cards and dedicated switches keep their existing presentation. */
:root {
  --psi-checkbox-accent: var(--color-primary, var(--primary, var(--purple, #6845f5)));
  --psi-checkbox-surface: var(--color-surface, #fff);
  --psi-checkbox-border: #a9a2b7;
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]) {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  box-sizing: border-box;
  width: 20px !important;
  height: 20px;
  min-width: 20px;
  max-width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  padding: 0;
  margin: .15em 0 0 !important;
  vertical-align: -.2em;
  border: 1.5px solid var(--psi-checkbox-border);
  border-radius: 6px;
  background: var(--psi-checkbox-surface) center / 14px 14px no-repeat;
  box-shadow: 0 1px 2px #24133c0a;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):checked {
  border-color: var(--psi-checkbox-accent);
  background-color: var(--psi-checkbox-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3.2 3.2L13 4.5' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):indeterminate {
  border-color: var(--psi-checkbox-accent);
  background-color: var(--psi-checkbox-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='white' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):hover:not(:disabled) {
  border-color: var(--psi-checkbox-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--psi-checkbox-accent) 12%, transparent);
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):focus-visible {
  outline: 2px solid var(--psi-checkbox-accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--psi-checkbox-accent) 14%, transparent);
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):disabled {
  cursor: not-allowed;
  border-color: #ccc6d6;
  background-color: #f0edf5;
  box-shadow: none;
  opacity: .7;
}

:root input[type="checkbox"]:not(.option-card input):not([role="switch"]):disabled:is(:checked, :indeterminate) {
  border-color: #a39aaf;
  background-color: #a39aaf;
}

/* Align simple choice labels; text fields, links and assessment cards retain their layout. */
:root label:has(> input[type="checkbox"]):not(.option-card):not(:has(> a, > select, > textarea, > input:not([type="checkbox"]))) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 30px;
  line-height: 1.55;
  cursor: pointer;
}

:root label:has(> input[type="checkbox"]:disabled):not(.option-card) { cursor: not-allowed; }

.directory-current-options label:has(> input[type="checkbox"]:checked) {
  border-color: var(--psi-checkbox-accent);
  background: color-mix(in srgb, var(--psi-checkbox-accent) 7%, var(--psi-checkbox-surface));
}

@media (pointer: coarse), (max-width: 650px) {
  :root label:has(> input[type="checkbox"]):not(.option-card):not(:has(> a, > select, > textarea, > input:not([type="checkbox"]))) { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  :root input[type="checkbox"]:not(.option-card input):not([role="switch"]) { transition: none; }
}

@media (forced-colors: active) {
  :root input[type="checkbox"]:not(.option-card input):not([role="switch"]) {
    -webkit-appearance: auto;
    appearance: auto;
    forced-color-adjust: auto;
    background: Canvas;
    background-image: none !important;
    border-color: ButtonText;
    box-shadow: none;
  }
  :root input[type="checkbox"]:not(.option-card input):not([role="switch"]):focus-visible {
    outline-color: Highlight;
  }
}
