/* Avatar image */
.checkbox-image {
  width: 2rem; /* ~32px */
  height: 2rem;
  border-radius: 50%;
  border: 0.05rem solid #d9d9d9;
  object-fit: cover;
}

/* Hidden checkbox (keep accessibility) */
.checkbox-input {
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Selected state */
.checkbox-input:checked + .checkbox-tile {
  border-color: #8C52FF;
  background: rgba(140, 82, 255, 0.05);
  box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, 0.06);
  color: #8C52FF;
}

.checkbox-input:checked + .checkbox-tile:before {
  transform: scale(1);
  opacity: 1;
  background-color: #8C52FF;
  border-color: #8C52FF;
}

.checkbox-input:focus + .checkbox-tile {
  border-color: #8C52FF;
  box-shadow: 0 0 0 0.2rem rgba(140, 82, 255, 0.2);
}

/* Tile container */
.checkbox-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 4.6rem; /* smaller tile */
  min-height: 4.6rem;
  border-radius: 0.4rem;
  border: 0.1rem solid #e3e6ed;
  background-color: #fff;
  transition: 0.15s ease;
  cursor: pointer;
  position: relative;
  text-align: center;
}
/* --- Base bubble: always visible as a neutral ring --- */
.checkbox-tile:before {
  content: "";
  position: absolute;
  width: 0.8rem;
  height: 0.8rem;
  border: 0.1rem solid #e6e4e4bb;   /* neutral ring */
  background-color: #e6e4e4bb;
  border-radius: 50%;
  top: 0.25rem;
  left: 0.25rem;
  /* make it visible even when unchecked */
  opacity: 1;
  transform: scale(1);
  transition: 0.25s ease;
  /* unchecked: no checkmark image */
  background-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23FFFFFF' viewBox='0 0 256 256'%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'/%3E%3C/svg%3E");

}

/* Optional: subtle hover/focus hint so it feels “checkable” */
.checkbox-tile:hover:before,
.checkbox-input:focus + .checkbox-tile:before {
  border-color: #a88cff;                 /* soft purple hint */
  box-shadow: 0 0 0 0.15rem rgba(140,82,255,.12);
}

/* --- Checked bubble: purple fill + white checkmark --- */
.checkbox-input:checked + .checkbox-tile:before {
  background-color: #8C52FF;
  border-color: #8C52FF;
  /* turn on the checkmark only when checked */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='%23FFFFFF' viewBox='0 0 256 256'%3E%3Cpolyline points='216 72.005 104 184 48 128.005' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'/%3E%3C/svg%3E");
}

/* Hover state */
.checkbox-tile:hover {
  border-color: #8C52FF;
  background-color: rgba(140, 82, 255, 0.03);
}

/* Add Account Tile */
.plus-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  min-height: 4.6rem;
  border-radius: 0.4rem;
  border: 0.1rem dashed rgba(140, 82, 255, 0.3);
  background-color: #fff;
  transition: 0.2s ease;
  cursor: pointer;
  color: #8C52FF;
  font-weight: 500;
}

.plus-tile:hover {
  border-color: #8C52FF;
  background-color: rgba(140, 82, 255, 0.05);
}

.plus-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Icons & Labels */
.checkbox-icon {
  transition: 0.3s ease;
  color: #555;
}

.checkbox-label {
  color: #555;
  transition: 0.3s ease;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .checkbox-tile,
  .plus-tile {
    width: 4rem;
    min-height: 4rem;
  }
  .checkbox-label {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .checkbox-tile,
  .plus-tile {
    width: 3.8rem;
    min-height: 3.8rem;
  }
  .checkbox-image {
    width: 1.8rem;
    height: 1.8rem;
  }
}
