/* ===================================================================
   LANTERN COMMUNITIES — searchable combobox (gender picker)
   Shared by index.php (signup) and admin_members.php (filter)
   =================================================================== */

.combobox {
  position: relative;
}

.combobox input {
  width: 100%;
  padding: 11px 38px 11px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg-ffffff);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.combobox input:hover { border-color: var(--ln-d4c4c1); }

.combobox input:focus {
  border-color: var(--plum);
  box-shadow: 0 0 0 3px var(--rg-573258-22);
  outline: none;
}

.combobox input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--rg-c9684f-15); }

/* search affordance inside the input */
.combobox::after {
  content: '⌕';
  position: absolute;
  right: 13px;
  top: 11px;
  font-size: 16px;
  color: var(--ink-soft);
  pointer-events: none;
  line-height: 1;
}

.combobox-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  max-height: 260px;
  overflow-y: auto;
  z-index: 60;
  padding: 6px;
  list-style: none;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--plum-soft) transparent;
  animation: comboIn 120ms ease-out;
}

/* Not enough room below the field: the script adds .up and the list opens above it. */
.combobox-list.up { top: auto; bottom: calc(100% + 6px); animation-name: comboInUp; }

@keyframes comboIn   { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes comboInUp { from { opacity: 0; transform: translateY(4px); }  to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .combobox-list { animation: none; } }

/* Slim plum scrollbar, no arrow buttons (Chrome / Edge / Safari). */
.combobox-list::-webkit-scrollbar { width: 8px; }
.combobox-list::-webkit-scrollbar-track { background: transparent; }
.combobox-list::-webkit-scrollbar-thumb { background: var(--plum-soft-solid); border-radius: 8px; border: 2px solid var(--card); }
.combobox-list::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

.combobox-item {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.combobox-item:hover,
.combobox-item.active {
  background: var(--lavender-soft);
  color: var(--plum);
}

.combobox-item .tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: var(--mint-soft);
  padding: 2px 8px;
  border-radius: 20px;
}

.combobox-item.selected::after { content: '✓'; font-weight: 700; color: var(--plum); }

/* Inline message under the field (used instead of browser validation pop-ups). */
.combobox-error {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-fdf2f4);
  color: var(--fg-a33b50);
  font-size: 12.5px;
  font-weight: 600;
}
.combobox-error[hidden] { display: none; }

.combobox-empty {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}