/* default */
:host {
  display: flex;
  justify-content: center;
  align-items: center;
}

:host .checkbox {
  position: relative;
  width: 14px;
  height: 14px;
  padding: 1px;
}

:host .input {
  border-radius: 0.25rem;
  width: 100%;
  height: 100%;
  outline: 1px solid var(--color-checkbox-border);
  background-color: var(--color-checkbox-bg);
}

:host .text {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

:host .hidden {
  display: none !important;
}

:host input[type=checkbox] {
  position: absolute;
}

:host input:checked ~ .input {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  border-color: transparent;
  background-color: var(--color-checkbox-checked-bg);
  outline: 1px solid var(--color-checkbox-checked-border);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

:host slot {
  color: var(--color-checkbox-title);
  display: flex;
  align-items: center;
  font-weight: 500;
}

/* size */
:host(.small) .title {
  font-size: 0.75rem;
}
:host(.small) .description {
  font-size: 10px;
}
:host(.small) .checkbox {
  width: 12px;
  height: 12px;
}
:host(.small) .input {
  border-radius: 0.1875rem;
}

:host(.large) .title {
  font-size: 16px;
}
:host(.large) .description {
  font-size: 14px;
}
:host(.large) .checkbox {
  width: 1rem;
  height: 1rem;
}
:host(.large) .input {
  border-radius: 0.2813rem;
}

:host(.disabled) {
  pointer-events: none;
}
:host(.disabled) input:checked ~ .input {
  background-color: var(--color-checkbox-disabled);
  outline: 1px solid var(--color-checkbox-disabled-border);
}
:host(.disabled) .checkbox {
  background-color: var(--color-checkbox-disabled);
}