.footer__newsletter .wpcf7 {
  width: 100%;
}

/* CF7 form itself should be block; row layout belongs only to inner wrapper */
.footer__newsletter .wpcf7 form.footer__newsletter-form {
  display: block;
  position: relative;
}

.footer__newsletter .wpcf7 form.footer__newsletter-form > .footer__newsletter-form {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* Variant A: class is on CF7 <form> */
.footer__newsletter .wpcf7 form.footer__newsletter-form p {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  align-items: flex-start;
  position: relative;
}

/* Variant B: class is on inner wrapper <div> */
.footer__newsletter .wpcf7 form .footer__newsletter-form p {
  display: flex;
  gap: 3px;
  width: 100%;
  margin: 0;
  align-items: flex-start;
  position: relative;
}

.footer__newsletter .wpcf7 .wpcf7-form-control-wrap {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  width: 100%;
}

.footer__newsletter .wpcf7 .footer__input {
  width: 100%;
}

.footer__newsletter .wpcf7 .footer__button {
  flex: 0 0 auto;
  width: auto;
  align-self: flex-start;
  height: 54px;
}

.footer__newsletter .wpcf7 .wpcf7-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 !important;
  z-index: 3;
  pointer-events: none;
  align-self: auto;
}

/* When spinner is rendered as direct form child (outside <p>) */
.footer__newsletter .wpcf7 form.footer__newsletter-form > .wpcf7-spinner {
  top: 27px;
  transform: translateY(-50%);
}

.footer__newsletter .wpcf7 .wpcf7-response-output {
  display: block;
  width: 100%;
  margin: 26px 0 0;
  padding: 14px 16px !important;
  border: 1px solid #dbe1ee !important;
  border-radius: 12px;
  background: #f7f8fb !important;
  box-shadow: none !important;
  min-height: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: #0f0f0f !important;
}

.footer__newsletter .wpcf7 form.sent .wpcf7-response-output {
  border-color: #b7e4c7 !important;
  background: #eefbf3 !important;
  color: #166534 !important;
}

.footer__newsletter .wpcf7 form.invalid .wpcf7-response-output,
.footer__newsletter .wpcf7 form.unaccepted .wpcf7-response-output,
.footer__newsletter .wpcf7 form.failed .wpcf7-response-output,
.footer__newsletter .wpcf7 form.aborted .wpcf7-response-output,
.footer__newsletter .wpcf7 form.spam .wpcf7-response-output {
  border-color: #ffd089 !important;
  background: #fff7e8 !important;
  color: #8a4b00 !important;
}

.footer__newsletter .wpcf7 .wpcf7-not-valid-tip {
  display: block;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  color: #c2410c;
}

@media (max-width: 600px) {
  .footer__newsletter .wpcf7 form.footer__newsletter-form p,
  .footer__newsletter .wpcf7 form .footer__newsletter-form p {
    flex-direction: column;
  }

  .footer__newsletter .wpcf7 .footer__button {
    width: 100%;
  }
}

/* About form (CF7) compatibility with theme layout */
.about-form .wpcf7 {
  width: 100%;
}

.about-form .wpcf7 form.about-form__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-form .wpcf7 form .about-form__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-form .wpcf7 form.about-form__form p {
  margin: 0;
}

.about-form .wpcf7 form .about-form__form p {
  margin: 0;
}

.about-form .wpcf7 form.about-form__form br {
  display: none;
}

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

.about-form .wpcf7 .about-form__form .about-form__input,
.about-form .wpcf7 .about-form__form .about-form__textarea {
  width: 100%;
  margin-bottom: 0 !important;
}

.about-form .wpcf7 .about-form__form .about-form__button {
  width: 100%;
  align-self: stretch;
}

.about-form .wpcf7 .about-form__form .wpcf7-form-control-wrap,
.contacts__form-wrapper .wpcf7 form.about-form__form .wpcf7-form-control-wrap {
  display: block;
  position: relative;
  margin-bottom: 25px;
}

.about-form .wpcf7 .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 .wpcf7-response-output {
  margin: 18px 0 0 !important;
  padding: 16px 18px !important;
  border-radius: 12px;
  border: 1px solid #dbe1ee !important;
  background: #f7f8fb;
  color: #0f0f0f !important;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  box-shadow: none;
}

.about-form .wpcf7 form.sent .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.sent .wpcf7-response-output {
  border-color: #b7e4c7 !important;
  background: #eefbf3;
  color: #166534 !important;
}

.about-form .wpcf7 form.invalid .wpcf7-response-output,
.about-form .wpcf7 form.unaccepted .wpcf7-response-output,
.about-form .wpcf7 form.failed .wpcf7-response-output,
.about-form .wpcf7 form.aborted .wpcf7-response-output,
.about-form .wpcf7 form.spam .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.invalid .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.unaccepted .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.failed .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.aborted .wpcf7-response-output,
.contacts__form-wrapper .wpcf7 form.spam .wpcf7-response-output {
  border-color: #ffd089 !important;
  background: #fff7e8;
  color: #8a4b00 !important;
}

.about-form .wpcf7 .wpcf7-not-valid-tip,
.contacts__form-wrapper .wpcf7 .wpcf7-not-valid-tip {
  display: block;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  color: #c2410c;
}

/* Robust vertical spacing regardless of CF7 wrapper structure */
.about-form .wpcf7 .about-form__form > * + * {
  margin-top: 8px;
}

.about-form .wpcf7 .about-form__form .wpcf7-form-control-wrap + .wpcf7-form-control-wrap,
.about-form .wpcf7 .about-form__form .wpcf7-form-control-wrap + .about-form__button,
.about-form .wpcf7 .about-form__form .about-form__textarea + .about-form__button {
  margin-top: 8px;
}

/* Contact page: render shared CF7 form with original contacts layout */
.contacts__form-wrapper .wpcf7 {
  width: 100%;
}

.contacts__form-wrapper .wpcf7 form.about-form__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contacts__form-wrapper .wpcf7 form.about-form__form p {
  margin: 0;
}

.contacts__form-wrapper .wpcf7 form.about-form__form br {
  display: none;
}

.contacts__form-wrapper .wpcf7 form.about-form__form .wpcf7-form-control-wrap {
  display: block;
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__input,
.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__textarea {
  width: 100%;
  margin-bottom: 0 !important;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 400;
  color: #0f0f0f;
  outline: none;
  transition: background .3s ease, box-shadow .3s ease;
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__input::placeholder,
.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__textarea::placeholder {
  color: rgba(15, 15, 15, 0.5);
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__input:focus,
.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__textarea:focus {
  background: #ebebeb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__textarea {
  resize: vertical;
  line-height: 1.6;
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__button {
  width: 100%;
  align-self: stretch;
  margin-top: 8px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background .3s ease, transform .2s ease;
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

.contacts__form-wrapper .wpcf7 form.about-form__form .about-form__button:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .contacts__form-wrapper .wpcf7 form.about-form__form .about-form__input,
  .contacts__form-wrapper .wpcf7 form.about-form__form .about-form__textarea {
    padding: 14px 16px;
    font-size: 14px;
  }

  .contacts__form-wrapper .wpcf7 form.about-form__form .about-form__button {
    padding: 14px 28px;
    font-size: 15px;
  }
}
