@layer components {
  /* Form element enhancements — validation hints, color inputs, checkbox/radio labels, disabled states. */
  .form-hint {
    font-size: var(--text-sm);
  }

  ul.form-hint-list {
    margin: 0;
    padding-left: var(--app-spacing);
  }

  ul.form-hint-list li {
    margin: 0;
  }

  ul.form-hint-list li.is-valid {
    color: var(--app-form-element-valid-border-color);
  }

  ul.form-hint-list li.is-invalid {
    color: var(--app-form-element-invalid-border-color);
  }

  ul.form-hint-list li.is-valid:after {
    content: "\F26B";
    font-family: "Bootstrap-icons";
    margin-left: 4px;
    font-size: 10px; /* icon-font metric — intentional px */
  }

  ul.form-hint-list li.is-invalid:after {
    content: "\F33A";
    font-family: "Bootstrap-icons";
    margin-left: 4px;
    font-size: 10px; /* icon-font metric — intentional px */
  }

  label:has([type="checkbox"], [type="radio"]) {
    display: flex;
    line-height: var(--leading-none);
    align-items: center;
  }

  input[type="color"] {
    padding: 0;
    width: 42px;
    border: 0;
    margin: 0;
    height: 42px;
    flex-shrink: 0;
  }

  label:has(input[type="color"]) {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  small.muted {
    display: block;
    width: 100%;
    color: var(--app-muted-color);
  }
  a.muted {
    color: var(--app-muted-color);
  }

  label.app-field:has(input[type="checkbox"][disabled]),
  label.app-field:has(input[type="radio"][disabled]) {
    cursor: not-allowed;
    opacity: 0.8;
  }

  label.app-field:has(input[type="checkbox"][disabled]) > span,
  label.app-field:has(input[type="radio"][disabled]) > span {
    color: var(--app-muted-color);
  }

  input[type="checkbox"][disabled],
  input[type="radio"][disabled] {
    --app-border-color: var(--app-muted-border-color);
    --app-background-color: var(--app-form-element-background-color);
    cursor: not-allowed;
  }

  input[type="checkbox"][disabled]:checked,
  input[type="checkbox"][disabled]:indeterminate,
  input[type="radio"][disabled]:checked {
    --app-border-color: var(--app-muted-border-color);
    --app-background-color: var(--app-muted-border-color);
  }

  fieldset[aria-disabled="true"] {
    border-color: var(--app-muted-border-color);
  }

  fieldset[aria-disabled="true"] .muted,
  fieldset[aria-disabled="true"] legend small {
    color: var(--app-muted-color);
  }

}
