/**
 * Universal Contact Form CSS
 * Consolidated styles for accessibility, validation, and improved UX
 * 
 * CONSOLIDATION NOTES:
 * This is now the single contact form stylesheet used across all pages.
 * Previously separate "enhanced" and "regular" form styles have been unified.
 */

/* ========================================
   BASE FORM STYLES
   ======================================== */

/* Design tokens for the contact module */
:root {
  --c-primary: #dc2626;         /* red-600 */
  --c-primary-600: #b91c1c;     /* red-700 */
  --c-primary-50: #fef2f2;      /* red-50 */
  --c-accent: #10b981;          /* emerald-500 */
  --c-info: #2563eb;            /* blue-600 */
  --c-info-600: #1d4ed8;        /* blue-700 */
  --c-green: #10b981;
  --c-amber: #d97706;
  --c-gray-50: #f8fafc;
  --c-gray-100: #f1f5f9;
  --c-gray-200: #e5e7eb;
  --c-gray-300: #d1d5db;
  --c-gray-400: #9ca3af;
  --c-gray-600: #4b5563;
  --c-gray-700: #374151;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;

  --shadow-focus: 0 0 0 3px rgba(220, 38, 38, 0.1);
  --shadow-hover: 0 8px 25px rgba(220, 38, 38, 0.15);
  --shadow-elev: 0 10px 25px rgba(0, 0, 0, 0.1);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
}

/* Screen Reader Only Content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot Spam Prevention */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ========================================
   CONTACT TYPE SELECTOR
   ======================================== */

.contact-type-section {
  margin-bottom: 2rem;
}

.contact-type-section h3 {
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
}

.contact-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-type-option {
  position: relative;
  cursor: pointer;
  display: block;
}

.contact-type-radio {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.contact-type-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.contact-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
  transition: left 0.5s ease;
}

.contact-type-option:hover .contact-type-card {
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15);
}

.contact-type-option:hover .contact-type-card::before {
  left: 100%;
}

.contact-type-radio:checked + .contact-type-card {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #ffffff);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
}

.contact-type-radio:checked + .contact-type-card .contact-type-icon {
  color: #dc2626;
  transform: scale(1.1);
}

.contact-type-radio:checked + .contact-type-card .contact-type-title {
  color: #dc2626;
}

.contact-type-icon {
  font-size: 3rem;
  color: #6b7280;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.contact-type-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.contact-type-description {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.contact-type-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.contact-type-features li {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: #374151;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.contact-type-features li:last-child {
  margin-bottom: 0;
}

.contact-type-features i {
  color: #10b981;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  width: 1rem;
  text-align: center;
}

.contact-type-radio:checked + .contact-type-card .contact-type-features i {
  color: #dc2626;
}

/* Contact Type Animation */
@keyframes contactTypeSelect {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* (Mobile collapsibles and info toggle removed per UX decision) */

.contact-type-radio:checked + .contact-type-card {
  animation: contactTypeSelect 0.3s ease;
}

/* Form Section Transitions */
.form-section[data-contact-type] {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Initially hide request-quote sections */
.form-section[data-contact-type="request-quote"] {
  display: none;
  opacity: 0;
  transform: translateY(-10px);
}

/* Show request-quote sections when active */
.form-section[data-contact-type="request-quote"].active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Form Sections */
.form-section {
  border: none;
  margin: 0;
  padding: 0;
  margin-bottom: 2rem;
}

.form-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-gray-700);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--c-gray-200);
  display: block;
}

/* Form Groups */
.form-group {
  position: relative;
  margin-bottom: 1rem;
}

/* Labels */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Required Indicator */
.required-indicator {
  color: #dc2626;
  font-weight: 700;
  margin-left: 0.25rem;
}

/* Form Inputs */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--c-gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-gray-700);
  background-color: #ffffff;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-input:hover {
  border-color: #9ca3af;
}

.form-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  background-color: #ffffff;
}

/* Input States */
.form-input:valid:not(:placeholder-shown) {
  border-color: var(--c-accent);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2310b981'%3e%3cpath d='M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2.5rem;
}

