/*
 * Self-contained checkbox styling — a faithful reproduction of daisyui's
 * `checkbox` component WITHOUT depending on daisyui.
 *
 * Size, color, and border-radius are handled entirely by Tailwind utility
 * classes generated in mn-checkboxVariants.ts. This file is responsible only
 * for structural rules and the ::before pseudo-element checkmark animation,
 * which cannot be expressed as utility classes on a native <input>.
 */

.mn-checkbox {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-width: 1px;
  border-style: solid;
  box-shadow: 0 1px oklch(0% 0 0 / 0.1) inset,
  0 0 #0000 inset,
  0 0 #0000;
  transition: background-color 0.2s,
  box-shadow 0.2s;
}

.mn-checkbox::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  rotate: 45deg;
  background-color: currentColor;
  opacity: 0;
  box-shadow: 0 3px 0 0 oklch(100% 0 0 / 0.1) inset;
  clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 80%, 70% 80%, 70% 100%);
  transition: clip-path 0.3s,
  opacity 0.1s,
  rotate 0.3s,
  translate 0.3s;
  transition-delay: 0.1s;
}

.mn-checkbox:focus-visible {
  outline-width: 2px;
  outline-style: solid;
  outline-offset: 2px;
}

.mn-checkbox:checked,
.mn-checkbox[aria-checked='true'] {
  box-shadow: 0 0 #0000 inset,
  0 8px 0 -4px oklch(100% 0 0 / 0.1) inset,
  0 1px oklch(0% 0 0 / 0.1);
}

.mn-checkbox:checked::before,
.mn-checkbox[aria-checked='true']::before {
  opacity: 1;
  clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 0%, 70% 0%, 70% 100%);
}

.mn-checkbox:indeterminate::before {
  opacity: 1;
  rotate: 0deg;
  translate: 0 -35%;
  clip-path: polygon(20% 100%, 20% 80%, 50% 80%, 50% 80%, 80% 80%, 80% 100%);
}

.mn-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.2;
}
