:root {
  --bg: #fff;
  --card-bg: #ffffff;
  --accent: #298fc2;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --border: #e5e7eb;
  --text: #000;
  --muted: #6b7280;
  --pill-bg: #f3f4f6;
  --pill-border: #d1d5db;
  --radius-lg: 999px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

h1 {
  font-size: 1.8rem;
  margin: 0 0 6px;
  font-weight: 600;
  color: #01426a;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.search-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* STATE DROPDOWN CARET */
.search-card .select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 3rem;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%2301426A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px 8px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field-group {
  flex: 1 1 160px;
  min-width: 0;
}

.input,
.select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: #01426a;
  color: #ffffff;
  border: none;
  text-decoration: none;
}

.btn-primary:hover {
  background: #000;
}

.btn-ghost {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-ghost.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.filters-toggle-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}

.filter-pill span {
  max-width: 150px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.filter-pill-remove {
  font-size: 0.8rem;
  opacity: 0.7;
}

.filter-panel {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 8px 10px;
  display: none;
}

.filter-panel.open {
  display: block;
}

.specialty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 4px 10px;
}

.specialty-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.specialty-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #01426a;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Checked state */
.specialty-item input[type="checkbox"]:checked {
  background: #01426a;
  border-color: #01426a;
}

/* Checkmark */
.specialty-item input[type="checkbox"]:checked::after {
  content: "✓";
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.specialty-item input[type="checkbox"]:hover {
  background: #01426a;
}

/* Focus (accessibility) */
.specialty-item input[type="checkbox"]:focus-visible {
  outline: none;
}

.filter-panel-footer {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.8rem;
}

.filter-link {
  background: none;
  border: 1px solid #01426a;
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  padding: 6px 15px;
  margin: 10px 0;
}

.filter-link:hover {
  color: #fff;
  background: #000;
}

.results-wrap {
  margin-top: 24px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--muted);
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  position: relative;
}

.elite-icon-wrapper {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.elite-icon-img {
  width: 24px;
  height: 24px;
  display: block;
}

.elite-tooltip {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #01426a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  z-index: 999;

  min-width: 230px;
  max-width: 420px;
  width: max-content;

  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.elite-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #01426a transparent transparent transparent;
}

.elite-icon-wrapper:hover .elite-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.elite-tooltip-title {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.elite-tooltip-desc {
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.25;
}

.agent-agency {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #1f2937;
}

.agent-location {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.agent-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-soft);
}

.agent-contact {
  font-size: 0.8rem;
  color: var(--muted);
}

.agent-contact a {
  color: var(--accent);
  text-decoration: none;
}

.agent-contact a:hover {
  text-decoration: underline;
}

.no-results {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-toggle-wrap {
    width: 100%;
    justify-content: space-between;
  }
  .btn,
  .input,
  .select {
    width: 100%;
  }
  .field-group {
    flex: 1 1 25px;
    min-width: 0;
  }
}
