/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b5bdb;
  --primary-dark: #2f4bb8;
  --primary-light: #4c6ef5;
  --secondary: #f8f9fa;
  --accent: #2BC443;
  --text: #212529;
  --text-light: #6c757d;
  --border: #dee2e6;
  --background: #fafafa;
  --card-bg: #ffffff;
  --muted-bg: #f8f9fa;
  --success: #2bc544;
  --warning: #ffd43b;
  --danger: #ff6b6b;
  --radius: 8px;
  --service-icon-size: 4rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  background-color: var(--card-bg);
  padding: 1rem 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  color: var(--primary);
  display: block;
  height: 32px;   /* or whatever fits your header */
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

/* Make header sticky so the menu anchors below it */
.header { position: sticky; top: 0; z-index: 1000; }

/* Mobile toggle hidden by default */
.nav-toggle { display: none; border: 1px solid var(--border); background: var(--secondary);
  border-radius: 8px; padding: .5rem .75rem; font-size: 1.125rem; cursor: pointer; }
.nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Mobile menu base */
.mobile-nav {
  display: none;
  position: absolute;
  left: 0; right: 0;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(0,0,0,.06);
}
.mobile-nav.is-open { display: block; }
.mobile-nav-link {
  display: block;
  padding: 1rem;
  border-top: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-weight: 500;
}
.mobile-nav-link:hover { background: var(--secondary); }

/* Ensure the header container is the positioning context */
.header .container { position: relative; }

/* Mobile breakpoint: show toggle, hide desktop nav (you already hide .nav) */
@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; }
  /* .nav is already display:none here in your file */
}

/* Hero Section */
.hero {
  background: var(--background);
  padding-top: 4rem;
}

.hero-content {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero .search-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* Search Form */
.search-form {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 500;
  font-size: 0.875rem;
}

.input-group select,
.input-group input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

/* === Compact service chips under search === */
.service-chips {
  margin-top: .75rem;
}

.chips-label {
  justify-self: flex-start;
  display: block;
  font-size: .9rem;
  color: var(--text-light);
  margin-bottom: .5rem;
}

/* 2 columns by default (mobile / small screens) */
.chips-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

/* 3 columns on bigger screens */
@media (min-width: 768px) {
  .chips-wrap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .45rem .65rem;
  border: none;
  background: #ffffff;
  color: var(--primary);
  font-size: .975rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  user-select: none;
  white-space: nowrap;   
}

.chip:hover {
  background: #f1f3f5;
  border-color: var(--primary);
}

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

.chip-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.chip-icon img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.chip-emoji {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: white;
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: var(--secondary);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* =========================
   Services Section (clean)
   ========================= */
.services-section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
}

/* Responsive, gap-based grid (auto-fits nicely) */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

/* Square card, centered content */
.service-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  border-color: var(--primary);
}

.service-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.service-icon {
  width: var(--service-icon-size);
  height: var(--service-icon-size);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--secondary);
  line-height: 1;
}

/* Logos scale neatly inside the tile */
.service-icon .service-logo {
  width: 70%;
  height: 70%;
  display: block;
  object-fit: contain;
}

/* Emoji fallback matches visual size */
.service-icon .service-emoji {
  font-size: calc(var(--service-icon-size) * .7);
  line-height: 1;
}

/* Name typography */
.service-name {
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-wrap: balance;
}

