/* Maps Contact Form 7's generic markup onto this project's real design tokens. */
.lwc-cf7-form {
  font-family: var(--font-sans);
  display: grid;
  /* Real multi-field contact/enquiry forms are virtually always laid out as
     a 2-column grid on desktop in the original design (name/email/phone
     side by side) — CF7's own generated markup carries none of the
     source's grid classes at all (bracket-tag syntax can't hold arbitrary
     Tailwind classes, see this file's own docstring above), so without an
     opinionated default every field fell back to a single stacked column
     regardless of the source layout. auto-fit/minmax collapses to one
     column on narrow forms on its own, so this is safe even for a
     genuinely single-column short form (e.g. just an email signup). */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.25rem;
}

.lwc-cf7-field {
  margin: 0;
}

/* A textarea (message/notes) or the final submit row reads oddly squeezed
   into one grid column next to a short text field — these always span the
   form's full width, matching the near-universal real-world pattern. */
.lwc-cf7-field:has(.lwc-textarea),
.lwc-cf7-form > p:last-child {
  grid-column: 1 / -1;
}

.lwc-cf7-field label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-foreground);
}

.lwc-input,
.lwc-textarea,
.lwc-select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-foreground);
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lwc-input:focus,
.lwc-textarea:focus,
.lwc-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.lwc-textarea {
  min-height: 8rem;
  resize: vertical;
}

.lwc-checkbox,
.lwc-radio {
  width: auto;
  margin-right: 0.5rem;
}

.wpcf7-form .wpcf7-submit {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-foreground);
  background-color: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.15s ease;
}

.wpcf7-form .wpcf7-submit:hover {
  opacity: 0.9;
}

.wpcf7-form .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wpcf7-form.invalid .wpcf7-response-output {
  border-color: #dc2626;
  color: #dc2626;
}

.wpcf7-form.sent .wpcf7-response-output {
  border-color: #16a34a;
  color: #16a34a;
}

.wpcf7-not-valid-tip {
  color: #dc2626;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}
