/* Form spacing and layout polish
   Purpose: make the contact and listing forms look professionally spaced on desktop and mobile. */

html body .container.contact-grid {
  width: min(1280px, calc(100% - 56px)) !important;
  margin: 44px auto 78px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.62fr) !important;
  gap: 32px !important;
  align-items: start !important;
}

html body form.contact-card,
html body .contact-grid > .contact-card {
  padding: clamp(32px, 3.4vw, 48px) !important;
  border-radius: 28px !important;
  border: 1px solid #dbe4f0 !important;
  background: #ffffff !important;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden !important;
}

html body .contact-grid > aside.hero-card {
  padding: clamp(30px, 3vw, 42px) !important;
  border-radius: 28px !important;
  border: 1px solid #dbe4f0 !important;
  background: #ffffff !important;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.07) !important;
}

html body form.contact-card .eyebrow {
  margin: 0 0 22px !important;
  width: fit-content !important;
}

html body form.contact-card h1,
html body form.contact-card h2 {
  margin: 0 0 16px !important;
  color: #071a2f !important;
  font-size: clamp(34px, 3.8vw, 46px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.045em !important;
  max-width: 860px !important;
}

html body form.contact-card p,
html body form.contact-card .small {
  margin: 0 !important;
  max-width: 900px !important;
  color: #475569 !important;
  font-size: 17px !important;
  line-height: 1.75 !important;
}

html body form.contact-card .form-grid,
html body .contact-card .form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 22px 20px !important;
  margin-top: 34px !important;
}

html body form.contact-card .form-grid label,
html body .contact-card .form-grid label {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-width: 0 !important;
  color: #071a2f !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

html body form.contact-card input,
html body form.contact-card select,
html body form.contact-card textarea,
html body .contact-card input,
html body .contact-card select,
html body .contact-card textarea {
  display: block !important;
  width: 100% !important;
  min-height: 56px !important;
  padding: 15px 18px !important;
  border-radius: 16px !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02) !important;
  font: 600 16px/1.4 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  outline: none !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #0f172a !important;
}

html body form.contact-card textarea,
html body .contact-card textarea {
  min-height: 168px !important;
  resize: vertical !important;
  line-height: 1.55 !important;
}

html body form.contact-card input::placeholder,
html body form.contact-card textarea::placeholder,
html body .contact-card input::placeholder,
html body .contact-card textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #64748b !important;
}

html body form.contact-card input:focus,
html body form.contact-card select:focus,
html body form.contact-card textarea:focus,
html body .contact-card input:focus,
html body .contact-card select:focus,
html body .contact-card textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

html body form.contact-card input[type="hidden"],
html body .contact-card input[type="hidden"] {
  display: none !important;
}

html body form.contact-card .hero-cta,
html body .contact-card .hero-cta {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 14px !important;
  margin-top: 32px !important;
}

html body form.contact-card .hero-cta .btn,
html body .contact-card .hero-cta .btn,
html body form.contact-card button.btn,
html body .contact-card button.btn,
html body form.contact-card a.btn,
html body .contact-card a.btn {
  min-height: 52px !important;
  padding: 0 24px !important;
  border-radius: 14px !important;
  justify-content: center !important;
}

html body .contact-grid > aside.hero-card h2,
html body .contact-grid > aside.hero-card h3 {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  color: #071a2f !important;
  line-height: 1.22 !important;
}

html body .contact-grid > aside.hero-card p,
html body .contact-grid > aside.hero-card .muted {
  margin: 0 0 26px !important;
  color: #475569 !important;
  font-size: 17px !important;
  line-height: 1.7 !important;
}

html body .contact-grid > aside.hero-card .mini-metrics {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  margin-top: 24px !important;
}

html body .contact-grid > aside.hero-card .mini-metrics div {
  padding: 15px 16px !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html body .contact-grid > aside.hero-card .mini-metrics strong {
  color: #0f172a !important;
}

html body .contact-grid > aside.hero-card .mini-metrics span {
  color: #475569 !important;
}

@media (max-width: 980px) {
  html body .container.contact-grid {
    width: min(100% - 40px, 760px) !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    margin: 34px auto 64px !important;
  }

  html body form.contact-card,
  html body .contact-grid > .contact-card,
  html body .contact-grid > aside.hero-card {
    padding: 28px !important;
    border-radius: 24px !important;
  }

  html body form.contact-card .form-grid,
  html body .contact-card .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin-top: 28px !important;
  }
}

@media (max-width: 640px) {
  html body .container.contact-grid {
    width: calc(100% - 28px) !important;
    gap: 20px !important;
    margin: 26px auto 52px !important;
  }

  html body form.contact-card,
  html body .contact-grid > .contact-card,
  html body .contact-grid > aside.hero-card {
    padding: 22px !important;
    border-radius: 20px !important;
  }

  html body form.contact-card h1,
  html body form.contact-card h2 {
    font-size: 29px !important;
    line-height: 1.13 !important;
    letter-spacing: -0.035em !important;
  }

  html body form.contact-card p,
  html body form.contact-card .small,
  html body .contact-grid > aside.hero-card p,
  html body .contact-grid > aside.hero-card .muted {
    font-size: 15.5px !important;
    line-height: 1.65 !important;
  }

  html body form.contact-card .form-grid,
  html body .contact-card .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-top: 24px !important;
  }

  html body form.contact-card .form-grid label[style],
  html body .contact-card .form-grid label[style] {
    grid-column: auto !important;
  }

  html body form.contact-card input,
  html body form.contact-card select,
  html body form.contact-card textarea,
  html body .contact-card input,
  html body .contact-card select,
  html body .contact-card textarea {
    min-height: 52px !important;
    padding: 14px 15px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  html body form.contact-card textarea,
  html body .contact-card textarea {
    min-height: 150px !important;
  }

  html body form.contact-card .hero-cta,
  html body .contact-card .hero-cta {
    gap: 12px !important;
    margin-top: 26px !important;
  }

  html body form.contact-card .hero-cta .btn,
  html body .contact-card .hero-cta .btn,
  html body form.contact-card button.btn,
  html body .contact-card button.btn,
  html body form.contact-card a.btn,
  html body .contact-card a.btn {
    width: 100% !important;
    min-height: 50px !important;
  }
}
