/* Compare Checkbox — custom checkbox used to mark schools for comparison.
 * Mirrors the Figma "Compare Checkbox" component set (3 states).
 * See CompareCheckboxComponent.
 */

.compare-checkbox {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
}

.compare-checkbox__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compare-checkbox__box {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 2px dashed var(--text-muted);
  position: relative;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}

/* Focus ring on the visible box when the hidden input is focused */
.compare-checkbox__input:focus-visible + .compare-checkbox__box {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.compare-checkbox__caption {
  font-family: var(--font-family-display);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Checked — solid brand red box with a white check */
.compare-checkbox--checked .compare-checkbox__box {
  background: var(--brand-primary);
  border: 2px solid var(--brand-primary);
}

.compare-checkbox--checked .compare-checkbox__box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 10px;
  border-left: 3px solid white;
  border-bottom: 3px solid white;
  transform: translate(-50%, -65%) rotate(-45deg);
  transform-origin: center;
}

/* Disabled — solid gray, no interaction */
.compare-checkbox--disabled {
  cursor: not-allowed;
}

.compare-checkbox--disabled .compare-checkbox__box {
  background: var(--text-muted);
  border: 2px solid var(--text-muted);
}

.compare-checkbox--disabled .compare-checkbox__caption {
  opacity: 0.6;
}
