/**
 * HOMEOWNERS MARKETPLACE – Quote Form Addon Styles with CITY support
 * Version: 2.5.1-CITY-FIXED-COMPLETE
 * Updated: 2025-10-03
 * File: quote-form-addon.css
 * 
 * FIXES in 2.5.1:
 * - FIXED: Renamed .hmp-inline-zipwrap to .hmp-inline-citywrap
 * - FIXED: Renamed .hmp-inline-zip to .hmp-inline-city
 * - FIXED: City dropdown styling matches service dropdown
 * - FIXED: Icon alignment with city field (uses flex instead of grid)
 * - FIXED: Removed background/border from service and city fields
 * - COMPLETE: All sections from original file included
 */

:root {
  --hmp-primary-blue: #2c5aa0;
  --hmp-secondary-blue: #4a90e2;
  --hmp-success-green: #28a745;
  --hmp-error-red: #dc3545;
  --hmp-text-dark: #333;
  --hmp-border: #e9ecef;
  --hmp-radius-pill: 9999px;
  --hmp-radius-lg: 12px;
  --hmp-shadow-1: 0 8px 20px rgba(44, 90, 160, 0.15);
  --hmp-shadow-2: 0 12px 30px rgba(44, 90, 160, 0.25);
  --hmp-gap: 12px;
  --hmp-pill-height: 56px;
  --hmp-pill-pad-x: 12px;
  --hmp-cta-size: calc(var(--hmp-pill-height) - 14px);
  --hmp-service-min: 140px;
  --hmp-city-width: 96px;
}

/* ================= Buttons / Modal / Form ================= */
.hmp-quote-btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--hmp-primary-blue), var(--hmp-secondary-blue));
  color: #fff;
  box-shadow: var(--hmp-shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hmp-quote-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--hmp-shadow-2);
  background: linear-gradient(135deg, #234a87, #3a7bc8);
}

.hmp-quote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hmp-quote-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999999;
  padding: 20px;
  box-sizing: border-box;
  display: none;
  visibility: hidden;
  opacity: 0;
}

.hmp-quote-modal-overlay.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.hmp-quote-modal-overlay.no-backdrop {
  background: transparent;
}

.hmp-quote-modal-overlay.below-header {
  padding-top: 120px;
  align-items: flex-start;
  padding-bottom: 60px;
}

.hmp-quote-modal-overlay.mobile-modal {
  padding: 10px;
  align-items: flex-start;
  overflow-y: auto;
}

.hmp-quote-modal-content {
  background: #fff;
  border-radius: var(--hmp-radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0 auto;
}

.hmp-quote-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.hmp-quote-modal-close:hover {
  background: #e0e0e0;
}

.hmp-quote-modal-close svg {
  width: 18px;
  height: 18px;
  color: #333;
}

.hmp-quote-form {
  padding: 32px 24px;
}

.hmp-form-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--hmp-primary-blue);
  margin: 0 0 24px 0;
  text-align: center;
}

.hmp-form-group {
  margin-bottom: 20px;
}

.hmp-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--hmp-text-dark);
  font-size: 14px;
}

.hmp-form-group input,
.hmp-form-group select,
.hmp-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--hmp-border);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.hmp-form-group input:focus,
.hmp-form-group select:focus,
.hmp-form-group textarea:focus {
  outline: 0;
  border-color: var(--hmp-primary-blue);
}

.hmp-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.hmp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hmp-submit-quote-btn {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--hmp-primary-blue), var(--hmp-secondary-blue));
  box-shadow: var(--hmp-shadow-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 10px;
  font-size: 16px;
  min-height: 48px;
  z-index: 1000001;
  position: relative;
}

.hmp-submit-quote-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--hmp-shadow-2);
}

.hmp-submit-quote-btn .hmp-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  margin-left: 8px;
  animation: hmpSpin 1s linear infinite;
}

@keyframes hmpSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .hmp-submit-quote-btn {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, var(--hmp-primary-blue), var(--hmp-secondary-blue));
    z-index: 10;
    margin: 20px -24px -24px -24px;
    border-radius: 0 0 var(--hmp-radius-lg) var(--hmp-radius-lg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1), var(--hmp-shadow-1);
  }

  .hmp-quote-form {
    padding-bottom: 80px;
  }
}

