/* A Relationship field's options as tiles (feat-096): the current platform's grid of icon buttons, drawn
   like the payment page's AmountButton. Each tile is the label of a native checkbox, hidden but still
   focused and read as a checkbox; the tick, not only the fill, says it is chosen (WCAG 1.4.1).

   Linked from both theme bases and from the dashboard's draft preview. The public design system's
   tokens come first; the dashboard has none of them, so each falls back to a Bootstrap variable. */
.relationship-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
}
.relationship-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 6rem;
  margin: 0;
  padding: 0.85rem 0.75rem;
  text-align: center;
  line-height: 1.2;
  font-family: var(--font-heading, inherit);
  font-weight: var(--weight-bold, 700);
  color: var(--text-strong, var(--bs-emphasis-color));
  background: var(--surface-card, var(--bs-body-bg));
  /* Bootstrap's own border colour is too faint to mark a control's edge (WCAG 1.4.11). */
  border: 1.5px solid var(--border-strong, var(--bs-secondary-color));
  border-radius: var(--radius-md, var(--bs-border-radius));
  cursor: pointer;
  transition:
    border-color var(--dur-fast, 0.15s) var(--ease-standard, ease),
    background var(--dur-fast, 0.15s) var(--ease-standard, ease);
}
/* Laid over the whole tile, so a press anywhere on it lands on the checkbox itself. */
.relationship-option input[type="checkbox"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.relationship-option__icon {
  font-size: 1.75rem;
  color: var(--brand-text, var(--color-primary, var(--bs-primary)));
}
.relationship-option__tick {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  font-size: 1.1rem;
  visibility: hidden;
}
.relationship-option:hover {
  border-color: var(--color-primary, var(--bs-primary));
}
.relationship-option:has(:focus-visible) {
  box-shadow: var(--shadow-ring, 0 0 0 0.125rem var(--bs-body-bg), 0 0 0 0.3rem var(--bs-primary));
}
.relationship-option:has(:checked) {
  background: var(--color-primary, var(--bs-primary));
  border-color: var(--color-primary, var(--bs-primary));
  color: var(--on-primary, var(--bs-white));
  box-shadow: inset 0 0 0 1px var(--fill-edge-primary, transparent);
}
.relationship-option:has(:checked):has(:focus-visible) {
  box-shadow:
    inset 0 0 0 1px var(--fill-edge-primary, transparent),
    var(--shadow-ring, 0 0 0 0.125rem var(--bs-body-bg), 0 0 0 0.3rem var(--bs-primary));
}
.relationship-option:has(:checked) .relationship-option__icon {
  color: var(--on-primary, var(--bs-white));
}
.relationship-option:has(:checked) .relationship-option__tick {
  visibility: visible;
}
.relationship-option:has([aria-invalid="true"]) {
  border-color: var(--danger, var(--bs-form-invalid-border-color));
}
