/* ==========================================================
   COMPACT CONTACT FORM 7 LAYOUT (SHORTER FORM)
   Works with your .cf7-row / .cf7-row-2 structure
   ========================================================== */

/* --- Overall spacing reset --- */
.wpcf7-form p {
  margin: 0 0 8px !important;
  padding: 0 !important;
}

.wpcf7-form label {
  display: block !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
}

/* Remove extra line-break spacing inside labels */
.wpcf7-form br {
  display: none !important;
}

/* --- Headings: make them compact --- */
.wpcf7-form h2 {
  margin: 16px 0 10px !important;
  padding: 0 !important;
}

.wpcf7-form h3 {
  margin: 12px 0 8px !important;
  padding: 0 !important;
}

/* --- Two-column grid rows (your existing structure) --- */
.cf7-row {
  display: grid !important;
  gap: 12px !important;            /* reduce space between columns */
  margin: 0 0 8px !important;      /* reduce space between rows */
  align-items: start !important;
}

.cf7-row-2 {
  grid-template-columns: 1fr 1fr !important;
}

/* Make grid children not add extra vertical spacing */
.cf7-row > p,
.cf7-row > fieldset {
  margin: 0 !important;
  padding: 0 !important;
}

/* Mobile: stack columns */
@media (max-width: 768px) {
  .cf7-row-2 {
    grid-template-columns: 1fr !important;
  }
}

/* --- Uniform input/select sizing for perfect alignment --- */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="date"],
.wpcf7-form select {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  line-height: 44px !important;
  margin: 0 !important;
}

/* Slightly reduce space around textarea */
.wpcf7-form textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  margin: 0 !important;
}

/* --- Fieldset (radios/checkbox groups) spacing --- */
.cf7-fieldset {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 8px !important;
}

.cf7-fieldset legend {
  font-weight: 600 !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
}

/* Make radio/checkbox groups tighter */
.wpcf7-form .wpcf7-radio,
.wpcf7-form .wpcf7-checkbox {
  display: flex !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  margin-top: 6px !important;
  margin-bottom: 0 !important;
}

.wpcf7-form .wpcf7-list-item {
  margin: 0 !important;
  padding: 0 !important;
}

/* --- Special Provision acceptance alignment (compact) --- */
.cf7-special-provision .wpcf7-acceptance label {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cf7-special-provision .wpcf7-acceptance label input[type="checkbox"] {
  margin-top: 4px !important;
}

/* --- Submit button spacing --- */
.wpcf7-form .wpcf7-submit {
  margin-top: 12px !important;
  padding: 12px 20px !important;
}
/* Make the form container look like a proper card */
.wpcf7 {
  background: #fff;
  padding: 32px 28px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
  .wpcf7 {
    padding: 22px 16px;
  }
}
.wpcf7-form h2,
.wpcf7-form h3 {
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.cf7-row{align-items:flex-end!important;}
.cf7-row fieldset.cf7-fieldset{margin-top:0!important;}
.cf7-fieldset legend{display:block!important;margin:0 0 6px!important;padding:0!important;line-height:1.2!important;}
.cf7-row>p>label{margin-bottom:6px!important;line-height:1.2!important;}
/* ===== MOBILE FIX: prevent inputs from overflowing the form card ===== */
.wpcf7,
.wpcf7-form,
.wpcf7 form {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Force all CF7 form controls to never exceed container width */
.wpcf7-form-control-wrap,
.wpcf7-form-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* All fields: hard clamp width */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="date"],
.wpcf7-form select,
.wpcf7-form textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Mobile-specific tightening */
@media (max-width: 768px) {
  /* Ensure the white container never overflows */
  .wpcf7 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Remove any accidental left/right padding causing overflow */
  .wpcf7-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Force grid rows to become single column cleanly */
  .cf7-row,
  .cf7-row-2 {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 768px) {
  .wpcf7 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
.wpcf7-form-control-wrap {
  display: block !important;
}
