/**
 * CF7 form UI fixes — small standalone sheet.
 * Loaded on every front page (including homepage home-bundle) so we do not
 * rewrite home-bundle.min.css for form-only fixes.
 */

/* CF7 CSS is async / missing on homepage: hide SR summary bullets at top of form. */
.wpcf7 .screen-reader-response {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wpcf7-form .wpcf7-not-valid-tip,
.wpcf7-form label .wpcf7-not-valid-tip,
.wpcf7-form .wpcf7-form-control-wrap .wpcf7-not-valid-tip {
  display: block !important;
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0;
  padding: 0;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #dc3545 !important;
  white-space: normal;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 2;
  height: auto !important;
  transform: none !important;
  overflow: visible !important;
}

.wpcf7-form label:has(.wpcf7-not-valid-tip),
.wpcf7-form .wpcf7-form-control-wrap:has(.wpcf7-not-valid-tip) {
  overflow: visible;
}

.wpcf7-form .wpcf7-not-valid,
.wpcf7-form input.wpcf7-not-valid,
.wpcf7-form textarea.wpcf7-not-valid,
.wpcf7-form select.wpcf7-not-valid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.18);
}

/*
 * Only when a tip is present: keep floating-label ::before on the control,
 * not stretched over the tip. Idle/focus float-up look is unchanged otherwise.
 */
.wpcf7-form span.wpcf7-form-control-wrap:has(.wpcf7-not-valid-tip)::before {
  height: 2.35rem;
  max-height: 2.35rem;
  align-items: flex-start;
}

.wpcf7-form .ss-form-guard-wrap {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}

.wpcf7-form .ss-form-guard-wrap .wpcf7-not-valid-tip {
  margin-top: 0.25rem;
  padding: 0.45rem 0.65rem;
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.35);
  border-radius: 0.375rem;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
  display: block;
  margin: 0.75rem 0 0.5rem;
  padding: 0.55rem 0.75rem;
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.wpcf7-form .ss-turnstile-after-submit {
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
  margin: 0.85rem 0 0;
  padding: 0;
  box-sizing: border-box;
}

/* Compact order modal only — page layout untouched. */
#modal-contact-form .modal-body {
  padding-top: 0.7rem;
  padding-bottom: 0.85rem;
}

#modal-contact-form .modal-body .mb-3 {
  margin-bottom: 0.45rem !important;
}

#modal-contact-form .modal-body .mb-4 {
  margin-bottom: 0.55rem !important;
}

#modal-contact-form .modal-body .mt-2 {
  margin-top: 0.35rem !important;
}

#modal-contact-form .wpcf7-form p {
  margin-bottom: 0.3rem;
}

#modal-contact-form .wpcf7-form .row {
  --bs-gutter-y: 0.35rem;
}

#modal-contact-form textarea.wpcf7-textarea[name="your-message"] {
  height: calc(3 * 1.5em + 0.75rem);
  min-height: calc(3 * 1.5em + 0.75rem);
  max-height: 70vh;
  resize: vertical;
  box-sizing: border-box;
}

#modal-contact-form .ss-turnstile-after-submit {
  margin-top: 0.55rem;
  margin-bottom: 0.15rem;
  min-height: 4.25rem;
  overflow: visible;
}
