/** VolteVas shared checkbox component. */

.vv-checkbox {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin: 0;
  color: var(--vv-color-body);
  font-size: 13px;
  line-height: 20px;
}

.vv-checkbox input {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.vv-checkbox > span {
  position: relative;
  min-height: 18px;
  padding-left: 27px;
}

.vv-checkbox > span::before,
.vv-checkbox > span::after {
  content: '';
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
}

.vv-checkbox > span::before {
  top: 1px;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid #bdced8;
  border-radius: 4px;
  background: #fff;
  transition: border-color .16s var(--vv-ease), background-color .16s var(--vv-ease),
    box-shadow .16s var(--vv-ease);
}

.vv-checkbox > span::after {
  top: 5px;
  left: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  -webkit-mask: url('../../icons/lucide/check.svg') center / contain no-repeat;
  mask: url('../../icons/lucide/check.svg') center / contain no-repeat;
  opacity: 0;
}

.vv-checkbox input:checked + span::before {
  border-color: var(--vv-color-slate);
  background: var(--vv-color-slate);
}

.vv-checkbox input:checked + span::after { opacity: 1; }
.vv-checkbox input:focus-visible { outline: none; }
.vv-checkbox input:focus-visible + span::before { box-shadow: 0 0 0 3px rgba(53, 80, 106, .18); }

.vv-checkbox input:disabled { cursor: not-allowed; }
.vv-checkbox input:disabled + span {
  color: var(--vv-color-muted);
  cursor: not-allowed;
}
.vv-checkbox input:disabled + span::before { background: #f1f5f7; }

.vv-checkbox.is-invalid { color: var(--vv-error-fg); }
.vv-checkbox.is-invalid > span::before {
  border-color: var(--vv-error-line);
  box-shadow: 0 0 0 2px rgba(217, 103, 103, .15);
}

.vv-checkbox a {
  color: var(--vv-color-slate);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vv-checkbox a:hover { color: var(--vv-color-teal); text-decoration: none; }
.vv-checkbox em { font-style: normal; color: #95a5b0; }

@media (prefers-reduced-motion: reduce) {
  .vv-checkbox > span::before { transition: none; }
}