.hmp-error-message {
  display: block;
  color: var(--hmp-error-red);
  font-size: 12px;
  margin-top: 6px;
}

.hmp-quote-form .error {
  border-color: var(--hmp-error-red) !important;
  background: rgba(220, 53, 69, 0.05);
}

/* ================= Inline pill search ================= */

/* Size variations */
.hmp-inline-bar.hmp-cta-sm,
.hmp-cta-sm .hmp-inline-bar {
  --hmp-cta-size: 40px;
}

.hmp-inline-bar.hmp-cta-md,
.hmp-cta-md .hmp-inline-bar {
  --hmp-cta-size: 48px;
}

.hmp-inline-bar.hmp-cta-lg,
.hmp-cta-lg .hmp-inline-bar {
  --hmp-cta-size: 56px;
}

.hmp-inline-bar.width-sm,
.width-sm .hmp-inline-bar,
.hmp-inline-service.width-sm {
  --hmp-service-min: 140px;
}

.hmp-inline-bar.width-md,
.width-md .hmp-inline-bar,
.hmp-inline-service.width-md {
  --hmp-service-min: 200px;
}

.hmp-inline-bar.width-lg,
.width-lg .hmp-inline-bar,
.hmp-inline-service.width-lg {
  --hmp-service-min: 280px;
}

.hmp-inline-bar.width-xl,
.width-xl .hmp-inline-bar,
.hmp-inline-service.width-xl {
  --hmp-service-min: 360px;
}

.hmp-inline-bar.city-sm,
.city-sm .hmp-inline-bar,
.hmp-inline-city.city-sm {
  --hmp-city-width: 84px;
}

.hmp-inline-bar.city-md,
.city-md .hmp-inline-bar,
.hmp-inline-city.city-md {
  --hmp-city-width: 112px;
}

.hmp-inline-bar.city-lg,
.city-lg .hmp-inline-bar,
.hmp-inline-city.city-lg {
  --hmp-city-width: 136px;
}

/* FIXED: Desktop pill with city field */
.hmp-inline-bar {
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns:
    minmax(var(--hmp-service-min), 1fr)
    1px
    calc(var(--hmp-city-width) + 28px)
    var(--hmp-cta-size);
  align-items: center;
  column-gap: var(--hmp-gap);
  background: #fff;
  border: 1px solid rgba(44, 90, 160, 0.12);
  border-radius: var(--hmp-radius-pill);
  box-shadow: 0 10px 28px rgba(44, 90, 160, 0.15);
  height: var(--hmp-pill-height);
  padding: 0 var(--hmp-pill-pad-x);
  overflow: hidden;
}

.hmp-autocomplete-container {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

/* FIXED: Service field - removed background and border */
.hmp-inline-service {
  flex: 1 1 auto;
  height: 100%;
  padding: 0 14px;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  font-size: 16px;
  color: #111;
  line-height: 1;
  box-sizing: border-box;
  pointer-events: auto !important;
  cursor: text !important;
  position: relative;
  z-index: 2;
}

.hmp-inline-service::placeholder {
  color: #7a8aa0;
  opacity: 1;
  text-shadow: none;
}

.hmp-inline-divider {
  height: 60%;
  background: #dbe5ff;
  opacity: 0.85;
  justify-self: center;
  width: 1px;
}

/* FIXED: City input container using flexbox for proper alignment */
.hmp-inline-citywrap {
  width: calc(var(--hmp-city-width) + 28px);
  display: flex;
  align-items: center;
  height: 100%;
  gap: 8px;
}

/* FIXED: Icon next to city field */
.hmp-inline-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 0;
  color: #333;
  opacity: 0.85;
  flex-shrink: 0;
}

/* FIXED: City field - removed background and border */
.hmp-inline-city {
  flex: 1;
  height: 100%;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  padding: 0 8px;
  font-size: 16px;
  color: #111;
  line-height: 1;
  text-align: left;
  box-sizing: border-box;
  pointer-events: auto !important;
  cursor: text !important;
  position: relative;
  z-index: 2;
}

.hmp-inline-city::placeholder {
  color: #7a8aa0;
  opacity: 1;
  text-shadow: none;
}

