/* Shared free-search funnel UI for city pages (v2.3 A.2) — same IDs/behavior as homepage. */

.membership-bar {
  width: 100%;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef8f2;
  border: 1px solid #cce8d7;
  min-height: 52px;
  box-sizing: border-box;
}
.membership-bar__toggle {
  display: none;
}
.membership-bar__body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.membership-bar__title {
  font-size: 13px;
  color: #064e3b;
  font-weight: 700;
  flex-shrink: 0;
}
.membership-bar__email {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #9bd0b3;
  min-width: 220px;
  font-size: 14px;
  box-sizing: border-box;
}
.membership-bar__btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}
.membership-bar__btn--subscribe {
  background: #047857;
  color: #fff;
}
.membership-bar__btn--manage {
  background: #1d4ed8;
  color: #fff;
  font-weight: 600;
}
a.membership-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  font-size: 13.333px;
  text-decoration: none;
  color: #fff;
}
.membership-bar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.membership-bar__identity {
  font-size: 13px;
  color: #065f46;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#membershipStatusText {
  display: none !important;
}

.content-search-embed {
  margin: 28px 0 8px;
  padding: 20px 18px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.content-search-embed__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #1d3a62;
  text-align: center;
}
.content-search-embed__lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  line-height: 1.45;
}
.content-search-embed .search-form-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  padding: 0;
  box-sizing: border-box;
}
.content-search-embed .search-form-card__heading {
  text-align: center;
  color: #0b1220;
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 13px;
}
.content-search-embed label {
  font-size: 11px;
  color: #0b1220;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
  text-align: center;
}
.content-search-embed input[type="text"],
.content-search-embed input[type="date"],
.content-search-embed input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
}
.content-search-embed .field-hint {
  font-size: 10px;
  color: #6b7280;
  margin-top: 4px;
  text-align: center;
}
.content-search-embed #address-subfields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.content-search-embed .search-dates-row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.content-search-embed .search-date-group {
  flex: 1;
}
.content-search-embed .search-date-field {
  position: relative;
}
.content-search-embed .search-date-hint {
  display: none;
}
.content-search-embed #searchForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}
.btn-primary--navy {
  background: #20334e;
  color: #fff;
  font-weight: 700;
}
.btn-primary--blue {
  background: #2563eb;
  color: #fff;
}
.btn-primary--green {
  background: #047857;
  color: #fff;
}
#searchButton.btn-primary {
  width: 100%;
  height: 40px;
  gap: 8px;
  font-size: 14px;
}

.results-modal {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  max-width: 600px;
  min-width: 320px;
  max-height: 70vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}
.results-modal-header {
  position: relative;
  flex-shrink: 0;
  padding: 12px 48px 10px 16px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  z-index: 1;
}
.results-modal-title {
  margin: 0;
  color: #20334e;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.results-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.results-modal-close:hover {
  background: #dc2626;
}
.results-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.results-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.record-card {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.record-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.record-card-main {
  flex: 1;
  min-width: 0;
}
.record-card-permit {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}
.record-card-address {
  color: #374151;
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.record-card-desc {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}
.record-card-desc--mobile {
  display: none;
}
.record-card-desc-toggle {
  display: none;
}
.record-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.record-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.record-card-actions .btn-primary--blue {
  padding: 8px 16px;
  font-size: 14px;
}
.record-card-actions .btn-primary--green {
  padding: 7px 12px;
  font-size: 12px;
}

.status-toast {
  display: flex;
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2000;
  width: min(520px, calc(100% - 24px));
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1.4;
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  transform: translate(-50%, calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  box-sizing: border-box;
}
.status-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.status-toast.is-error {
  background: #fff0f0;
  color: #900;
  border-color: #fecaca;
}
.status-toast.is-info {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}
.status-toast.is-success {
  background: #f0fff4;
  color: #044;
  border-color: #bbf7d0;
}
.status-toast-message {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.status-toast-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .membership-bar__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #064e3b;
    cursor: pointer;
  }
  .membership-bar.is-collapsed .membership-bar__body {
    display: none;
  }
  .membership-bar:not(.is-collapsed) .membership-bar__body {
    display: flex;
    margin-top: 10px;
  }
  .membership-bar__email {
    min-width: 0;
    width: 100%;
  }

  .content-search-embed .search-dates-row {
    flex-direction: column;
    gap: 14px;
  }
  .content-search-embed .search-date-hint {
    display: block;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
  }
  .content-search-embed .search-date-field input[type="date"]:not(.has-value):not(:focus)::-webkit-datetime-edit,
  .content-search-embed .search-date-field input[type="date"]:not(.has-value):not(:focus)::-webkit-datetime-edit-fields-wrapper {
    opacity: 0;
  }
  .content-search-embed .search-date-field input[type="date"].has-value + .search-date-hint,
  .content-search-embed .search-date-field input[type="date"]:focus + .search-date-hint {
    display: none;
  }

  .record-card-body {
    flex-direction: column;
  }
  .record-card-desc--desktop {
    display: none;
  }
  .record-card-desc--mobile {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .record-card-desc--mobile.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  .record-card-desc-toggle {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
  }
  .record-card-actions {
    width: 100%;
    align-items: stretch;
  }
  .record-card-actions .btn-primary,
  #searchButton.btn-primary {
    width: 100%;
    min-height: 44px;
    height: auto;
  }

  .results-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .results-modal-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px max(12px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .results-modal-title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    text-align: left;
  }
  .results-modal-close {
    position: static;
  }
}
