/* Contact Form 7 forms wrapped in <div class="agc-form"> (template: components/cf7/contacto.txt).
   Forms without that wrapper keep CF7's own look. */

.agc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

/* CF7 runs wpautop on the template: neutralise the <p>/<br> it may add */
.agc-form p {
  display: contents;
}

.agc-form br {
  display: none;
}

.agc-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.agc-form__field--full,
.agc-form__actions {
  grid-column: 1 / -1;
}

.agc-form label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #2E3E55;
}

.agc-form .wpcf7-form-control-wrap {
  display: block;
}

.agc-form .wpcf7-form-control:not(.wpcf7-submit) {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  background: #fff;
  border: 2px solid #E3EAF0;
  border-radius: 4px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #1F2D3D;
  transition: border-color .2s ease;
}

.agc-form textarea.wpcf7-form-control {
  min-height: 115px;
  resize: vertical;
}

.agc-form .wpcf7-form-control:not(.wpcf7-submit)::placeholder {
  color: #8592A3;
  opacity: 1;
}

.agc-form .wpcf7-form-control:not(.wpcf7-submit):focus {
  outline: none;
  border-color: #0B3A7E;
}

.agc-form .wpcf7-form-control.wpcf7-not-valid {
  border-color: #E11B1B;
}

.agc-form .wpcf7-not-valid-tip {
  margin-top: 4px;
  font-size: 12px;
  color: #E11B1B;
}

/* the spinner sits inside the button instead of pushing it */
.agc-form__actions {
  position: relative;
  margin-top: 6px;
}

.agc-form .wpcf7-submit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 4px;
  background-color: #E11B1B;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s ease;
}

.agc-form .wpcf7-submit:hover,
.agc-form .wpcf7-submit:focus-visible {
  background-color: #C21414;
}

.agc-form .wpcf7-submit:disabled {
  opacity: .7;
  cursor: default;
}

.agc-form .wpcf7-spinner {
  position: absolute;
  top: 50%;
  right: 12px;
  margin: -12px 0 0;
}

/* status message CF7 prints after the form */
.wpcf7 form:has(.agc-form) .wpcf7-response-output {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-width: 2px;
  border-radius: 6px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .agc-form {
    grid-template-columns: minmax(0, 1fr);
  }
}