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

:root {
  --primary: #3b5bdb;
  --primary-dark: #2f4bb8;
  --primary-light: #4c6ef5;
  --secondary: #f8f9fa;
  --accent: #20c997;
  --text: #212529;
  --text-light: #6c757d;
  --border: #dee2e6;
  --background: #ffffff;
  --card-bg: #ffffff;
  --muted-bg: #f8f9fa;
  --success: #51cf66;
  --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 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: bold;
  font-size: 1.25rem;
}

.logo-text {
  font-weight: bold;
  font-size: 1.25rem;
}

.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);
}

/* Hero Section */
.hero {
  background: linear-gradient(to bottom, rgba(59, 91, 219, 0.05), 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 {
  display: block;
  font-size: .8125rem;
  color: var(--text-light);
  margin-bottom: .5rem;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--text);
  border-radius: 999px;
  font-size: .875rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  user-select: none;
}

.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: 100%;
  height: 100%;
  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);
}

.contractors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

.contractor-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: block;
}

.contractor-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

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

.contractor-name {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.contractor-badge {
  background-color: var(--success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.contractor-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  color: #ffd43b;
}

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

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

.service-tag {
  background-color: var(--secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.contractor-description {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.contractor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.contractor-location {
  color: var(--text-light);
  font-size: 0.875rem;
  width: 60%;
}

.view-profile {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
}

/* 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;
}

.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%;
  object-fit: cover;
  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 */
.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .benefits-grid { grid-template-columns: repeat(3, 1fr); }
}
.benefit {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.benefit-icon {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.benefit-title {
  font-weight: 700;
  margin-bottom: .25rem;
}
.benefit-text {
  color: var(--text-light);
  font-size: .95rem;
}

/* 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 aligns to the right in headers, stacks nicely on mobile */
.badge-row {
  display: flex;
  gap: .375rem;
  align-items: center;
}

/* In card headers, push to the right edge if needed */
.contractor-header .badge-row {
  margin-left: auto;
}

/* Generic badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--text);
  white-space: nowrap;
}

/* Subtle color hints; tweak if you want stronger accents */
.badge--licensed { border-color: var(--primary); }
.badge--insured  { border-color: var(--border); }

/* 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 */
  gap: .375rem .375rem;
}

/* --- 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;
}
