.wpcf7 form {
  display: grid;
  gap: 0.8rem;
}

.contact-form-card .wpcf7 form > div,
.contact-form-card .wpcf7 form > p {
  margin-bottom: 0;
}

.gr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.gr-form-field {
  display: grid;
  gap: 0.32rem;
  margin: 0;
  color: var(--glb-color-primary-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.gr-form-field > span:first-child {
  line-height: 1.35;
}

.gr-form-field--wide {
  grid-column: 1 / -1;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  border: 1px solid rgba(31, 36, 31, 0.2);
  border-radius: var(--glb-radius-sm);
  padding: 0.72rem 0.85rem;
  color: var(--glb-color-text);
  background: var(--glb-color-white);
  font: inherit;
  line-height: 1.45;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: var(--glb-color-primary);
  box-shadow: 0 0 0 3px rgba(47, 93, 58, 0.12);
}

.wpcf7 textarea {
  min-height: 145px;
  resize: vertical;
}

.gr-form-consent {
  color: var(--glb-color-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.gr-form-consent .wpcf7-list-item {
  margin: 0;
}

.gr-form-consent label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.gr-form-consent input[type="checkbox"] {
  width: 1.05rem;
  min-width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--glb-color-primary);
}

.gr-form-consent a {
  color: var(--glb-color-primary-dark);
  font-weight: 700;
}

.gr-form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.1rem;
}

.gr-form-actions p {
  margin: 0;
  color: var(--glb-color-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.wpcf7 input[type="submit"] {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.25rem;
  background: linear-gradient(180deg, #376d43 0%, var(--glb-color-primary-dark) 100%);
  color: var(--glb-color-white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.8rem 1.5rem rgba(24, 56, 35, 0.18);
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
  background: linear-gradient(180deg, var(--glb-color-primary) 0%, var(--glb-color-primary-dark) 100%);
}

.wpcf7-not-valid-tip {
  color: #b42318;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.wpcf7 form .wpcf7-response-output {
  margin: 1rem 0 0;
  border-radius: var(--glb-radius-sm);
  padding: 0.875rem 1rem;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
  border-color: #b42318;
  color: #7a271a;
}

.wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--glb-color-primary);
  color: var(--glb-color-primary-dark);
}

@media (max-width: 767px) {
  .gr-form-grid {
    grid-template-columns: 1fr;
  }

  .gr-form-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }
}

/* Contact page only: tolerate CF7's automatic paragraphs and legacy line breaks. */
.contact-page #kontaktformular .wpcf7 .gr-form-grid > p,
.contact-page #kontaktformular .wpcf7 .gr-form-field > p,
.contact-page #kontaktformular .wpcf7 .gr-form-actions > p,
.contact-page #kontaktformular .wpcf7 .gr-form-consent > p {
  margin: 0;
}

.contact-page #kontaktformular .wpcf7 .gr-form-field > br,
.contact-page #kontaktformular .wpcf7 .gr-form-grid > br,
.contact-page #kontaktformular .wpcf7 .gr-form-actions > br {
  display: none;
}

.contact-page #kontaktformular .wpcf7 .gr-form-field label {
  margin: 0;
}

.contact-page #kontaktformular .wpcf7 .gr-form-help {
  margin: 0;
  color: var(--glb-color-muted);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
}

.contact-page #kontaktformular .wpcf7 input:not([type="submit"]):not([type="hidden"]),
.contact-page #kontaktformular .wpcf7 select,
.contact-page #kontaktformular .wpcf7 textarea {
  min-width: 0;
  border-color: var(--glb-color-muted);
  font-size: 16px;
  font-weight: 400;
}

.contact-page #kontaktformular .wpcf7 input::placeholder,
.contact-page #kontaktformular .wpcf7 textarea::placeholder {
  color: var(--glb-color-muted);
  opacity: 1;
}

.contact-page #kontaktformular .wpcf7 input:not([type="submit"]):not([type="hidden"]):focus,
.contact-page #kontaktformular .wpcf7 select:focus,
.contact-page #kontaktformular .wpcf7 textarea:focus {
  border-color: var(--glb-color-primary-dark);
  color: var(--glb-color-text);
}

.contact-page #kontaktformular .wpcf7 input:focus-visible,
.contact-page #kontaktformular .wpcf7 select:focus-visible,
.contact-page #kontaktformular .wpcf7 textarea:focus-visible {
  outline: 3px solid var(--glb-color-primary-dark);
  outline-offset: 3px;
}