/* Search button */
.hmp-inline-searchbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hmp-cta-size);
  height: var(--hmp-cta-size);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--hmp-primary-blue), var(--hmp-secondary-blue));
  color: #fff;
  box-shadow: var(--hmp-shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hmp-inline-searchbtn:hover {
  transform: translateY(-1px);
  box-shadow: var(--hmp-shadow-2);
  background: linear-gradient(135deg, #234a87, #3a7bc8);
}

.hmp-inline-searchbtn svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* FIXED: Service autocomplete dropdown styling */
.hmp-inline-autosuggest-dropdown {
  position: fixed !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 6px 0 !important;
  max-height: 240px !important;
  overflow-y: auto !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
  z-index: 9999999 !important;
  display: none !important;
  color: #111 !important;
  min-width: 200px !important;
}

.hmp-inline-autosuggest-dropdown.show {
  display: block !important;
}

.hmp-inline-autosuggest-item {
  padding: 10px 14px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  color: #111 !important;
  font-size: 14px !important;
  border-bottom: 1px solid #f5f5f5 !important;
  transition: background-color 0.15s ease !important;
  pointer-events: auto !important;
}

.hmp-inline-autosuggest-item:hover,
.hmp-inline-autosuggest-item.highlighted {
  background: #f7f8fb !important;
  color: #111 !important;
}

.hmp-inline-autosuggest-item:last-child {
  border-bottom: none !important;
}

.hmp-inline-autosuggest-item.no-results {
  color: #666 !important;
  background: #fafbfc !important;
  cursor: default !important;
  font-style: italic !important;
  padding: 12px 14px !important;
}

.hmp-inline-autosuggest-item mark {
  background: #fff3cd !important;
  color: #856404 !important;
  padding: 1px 2px !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
}

/* FIXED: City autocomplete dropdown - matches service dropdown styling */
.hmp-city-autosuggest-dropdown {
  position: fixed !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 6px 0 !important;
  max-height: 240px !important;
  overflow-y: auto !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
  z-index: 9999999 !important;
  display: none !important;
  color: #111 !important;
  min-width: 200px !important;
}

.hmp-city-autosuggest-dropdown.show {
  display: block !important;
}

.hmp-city-autosuggest-item {
  padding: 10px 14px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  color: #111 !important;
  font-size: 14px !important;
  border-bottom: 1px solid #f5f5f5 !important;
  transition: background-color 0.15s ease !important;
  pointer-events: auto !important;
}

.hmp-city-autosuggest-item:hover,
.hmp-city-autosuggest-item.highlighted {
  background: #f7f8fb !important;
  color: #111 !important;
}

.hmp-city-autosuggest-item:last-child {
  border-bottom: none !important;
}

.hmp-city-autosuggest-item.no-results {
  color: #666 !important;
  background: #fafbfc !important;
  cursor: default !important;
  font-style: italic !important;
  padding: 12px 14px !important;
}

.hmp-city-autosuggest-item mark {
  background: #fff3cd !important;
  color: #856404 !important;
  padding: 1px 2px !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
}

/* Legacy autocomplete dropdown */
.hmp-autocomplete-dropdown {
  position: fixed !important;
  top: calc(100% + 2px) !important;
  left: 0 !important;
  right: 0 !important;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid var(--hmp-border) !important;
  border-radius: 8px !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  z-index: 9999999 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
  display: none !important;
  pointer-events: auto !important;
}

.hmp-autocomplete-dropdown.show {
  display: block !important;
}

.hmp-autocomplete-item {
  padding: 12px 16px !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f5f5f5 !important;
  transition: background-color 0.15s ease !important;
  color: #111 !important;
  font-size: 14px !important;
  pointer-events: auto !important;
}

.hmp-autocomplete-item:hover,
.hmp-autocomplete-item.highlighted {
  background-color: #f8f9fa !important;
  color: #111 !important;
}

.hmp-autocomplete-item:last-child {
  border-bottom: none !important;
}

.hmp-autocomplete-item.no-results {
  color: #6c757d !important;
  background: #fafbfc !important;
  cursor: default !important;
  font-style: italic !important;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .hmp-inline-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: #fff !important;
    border: 1px solid var(--hmp-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: var(--hmp-shadow-1) !important;
    height: auto;
  }

  .hmp-autocomplete-container {
    height: auto;
  }

  .hmp-inline-service,
  .hmp-inline-city {
    height: 52px;
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 10px !important;
    padding: 0 16px;
    font-size: 16px !important;
    color: #111 !important;
    pointer-events: auto !important;
    cursor: text !important;
  }

  .hmp-inline-divider {
    display: none;
  }

  .hmp-inline-citywrap {
    width: 100%;
    height: auto;
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .hmp-inline-citywrap .hmp-inline-pin {
    display: none !important;
  }

  .hmp-inline-searchbtn {
    width: 100%;
    height: 52px !important;
    border-radius: 10px !important;
    font-size: 16px;
    font-weight: 600;
  }

  .hmp-inline-autosuggest-dropdown,
  .hmp-city-autosuggest-dropdown,
  .hmp-autocomplete-dropdown {
    border-radius: 8px !important;
    max-height: 180px !important;
  }

  .hmp-inline-autosuggest-item,
  .hmp-city-autosuggest-item,
  .hmp-autocomplete-item {
    padding: 12px 16px !important;
    font-size: 16px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }
}

@media (max-width: 480px) {
  .hmp-inline-service,
  .hmp-inline-city,
  .hmp-inline-searchbtn {
    height: 48px;
  }

  .hmp-quote-modal-overlay {
    padding: 5px;
  }

  .hmp-quote-form {
    padding: 20px;
  }
}

/* ================= Wizard Styles ================= */
.hmp-form-wizard {
  position: relative;
}

.hmp-wizard-header {
  margin-bottom: 20px;
  padding: 0 0 20px 0;
  border-bottom: 1px solid var(--hmp-border);
}

.hmp-progress-bar {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  margin-bottom: 15px;
  overflow: hidden;
}

.hmp-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--hmp-primary-blue), var(--hmp-secondary-blue));
  transition: width 0.3s ease;
}