/* Trust Section */
.trust-section {
  background-color: var(--muted-bg);
  padding: 4rem 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust-item {
  text-align: center;
}

.trust-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.trust-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.trust-description {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* CTA Section */
.cta-section {
  padding: 4rem 0;
}

.cta-card {
  background-color: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .cta-card {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.cta-title {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.cta-description {
  opacity: 0.9;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background-color: var(--muted-bg);
  padding: 2rem 0;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer .container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-light);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
}

/* Search Results */
.search-results-section {
  padding: 0rem 0 4rem;
}

.search-bar {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-form-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.search-form-inline select,
.search-form-inline input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

.results-header {
  margin-bottom: 2rem;
}

.results-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.results-count {
  color: var(--text-light);
}

/* Mobile first: 1 column by default */
.contractors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* At 768px and up, use 2 columns */
@media (min-width: 768px) {
  .contractors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contractor-card {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.08s;
}

.contractor-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.contractor-media {
  flex: 0 0 150px;
  width: 150px;
  aspect-ratio: 4 / 3;     
  border-radius: 8px;
  overflow: hidden;
  background: #e9ecef;
}

.contractor-media img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Right content */
.contractor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* top row: badges + popular pill */
.contractor-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .35rem;
}

.contractor-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .35rem;
}

/* metric aligned like screenshot */
.contractor-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.contractor-rating--empty {
  visibility: hidden; 
}

.recommend-icon {
  font-size: 1.1rem;
}

.rating-text {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* description + tags */
.contractor-description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.contractor-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.service-tag {
  background-color: var(--secondary);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* footer row */
.contractor-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}

.contractor-location {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ==== Contractor cards: mobile layout ==== */
@media (max-width: 767px) {
  .contractor-card {
    flex-direction: column;       /* stack image + content */
    padding: 1rem;
    gap: 0.75rem;
  }

  .contractor-header {
    flex-direction: column;       /* image on top, text under */
    align-items: flex-start;
    gap: 0.75rem;
  }

  .contractor-media {
    width: 100%;                  /* full-width image on mobile */
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;        /* nicer wide image */
  }

  .contractor-media img {
    width: 100%;
    height: 100%;
  }

  .contractor-name {
    font-size: 1.05rem;           /* a touch smaller on mobile */
    margin-top: 0.25rem;
  }

  .contractor-description {
    font-size: 0.9rem;
  }

  .contractor-services {
    gap: 0.4rem;
  }

  .service-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }

  .contractor-footer {
    flex-direction: column;       /* stack location + "View profile" */
    align-items: flex-start;
    gap: 0.35rem;
  }

  .view-profile {
    font-size: 0.85rem;
  }
}

.location-pin {
  margin-right: 0.3rem;
}

.view-profile {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Profile Page */
.profile-section {
  padding: 2rem 0 4rem;
}

.profile-header {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.profile-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1.5rem;
}

.profile-name {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.profile-description {
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Contact buttons: responsive stack */
.contact-buttons {
  display: flex;
  gap: 1rem;
}

@media (min-width: 768px) {
  /* desktop/tablet: sit side-by-side, equal widths */
  .contact-buttons .btn { flex: 1 1 0; }
}

@media (max-width: 767px) {
  /* mobile: stack and make full width */
  .contact-buttons { flex-direction: column; }
  .contact-buttons .btn { width: 100%; }
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .profile-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.profile-section-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
}

.review-author {
  font-weight: 600;
}

.review-date {
  color: var(--text-light);
  font-size: 0.875rem;
}

.review-text {
  line-height: 1.6;
}

/* Reviews: show first ~5 cards, scroll the rest */
.reviews-scroll {
  /* a safe max height that’s ~5 review cards on most screens */
  max-height: 520px;
  overflow-y: auto;
  padding-right: .25rem;   /* keeps text from sitting under the scrollbar */
  margin-right: -.25rem;   /* re-aligns the right edge visually */
  scroll-behavior: smooth;
}

/* mobile: a bit shorter */
@media (max-width: 767px) {
  .reviews-scroll { max-height: 420px; }
}

/* nice, unobtrusive scrollbar */
.reviews-scroll::-webkit-scrollbar { width: 10px; }
.reviews-scroll::-webkit-scrollbar-thumb {
  background: #e9ecef;
  border-radius: 8px;
}
.reviews-scroll:hover::-webkit-scrollbar-thumb { background: #d7dce1; }

.info-card {
  background-color: var(--card-bg);
  /* border: 1px solid var(--border); */
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
}

.info-value {
  color: var(--text-light);
}

/* Forms */
.form-section {
  padding: 2rem 0 4rem;
}

.form-container {
  max-width: 48rem;
  margin: 0 auto;
}

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.form-description {
  color: var(--text-light);
  line-height: 1.6;
}

.intake-form,
.review-form {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-section-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 0.5rem;
  font-size: 2rem;
}

.star {
  cursor: pointer;
  color: #ddd;
  transition: color 0.2s;
}

.star:hover,
.star.active {
  color: #ffd43b;
}

/* Admin Dashboard */
.admin-section {
  padding: 2rem 0 4rem;
}

.admin-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: var(--muted-bg);
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-active {
  background-color: var(--success);
  color: white;
}

.status-pending {
  background-color: var(--warning);
  color: var(--text);
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 767px) {
  .hero-title {
    font-size: 2rem;
  }

  .search-inputs {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }
}

/* === Submit loading state === */
@keyframes lll-spin {
  to { transform: rotate(360deg); }
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn.is-loading .btn-label {
  visibility: hidden; /* keep layout stable while spinner shows */
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: lll-spin 0.8s linear infinite;
}

/* === Lightbox (robust fit) === */
.lightbox {
  --lb-pad: 2rem;                 /* overlay padding (used below) */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  place-items: center;
  z-index: 9999;
}
.lightbox.is-open { display: grid; }

/* Full-viewport centering box with inner padding */
.lightbox-figure {
  margin: 0;
  width: 100vw;
  height: 100vh;
  padding: var(--lb-pad);
  display: flex;
  align-items: center;
  justify-content: center;

  /* Remove previous constraints that can fight scaling */
  max-width: none !important;
  max-height: none !important;
}

/* Image: never upscale, always fit within padded viewport */
#lightboxImg {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  display: block;

  /* polish */
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  background: #000;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: background .2s ease, transform .1s ease;
  user-select: none;
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,.2);
}

/* Small screens: a touch less padding */
@media (max-width: 480px) {
  .lightbox-figure { padding: 1rem; }
}

/* Back control */
.back-row {
  margin-bottom: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.back-link:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

.back-link:active {
  transform: translateY(1px);
}

.back-icon {
  font-size: 1rem;
  line-height: 1;
}

/* === Profile photos: 1 large left + 4 small right === */
.photos-mosaic {
  margin-bottom: 2rem;
}

.mosaic-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 210px 210px; /* tweak row height here */
  grid-template-areas:
    "main s1 s2"
    "main s3 s4";
}

.mosaic-main   { grid-area: main; }
.mosaic-s1     { grid-area: s1; }
.mosaic-s2     { grid-area: s2; }
.mosaic-s3     { grid-area: s3; }
.mosaic-s4     { grid-area: s4; }

/* Tiles are buttons for accessibility; remove default styles */
.mosaic-tile {
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

.mosaic-tile img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Optional: a subtle overlay on hover */
.mosaic-tile::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.0);
  transition: background .15s ease;
}
.mosaic-tile:hover::after { background: rgba(0,0,0,.06); }

/* Mobile: fall back to a simple 2-col grid */
@media (max-width: 767px) {
  .mosaic-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas: none;
  }
  .mosaic-main,
  .mosaic-s1,
  .mosaic-s2,
  .mosaic-s3,
  .mosaic-s4 {
    grid-area: auto;
    aspect-ratio: 16/10; /* keep nice ratios on small screens */
  }
  .mosaic-main { grid-column: 1 / -1; } /* main spans full width on mobile */
}

/* === Mobile alignment fix: make Contact/Services match Reviews alignment === */

@media (max-width: 767px) {
  .info-card {
    padding: 0;
  }
}

/* === Recommend / Do Not Recommend (thumbs) === */
.recommend-wrap {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.thumb {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--text);
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.thumb:hover {
  background: #f1f3f5;
  border-color: var(--primary);
}

.thumb:active { transform: translateY(1px); }
.thumb[aria-pressed="true"] {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

/* Optional color hinting */
.thumb-up[aria-pressed="true"]   { border-color: var(--success); }
.thumb-down[aria-pressed="true"] { border-color: var(--danger); }

/* --- Recommendation metric / review vote --- */
.recommend-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.recommend-text {
  color: var(--text-light);
  font-size: 0.9375rem;
}

.review-vote {
  margin-top: .25rem;
  font-size: 1.1rem; /* 👍/👎 size */
  line-height: 1;
  color: var(--text-light);
}

/* === "Other" service row === */
.other-service {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .75rem;
  margin-top: .5rem;
}

/* Let it line up nicely with the checkbox grid */
.checkbox-grid + .other-service {
  margin-top: .75rem;
}

.other-input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

.other-input[disabled] {
  background: var(--secondary);
  opacity: .8;
  cursor: not-allowed;
}

.other-service .hint {
  grid-column: 1 / -1;
  color: var(--text-light);
  font-size: .8125rem;
  margin-top: .25rem;
}

/* On small screens, stack neatly */
@media (max-width: 480px) {
  .other-service {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* ---------- Why Join page polish ---------- */
.section { padding: 4rem 0; }
.subtitle {
  max-width: 56ch;
  margin: 0.5rem auto 2rem;
  text-align: center;
  color: var(--text-light);
}

/* Slightly tighter hero for subpages */
.hero.hero--sub { padding: 3rem 0 1rem; }
.hero.hero--sub .hero-title { font-size: 2.25rem; }

/* Benefits */

/* How it works */
.how-it-works {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}
@media (min-width: 768px) {
  .how-it-works { grid-template-columns: repeat(3, 1fr); }
}
.how-step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  align-items: start;
}
.how-num {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-weight: 700;
}
.how-title { font-weight: 600; margin: 0; }
.how-text  { color: var(--text-light); margin-top: .25rem; font-size: .95rem; }

/* Proof list */
.proof-points {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  margin-top: 1rem;
}
@media (min-width: 768px) {
  .proof-points { grid-template-columns: repeat(2, 1fr); }
}
.proof-points li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  color: var(--text);
  font-size: .95rem;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  height: 25.59px;
}

/* generic badge style for this row */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--primary);
  background: transparent;
  border: none;
  padding: 0;
}

.badge strong {
  font-weight: 600;
}

.badge-icon {
  width: 16px;
  height: 16px;
  margin-right: 2px;
  vertical-align: middle;
}

/* optional variants if you want */
.badge--verified  { color: var(--primary); }
.badge--licensed  { color: var(--primary); }
.badge--insured   { color: var(--primary); }
.badge--unverified {
  color: var(--text-light);
}

/* Always-stack headline for search cards */
.contractor-card .contractor-header {
  padding-bottom: .25rem; /* light breathing room above metric row */
}

.contractor-headline {
  display: flex;
  flex-direction: column;   /* stack name above badges on all screens */
  align-items: flex-start;
  gap: .375rem;             /* space between name and badges */
}

.contractor-headline .badge-row {
  margin-left: 0;           /* never push to right */
  display: flex;
  flex-wrap: wrap;          /* wrap if both badges and long names */
  height: 25.59px;
}

.popular-pill {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.popular-icon {
  font-size: 0.9rem;
  display: inline-flex;
}

@media (max-width: 767px) {
  .popular-pill {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* --- Review: steps/notice panel --- */
.notice-box {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.notice-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.steps-list {
  list-style: none;
  display: grid;
  gap: .35rem;
  color: var(--text-light);
  font-size: .95rem;
  margin-left: 0;
}
.step-num {
  font-weight: 700;
  color: var(--text);
  margin-right: .35rem;
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0,0,0,.5);
  z-index: 10000;
  padding: 1rem;
}
.modal.is-open { display: grid; }

.modal-card {
  width: min(520px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem 1.25rem 1.25rem;
  position: relative;
  box-shadow: 0 24px 48px rgba(0,0,0,.18);
  animation: modal-pop .16s ease-out;
}

@keyframes modal-pop {
  from { transform: translateY(4px); opacity: .6; }
  to   { transform: none; opacity: 1; }
}

.modal-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--text);
  cursor: pointer;
}

.modal-icon {
  font-size: 2rem;
  margin-bottom: .25rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: .375rem;
}

.modal-text {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

/* Stronger visual when selected */
.thumb-up[aria-pressed="true"] {
  background: #e6fcf5;          /* light green */
  border-color: var(--success);
  color: #0b8f62;
}
.thumb-down[aria-pressed="true"] {
  background: #fff5f5;          /* light red */
  border-color: var(--danger);
  color: #c92a2a;
}

/* Clear (X) button inside search */
.search-form-inline { position: relative; }

.search-input-wrap {
  position: relative;
  display: grid;
}

.search-input-wrap input {
  padding-right: 2.5rem; /* make room for the clear button */
}

.clear-btn {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: none;                 /* hidden until there is text */
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.clear-btn.is-visible { display: grid; }

.clear-btn:hover {
  background: var(--card-bg);
}

.clear-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Promo band (Why Join) ===== */

/* ===== How it works header ===== */
.how-header {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
  margin: 2.5rem 0 .75rem;
}

