/* Checkbox compartilhado: modelo 01, Sólido do tema. O input nativo e sua
 * associação com o rótulo são preservados, inclusive em seleções em massa. */
@layer lv-checkboxes {
  :root { --lv-checkbox-size: 20px; --lv-checkbox-radius: 5px; }
  :where(.lv-ui-checkbox--yellow,[data-lv-checkbox-color="yellow"]) { --lv-checkbox-color: var(--lv-yellow); --lv-checkbox-mark: #111111; }
  :where(.lv-ui-checkbox--blue,[data-lv-checkbox-color="blue"]) { --lv-checkbox-color: var(--lv-blue); --lv-checkbox-mark: #fff; }
  :where(.lv-ui-checkbox--green,[data-lv-checkbox-color="green"]) { --lv-checkbox-color: var(--lv-success); --lv-checkbox-mark: #fff; }
  :where(.lv-ui-checkbox--black,[data-lv-checkbox-color="black"]) { --lv-checkbox-color: #111111; --lv-checkbox-mark: #fff; }
  :root[data-lv-color-scheme="dark"] :where(.lv-ui-checkbox--blue,.lv-ui-checkbox--green,[data-lv-checkbox-color="blue"],[data-lv-checkbox-color="green"]) { --lv-checkbox-mark: #111111; }
  :root[data-lv-color-scheme="dark"] :where(.lv-ui-checkbox--black,[data-lv-checkbox-color="black"]) { --lv-checkbox-background: #f3f6fb; }
  .lv-ui-checkbox {
    display: inline-flex !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: var(--lv-control-height, 40px);
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: var(--lv-ink) !important;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
  }
  .lv-ui-checkbox > span { min-width: 0; overflow-wrap: anywhere; }
  .lv-ui-checkbox--icon-only { justify-content: center; min-width: var(--lv-control-height, 40px); }
  .lv-ui-checkbox:has(input:disabled) { color: var(--lv-muted) !important; cursor: not-allowed; }
  input[type="checkbox"]:not([role="switch"]) {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: inline-grid !important;
    position: relative;
    flex: 0 0 var(--lv-checkbox-size) !important;
    width: var(--lv-checkbox-size) !important;
    min-width: var(--lv-checkbox-size) !important;
    max-width: var(--lv-checkbox-size) !important;
    height: var(--lv-checkbox-size) !important;
    min-height: var(--lv-checkbox-size) !important;
    max-height: var(--lv-checkbox-size) !important;
    margin: 0;
    padding: 0 !important;
    vertical-align: middle;
    border: 1.5px solid var(--lv-line-strong) !important;
    border-radius: var(--lv-checkbox-radius) !important;
    background: var(--lv-checkbox-background, var(--lv-surface)) !important;
    color: var(--lv-checkbox-mark, #111111) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease !important;
  }
  input[type="checkbox"]:not([role="switch"])::before { content: none !important; display: none !important; }
  input[type="checkbox"]:not([role="switch"])::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 46% !important;
    right: auto !important;
    bottom: auto !important;
    box-sizing: content-box;
    width: 5px !important;
    height: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: solid currentColor !important;
    border-width: 0 2px 2px 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    mask: none !important;
    clip-path: none !important;
    opacity: 0 !important;
    transform: translate(-50%, -56%) rotate(45deg) scale(.65) !important;
    transition: opacity .15s ease, transform .15s ease !important;
    pointer-events: none;
  }
  input[type="checkbox"]:not([role="switch"]):is(:checked,:indeterminate) {
    border-color: var(--lv-checkbox-color, var(--lv-yellow)) !important;
    background: var(--lv-checkbox-color, var(--lv-yellow)) !important;
  }
  input[type="checkbox"]:not([role="switch"]):is(:checked,:indeterminate)::after { opacity: 1 !important; transform: translate(-50%, -56%) rotate(45deg) scale(1) !important; }
  input[type="checkbox"]:not([role="switch"]):indeterminate::after {
    top: 50% !important;
    width: 9px !important;
    height: 2px !important;
    border: 0 !important;
    background: currentColor !important;
    transform: translate(-50%, -50%) !important;
  }
  input[type="checkbox"]:not([role="switch"]):hover:not(:disabled),
  .lv-ui-checkbox:hover > input[type="checkbox"]:not([role="switch"]):not(:disabled) { border-color: var(--lv-checkbox-color, var(--lv-yellow)) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lv-checkbox-color, var(--lv-yellow)) 12%, transparent) !important; }
  input[type="checkbox"]:not([role="switch"]):focus-visible { outline: 2px solid var(--lv-checkbox-color, var(--lv-yellow)) !important; outline-offset: 3px !important; }
  /* O filtro preserva os inputs que já estão ocultos por um seletor de etiquetas. */
  input[type="checkbox"]:not([role="switch"]):disabled { filter: opacity(.4) !important; cursor: not-allowed !important; }
  input[type="checkbox"][hidden], .lv-ui-checkbox[hidden] { display: none !important; }
  @media (max-width: 900px), (pointer: coarse) {
    .lv-ui-checkbox { min-height: 44px; }
    .lv-ui-checkbox--icon-only { min-width: 44px; }
  }
  @media (prefers-reduced-motion: reduce) {
    input[type="checkbox"]:not([role="switch"]), input[type="checkbox"]:not([role="switch"])::after { transition: none !important; }
  }
  @media (forced-colors: active) {
    input[type="checkbox"]:not([role="switch"]) { appearance: auto !important; -webkit-appearance: auto !important; background: revert !important; border: revert !important; color: CanvasText !important; }
    input[type="checkbox"]:not([role="switch"])::after { content: none !important; }
  }
}