.hmp-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.hmp-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: #e9ecef;
  color: #6c757d;
  transition: all 0.3s ease;
}

.hmp-step-number.active {
  background: var(--hmp-primary-blue);
  color: #fff;
}

.hmp-step-number.completed {
  background: var(--hmp-success-green);
  color: #fff;
}

.hmp-step-divider {
  width: 40px;
  height: 2px;
  background: #e9ecef;
}

.hmp-wizard-content {
  min-height: 300px;
}

.hmp-form-page {
  display: none;
}

.hmp-form-page.active {
  display: block;
}

.hmp-page-title {
  color: var(--hmp-primary-blue);
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: 700;
}

.hmp-form-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--hmp-border);
}

.hmp-nav-btn {
  padding: 12px 24px;
  border: 2px solid var(--hmp-primary-blue);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.hmp-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hmp-nav-prev {
  background: transparent;
  color: var(--hmp-primary-blue);
}

.hmp-nav-prev:hover:not(:disabled) {
  background: var(--hmp-primary-blue);
  color: #fff;
}

.hmp-nav-next,
.hmp-nav-submit {
  background: var(--hmp-primary-blue);
  color: #fff;
}

.hmp-nav-next:hover,
.hmp-nav-submit:hover {
  background: #234a87;
  transform: translateY(-1px);
}

/* ================= Multi-select Styles ================= */
.hmp-checkbox-limited-container {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  background: #f8f9fa;
  margin: 12px 0;
}

.hmp-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.hmp-checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  min-height: 48px;
  user-select: none;
}

.hmp-checkbox-item:hover {
  background: #f8f9fa;
  border-color: var(--hmp-primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(44, 90, 160, 0.1);
}

.hmp-checkbox-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f5f5f5;
}

.hmp-checkbox-item.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #dee2e6;
}

.hmp-checkbox-item input[type="checkbox"] {
  margin: 0 12px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--hmp-primary-blue);
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: none;
}

.hmp-checkbox-item span {
  flex: 1;
  line-height: 1.4;
  pointer-events: none;
}

.hmp-selection-counter {
  font-size: 12px;
  color: #6c757d;
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(44, 90, 160, 0.05);
  border-radius: 4px;
}

.hmp-selection-counter .count {
  font-weight: 700;
  color: var(--hmp-primary-blue);
  font-size: 14px;
}

.hmp-selection-counter.limit-reached {
  color: var(--hmp-error-red);
  background: rgba(220, 53, 69, 0.05);
}

.hmp-selection-counter.limit-reached .count {
  color: var(--hmp-error-red);
}