.form-input.error {
  border-color: var(--c-primary);
  background-color: var(--c-primary-50);
  box-shadow: 0 0 0 1px var(--c-primary);
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Help Text */
.field-help {
  font-size: 0.75rem;
  color: var(--c-gray-600);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Error Messages */
.field-error {
  font-size: 0.75rem;
  color: var(--c-primary);
  margin-top: 0.25rem;
  display: none;
  align-items: center;
  line-height: 1.4;
}

.field-error.show {
  display: flex;
}

.field-error:before {
  content: "\f06a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.375rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ========================================
   FORM PROGRESS
   ======================================== */

.form-progress {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.form-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ========================================
   SERVICE CHECKBOXES
   ======================================== */

.service-checkbox {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #ffffff;
  position: relative;
}

.service-checkbox:hover {
  border-color: var(--c-primary);
  background-color: var(--c-primary-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-checkbox:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}

.service-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.service-input:checked + .service-label {
  color: #dc2626;
  font-weight: 600;
}

.service-input:checked ~ * {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.service-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
  width: 100%;
}

.service-label i {
  margin-right: 0.5rem;
  width: 1rem;
  text-align: center;
  color: #6b7280;
  transition: color 0.2s ease;
}

.service-input:checked + .service-label i {
  color: var(--c-primary);
}

/* ========================================
   FORM ANIMATIONS
   ======================================== */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.form-group.error {
  animation: shake 0.4s ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   BUTTON STATES
   ======================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: var(--space-2);
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: var(--shadow-elev);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus), var(--shadow-elev);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

.submit-text,
.loading-text {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.loading-text.hidden {
  display: none;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.form-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elev);
  max-width: 24rem;
  transition: all 0.3s ease;
  transform: translateX(100%);
  backdrop-filter: blur(8px);
}

.form-notification.show {
  transform: translateX(0);
}

.form-notification.success {
  background: linear-gradient(135deg, var(--c-green), #059669);
  color: white;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-notification.error {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
  color: white;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.form-notification.info {
  background: linear-gradient(135deg, var(--c-info), var(--c-info-600));
  color: white;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ========================================
   FORM SUCCESS STATE
   ======================================== */

.form-success {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #10b981;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.form-success:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s ease-in-out;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.form-success h3 {
  color: #059669;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-success h3 i {
  margin-right: 0.5rem;
  color: #10b981;
}

.form-success p {
  color: #047857;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ========================================
   CHARACTER COUNTER
   ======================================== */

#message-counter {
  font-weight: 600;
  color: #6b7280;
  transition: color 0.2s ease;
}

#message-counter.warning {
  color: #d97706;
}

#message-counter.danger {
  color: #dc2626;
}

/* ========================================
   TEXTAREA ENHANCEMENTS
   ======================================== */

textarea.form-input {
  resize: vertical;
  min-height: 6rem;
  font-family: inherit;
  line-height: 1.5;
}

textarea.form-input:focus {
  min-height: 8rem;
  box-shadow: var(--shadow-focus);
}

/* ========================================
   SELECT ENHANCEMENTS
   ======================================== */

select.form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem 1.25rem;
  padding-right: 2.5rem;
}

select.form-input:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23dc2626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  box-shadow: var(--shadow-focus);
}

/* (Custom select removed; using native select with compact sizing rules below) */

/* ========================================
   VEHICLE AUTOCOMPLETE
   ======================================== */

.vehicle-info-section {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.vehicle-info-section h4 {
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vehicle-info-section h4 i {
  color: #dc2626;
  font-size: 1.25rem;
}

/* Autocomplete Wrapper */
.autocomplete-wrapper {
  position: relative;
}

/* Autocomplete Input States */
.autocomplete-input {
  position: relative;
  z-index: 1;
}

.autocomplete-input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.autocomplete-input.disabled {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 2px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.25rem);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Autocomplete Options */
.autocomplete-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  line-height: 1.4;
}

.autocomplete-option:last-child {
  border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.active {
  background-color: #dc2626;
  color: white;
}

.autocomplete-option mark {
  background-color: rgba(255, 255, 255, 0.2);
  color: inherit;
  font-weight: 600;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.autocomplete-option:hover mark,
.autocomplete-option.active mark {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Loading State */
.autocomplete-loading {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.autocomplete-loading i {
  color: #dc2626;
}

/* No Results State */
.autocomplete-no-results {
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

/* Vehicle Summary */
.vehicle-summary {
  margin-top: 1rem;
  animation: slideIn 0.3s ease;
}

.vehicle-summary .bg-green-50 {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #10b981;
  padding: 1rem;
  border-radius: 0.75rem;
  position: relative;
  overflow: hidden;
}

.vehicle-summary .bg-green-50::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 1.5s ease-in-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vehicle-summary p {
  margin: 0;
  line-height: 1.5;
}

.vehicle-summary .text-green-800 {
  color: #065f46;
  font-weight: 600;
  font-size: 0.875rem;
}

.vehicle-summary .text-green-700 {
  color: #047857;
  font-size: 1rem;
  font-weight: 500;
}

/* Cascading Field Animation */
.autocomplete-input:not(:disabled):focus {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.autocomplete-input:not(:focus) {
  transform: scale(1);
  transition: transform 0.2s ease;
}

/* Grid Responsiveness for Vehicle Fields */
@media (max-width: 768px) {
  .grid.md\\:grid-cols-4 {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .vehicle-info-section {
    padding: 1rem;
  }
  
  .vehicle-info-section h4 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .grid.md\\:grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .autocomplete-dropdown {
    max-height: 8rem;
  }
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

@media (max-width: 768px) {
  .form-notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
    transform: translateY(-100%);
  }

  .form-notification.show {
    transform: translateY(0);
  }

  .form-section-title {
    font-size: 1.125rem;
  }

  .service-checkbox {
    padding: 0.5rem;
  }

  .service-label {
    font-size: 0.8rem;
  }

  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Contact Type Responsive */
  .contact-type-section {
    position: sticky;
    top: 0; /* adjust if header overlaps */
    z-index: 15;
    background: #ffffff;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-bottom: 1px solid #f1f5f9;
  }

  .contact-type-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .contact-type-card {
    padding: 0.75rem;
    border-width: 1px;
  }

  /* Compact segmented style: hide verbose text */
  .contact-type-description,
  .contact-type-features { display: none; }

  .contact-type-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .contact-type-title {
    font-size: 0.95rem;
    margin-bottom: 0;
  }

  .contact-type-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 640px) {
  .grid.md\\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .grid.md\\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: show First/Last name side-by-side in the first fieldset */
@media (max-width: 640px) {
  .contact-form-container fieldset.form-section:first-of-type .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem;
  }
  .contact-form-container fieldset.form-section:first-of-type .form-label {
    font-size: 0.8125rem;
  }
  .contact-form-container fieldset.form-section:first-of-type .form-input {
    font-size: 16px; /* keep readable and avoid iOS zoom */
    padding: 0.625rem 0.875rem;
  }
}

/* Mobile: pair Email + Phone in Contact Information section */
@media (max-width: 640px) {
  .contact-form-container fieldset.form-section:nth-of-type(2) .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .contact-form-container fieldset.form-section:nth-of-type(2) .form-label {
    font-size: 0.8125rem;
  }
}

/* ========================================
   MOBILE UX OPTIMIZATIONS
   Tighter spacing and readable sizing on phones
   ======================================== */
@media (max-width: 768px) {
  /* Slightly reduce heading and block spacing */
  .contact-form-container .form-section-title {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
  }

  .contact-form-container .form-group {
    margin-bottom: 0.75rem;
  }

  /* Button sizing: keep tappable but less bulky */
  .contact-form-container .btn-primary {
    font-size: 1.125rem; /* ~18px */
    padding: 0.875rem 1rem; /* ~14px vertical */
  }
}

@media (max-width: 480px) {
  /* Compact container padding on very small screens */
  .contact-form-container {
    padding: 1rem;
    margin: 0.25rem;
  }

  .contact-form-container .form-section {
    margin-bottom: 1rem;
  }

  .contact-form-container .form-group {
    margin-bottom: 0.625rem;
  }

  .contact-form-container .form-label {
    font-size: 0.8125rem; /* 13px */
  }

  .contact-form-container .form-input,
  .contact-form-container select.form-input,
  .contact-form-container textarea.form-input {
    padding: 0.625rem 0.875rem;
    font-size: 16px; /* prevent iOS zoom and maintain readability */
  }

  /* Cap select width further on small phones to keep dropdown menu narrow */
  .contact-form-container select.form-input {
    max-width: 18rem;
  }

  /* Progress bar spacing */
  .contact-form-container .form-progress {
    margin-bottom: 1rem;
  }

  /* Contact type cards: reduce visual weight */
  .contact-form-container .contact-type-card {
    padding: 1rem;
  }
  .contact-form-container .contact-type-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  .contact-form-container .contact-type-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .contact-form-container .contact-type-description {
    font-size: 0.8125rem;
  }

  /* Primary action button: compact but 44px+ tall */
  .contact-form-container .btn-primary {
    font-size: 1rem; /* 16px */
    padding: 0.75rem 1rem; /* 12px vertical -> ~44px with borders */
  }

  /* Vehicle info wrapper spacing */
  .contact-form-container .vehicle-info-section {
    padding: 0.75rem;
  }
  .contact-form-container .vehicle-info-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
}

/* Ensure vehicle inputs are two per row down to 360px */
@media (max-width: 480px) {
  .contact-form-container .vehicle-info-section .grid.md\:grid-cols-4,
  .contact-form-container .vehicle-info-section .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

@media (max-width: 360px) {
  .contact-form-container select.form-input {
    max-width: 16rem;
  }
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {
  .form-input {
    border-width: 3px;
    border-color: #000000;
  }

  .form-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 4px #ffff00;
  }

  .service-checkbox {
    border-width: 3px;
    border-color: #000000;
  }

  .service-checkbox:focus-within {
    box-shadow: 0 0 0 4px #ffff00;
  }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .form-input,
  .service-checkbox,
  .form-notification,
  .form-progress-bar {
    transition: none;
  }

  .form-group.error {
    animation: none;
  }

  .form-success:before {
    animation: none;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
  .form-input {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #f9fafb;
  }

  .form-input:focus {
    background-color: #1f2937;
    border-color: #dc2626;
  }

  .form-label {
    color: #f9fafb;
  }

  .field-help {
    color: #9ca3af;
  }

  .form-section-title {
    color: #f9fafb;
    border-color: #4b5563;
  }

  .service-checkbox {
    background-color: #1f2937;
    border-color: #4b5563;
  }

  .service-checkbox:hover {
    background-color: #374151;
  }

  .service-label {
    color: #f9fafb;
  }

  /* Dark mode vehicle autocomplete */
  .vehicle-info-section {
    background: linear-gradient(135deg, #1f2937, #111827);
    border-color: #4b5563;
  }

  .vehicle-info-section h4 {
    color: #f9fafb;
  }

  .autocomplete-dropdown {
    background-color: #1f2937;
    border-color: #4b5563;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .autocomplete-option {
    border-color: #374151;
    color: #f9fafb;
  }

  .autocomplete-option:hover,
  .autocomplete-option.active {
    background-color: #dc2626;
    color: white;
  }

  .autocomplete-loading {
    color: #9ca3af;
  }

  .autocomplete-no-results {
    color: #6b7280;
  }

  .vehicle-summary .bg-green-50 {
    background: linear-gradient(135deg, #064e3b, #065f46);
    border-color: #10b981;
  }

  .vehicle-summary .text-green-800 {
    color: #6ee7b7;
  }

  .vehicle-summary .text-green-700 {
    color: #a7f3d0;
  }

  .autocomplete-input:disabled,
  .autocomplete-input.disabled {
    background-color: #111827;
    border-color: #374151;
    color: #6b7280;
  }

  /* Dark mode contact type selector */
  .contact-type-section h3 {
    color: #f9fafb;
  }

  .contact-type-card {
    background-color: #1f2937;
    border-color: #4b5563;
  }

  .contact-type-option:hover .contact-type-card {
    border-color: #dc2626;
    background-color: #374151;
  }

  .contact-type-radio:checked + .contact-type-card {
    background: linear-gradient(135deg, #1f2937, #374151);
    border-color: #dc2626;
  }

  .contact-type-title {
    color: #f9fafb;
  }

  .contact-type-description {
    color: #9ca3af;
  }

  .contact-type-features li {
    color: #d1d5db;
  }
}

/* ========================================
   CONTACT FORM CONTAINER ENHANCEMENTS
   (merged from contact-form-fix.css)
   ======================================== */

/* Bridge: ensure both attribute values are supported */
.form-section[data-contact-type="quote-request"] { display: none; opacity: 0; transform: translateY(-10px); }
.form-section[data-contact-type="quote-request"].active { display: block; opacity: 1; transform: translateY(0); }

/* Contact Form Container Enhancement - Modern Card Design */
.contact-form-container {
  /* Enhanced card styling with depth and modern appearance */
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2rem; /* Add generous padding for content breathing room */

  /* Modern card styling */
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;

  /* Subtle texture and depth */
  position: relative;
  overflow: hidden;
}

/* Add a subtle top accent */
.contact-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc2626, #b91c1c, #991b1b);
  border-radius: 1.5rem 1.5rem 0 0;
  z-index: 1;
}

/* Add subtle inner shadow for depth */
.contact-form-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) inset;
  pointer-events: none;
  z-index: 0;
}

/* Ensure all content stays above the pseudo-elements */
.contact-form-container > * {
  position: relative;
  z-index: 2;
}

/* Enhanced hover effect for the entire form */
.contact-form-container:hover {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(220, 38, 38, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;

  transform: translateY(-1px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth transition when not hovering */
.contact-form-container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure the JavaScript can find and manipulate the form sections properly */
.contact-form-container [data-contact-type="request-quote"] {
  /* Ensure quote sections start properly hidden but preserve existing styling */
  transition: all 0.3s ease;
}

/* When JavaScript makes sections active, ensure they show properly */
.contact-form-container [data-contact-type="request-quote"].active {
  /* Force display when JavaScript activates the section */
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Ensure form layout works in grid containers (like on index page) */
.contact-form-container .grid {
  display: grid;
  gap: 1rem;
}

/* Responsive grid fixes for different page layouts */
@media (min-width: 768px) {
  .contact-form-container .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-form-container .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-form-container .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Ensure the form doesn't inherit unwanted styles from parent containers */
.contact-form-container * {
  box-sizing: border-box;
}

/* Preserve original contact type card functionality */
.contact-form-container .contact-type-option {
  position: relative;
  cursor: pointer;
  display: block;
}

.contact-form-container .contact-type-radio {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

/* Make sure radio button changes trigger properly */
.contact-form-container .contact-type-radio:checked + .contact-type-card {
  /* Ensure the checked state shows properly */
  border-color: #dc2626 !important;
  background: linear-gradient(135deg, #fef2f2, #ffffff) !important;
}

/* Enhanced styling for mobile devices */
@media (max-width: 768px) {
  .contact-form-container {
    border-radius: 1rem;
    margin: 0.5rem;
    padding: 1.5rem; /* Slightly less padding on mobile for better space usage */
  }

  .contact-form-container::before {
    border-radius: 1rem 1rem 0 0;
  }

  .contact-form-container::after {
    border-radius: 1rem;
  }
}

/* Even smaller screens need more compact padding */
@media (max-width: 480px) {
  .contact-form-container {
    padding: 1.25rem; /* More compact on very small screens */
    margin: 0.25rem;
  }
  /* Make selects (like Budget) visually smaller */
  .contact-form-container select.form-input {
    font-size: 0.8125rem; /* 13px */
    padding: 0.5rem 0.625rem;
    background-size: 0.875rem 0.875rem; /* smaller chevron */
    max-width: 18rem; /* Cap width so dropdown overlay isn't overly wide */
  }
  .contact-form-container select.form-input option {
    font-size: 0.8125rem; /* 13px—impacts dropdown menu where supported */
    line-height: 1.2;
    padding: 0.375rem 0.5rem; /* tighten option height where supported */
  }
}

/* Ultra-small phones: make it even more compact */
@media (max-width: 360px) {
  .contact-form-container select.form-input {
    font-size: 0.75rem; /* 12px */
    max-width: 16rem;
  }
  .contact-form-container select.form-input option {
    font-size: 0.75rem;
  }
}

/* Dark mode support for the enhanced card */
@media (prefers-color-scheme: dark) {
  .contact-form-container {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-color: #374151;
    box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.3),
      0 2px 4px -1px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  }

  .contact-form-container::after {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) inset;
  }

  .contact-form-container:hover {
    box-shadow:
      0 10px 15px -3px rgba(0, 0, 0, 0.4),
      0 4px 6px -2px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(220, 38, 38, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  }
}

/* ========================================
   MOBILE COMPACT SERVICES + QUOTE FIELDS
   ======================================== */
@media (max-width: 768px) {
  /* Services grid: smaller gap and labels */
  .contact-form-container .service-checkbox {
    padding: 0.5rem;
    border-width: 1px;
  }
  .contact-form-container .service-label {
    font-size: 0.8rem;
  }
  .contact-form-container .service-label i {
    width: 0.875rem;
    margin-right: 0.375rem;
  }
  .contact-form-container .grid.grid-cols-2,
  .contact-form-container .grid.md\:grid-cols-3 {
    gap: 0.5rem;
  }

  /* Quote-only section inputs */
  .contact-form-container .vehicle-info-section {
    padding: 0.75rem;
  }
  .contact-form-container .vehicle-info-section h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  /* Keep vehicle inputs two per row where possible */
  .contact-form-container .vehicle-info-section .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}