/* ============================================
 * Magic Darkroom · Checkbox / Toggle
 *
 * Custom checkbox with animal-island-ui feel:
 * rounded square, mochi-orange check.
 *
 * Markup:
 *   <label class="md-check">
 *     <input type="checkbox" />
 *     <span class="md-check__box"></span>
 *     <span class="md-check__label">Label text</span>
 *   </label>
 * ============================================ */

.md-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.md-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.md-check__box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--c-line-soft);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 0 0 var(--sh-input);
  position: relative;
  transition:
    background   var(--dur-normal) var(--ease-standard),
    border-color var(--dur-normal) var(--ease-standard),
    box-shadow   var(--dur-normal) var(--ease-standard),
    transform    var(--dur-fast) var(--ease-pop);
}

/* Checkmark */
.md-check__box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--dur-fast) var(--ease-pop);
}

/* Hover */
.md-check:hover .md-check__box {
  border-color: var(--c-mochi);
}

/* Checked */
.md-check input:checked + .md-check__box {
  background: var(--c-mochi);
  border-color: var(--c-mochi);
  box-shadow: 0 2px 0 0 var(--c-mochi-deep);
}

.md-check input:checked + .md-check__box::after {
  transform: rotate(45deg) scale(1);
}

/* Focus */
.md-check input:focus-visible + .md-check__box {
  outline: 3px solid var(--c-focus-yellow);
  outline-offset: 2px;
}

/* Active press */
.md-check:active .md-check__box {
  transform: scale(0.9);
}

/* Disabled */
.md-check input:disabled + .md-check__box {
  opacity: 0.4;
  cursor: not-allowed;
}
.md-check input:disabled ~ .md-check__label {
  opacity: 0.4;
  cursor: not-allowed;
}

.md-check__label {
  line-height: 1.4;
}