.hmp-max-selection-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 14px;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hmp-max-selection-notice svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ================= Success/Error Messages ================= */
.hmp-form-success-message {
  background: var(--hmp-success-green);
  color: #fff;
  padding: 20px 24px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  position: relative;
  display: none;
}

.hmp-form-success-message.show {
  display: block;
}

.hmp-success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.hmp-success-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hmp-success-close svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.hmp-form-error-message {
  background: var(--hmp-error-red);
  color: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.hmp-form-error-message.show {
  display: block;
}

/* ================= Character Counter ================= */
.hmp-character-counter {
  font-size: 12px;
  color: #6c757d;
  text-align: right;
  margin-top: 4px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.hmp-character-counter.warning {
  color: #ffc107;
}

.hmp-character-counter.danger {
  color: var(--hmp-error-red);
}

/* ================= Consent Checkboxes ================= */
.hmp-consent-group {
  margin: 20px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.hmp-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
}

.hmp-consent-label:last-child {
  margin-bottom: 0;
}

.hmp-consent-checkbox {
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
  accent-color: var(--hmp-primary-blue);
  cursor: pointer;
}

.hmp-consent-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hmp-text-dark);
}

.hmp-consent-text a {
  color: var(--hmp-primary-blue);
  text-decoration: underline;
}

.hmp-consent-text a:hover {
  text-decoration: none;
}

/* ================= Side-by-side layout ================= */
.hmp-form-row-sidebyside {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .hmp-form-row-sidebyside {
    grid-template-columns: 1fr;
  }

  .hmp-form-row {
    grid-template-columns: 1fr;
  }

  .hmp-consent-group {
    padding: 12px;
  }

  .hmp-consent-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    text-align: left !important;
    justify-content: flex-start !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }

  .hmp-consent-checkbox {
    width: 20px !important;
    height: 20px !important;
    margin: 2px 0 0 0 !important;
    flex-shrink: 0 !important;
    min-width: 20px !important;
    order: 1 !important;
  }

  .hmp-consent-text {
    flex: 1 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    order: 2 !important;
    word-wrap: break-word !important;
  }
}

/* ================= Pill width control ================= */
.hmp-inline-bar {
  inline-size: min(100%, var(--hmp-pill-max, 600px));
  margin-inline: auto;
}

/* ================= Body modal state ================= */
body.hmp-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  body.hmp-modal-open .hmp-quote-modal-overlay {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ================= Accessibility & High Contrast ================= */
.hmp-quote-btn:focus-visible,
.hmp-inline-searchbtn:focus-visible,
.hmp-quote-modal-close:focus-visible,
.hmp-submit-quote-btn:focus-visible {
  outline: 2px solid var(--hmp-primary-blue);
  outline-offset: 2px;
}

@media (prefers-contrast: high) {
  .hmp-inline-bar {
    border: 2px solid var(--hmp-primary-blue) !important;
  }

  .hmp-autocomplete-item:hover,
  .hmp-autocomplete-item.highlighted {
    background-color: var(--hmp-primary-blue) !important;
    color: #fff !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hmp-quote-btn,
  .hmp-inline-searchbtn,
  .hmp-submit-quote-btn,
  .hmp-quote-modal-content {
    transition: none !important;
    animation: none !important;
  }
}

/* ================= WordPress admin bar compatibility ================= */
.admin-bar .hmp-quote-modal-overlay.below-header {
  padding-top: 160px !important;
}

@media screen and (max-width: 782px) {
  .admin-bar .hmp-quote-modal-overlay.below-header {
    padding-top: 120px !important;
  }
}

/* ================= Print styles ================= */
@media print {
  .hmp-quote-modal-overlay {
    display: none !important;
  }

  .hmp-inline-bar {
    border: 1px solid #000 !important;
    background: #fff !important;
  }
}

/* ================= DEBUG OVERRIDES ================= */
.hmp-quote-modal-overlay.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.8) !important;
  z-index: 999999 !important;
  padding-top: 140px !important;
}

.hmp-quote-modal-content {
  background: #fff !important;
  border-radius: 12px !important;
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 1000000 !important;
}

.hmp-quote-modal-overlay {
  display: none !important;
}

.hmp-quote-modal-overlay.show {
  display: flex !important;
}

.hmp-quote-btn {
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}