/* ─── Contact Form 7 — real forms in the two newsletter slots (the dark
   opt-in box and the footer). Targets CF7's own output classes so any form
   pasted into es_optin_shortcode / es_footer_form_shortcode inherits the
   design: pill inputs on a translucent dark fill, clay pill submit, inline
   validation tips, a quiet response box. CF7's own stylesheet is not loaded
   (functions.php). Suggested form markup: contact-form-newsletter.txt /
   contact-form-footer.txt in the theme root. ─────────────────────────── */

.wpcf7-form {
  position: relative;
}

fieldset.hidden-fields-container {
  display: none;
}

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

.wpcf7 p {
  margin-bottom: 14px;
}

.wpcf7 label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
}

.wpcf7-form-control-wrap input.wpcf7-form-control:not([type="checkbox"]),
textarea.wpcf7-form-control {
  width: 100%;
  margin-top: 7px;
  padding: 15px 20px;
  font-size: 16px;
  background: var(--on-dark-fill);
  border: 1.5px solid var(--on-dark-line);
  border-radius: var(--pill);
  color: var(--on-dark);

  &::placeholder {
    color: var(--on-dark-4);
  }

  &:focus {
    outline: none;
    border-color: var(--on-dark-accent);
  }

  &.wpcf7-not-valid {
    border-color: color-mix(in srgb, var(--negative-color) 60%, var(--white));
  }
}

textarea.wpcf7-form-control {
  border-radius: var(--r-md);
  min-height: 120px;
  resize: vertical;
}

/* Acceptance / checkbox fields → the design's consent row */
.wpcf7-acceptance .wpcf7-list-item,
.wpcf7-checkbox .wpcf7-list-item {
  display: block;
  margin: 0;

  & label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-weight: 400;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--on-dark-2);
    cursor: pointer;
  }

  & input {
    flex: none;
    width: 19px;
    height: 19px;
    margin-top: 2px;
    accent-color: var(--clay);
  }

  & a {
    color: var(--on-dark);
  }
}

input.wpcf7-submit.wpcf7-form-control {
  width: 100%;
  margin-top: 8px;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--pill);
  background: var(--clay);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-clay);
  transition: background-color 0.25s, transform 0.3s var(--ease);

  &:hover {
    background: var(--clay-d);
    transform: translateY(-2px);
  }

  &:disabled {
    opacity: 0.6;
    cursor: wait;
  }
}

.wpcf7-spinner {
  display: none;
}

.wpcf7-not-valid-tip {
  display: block;
  margin: 6px 0 0 18px;
  font-size: 0.82rem;
  font-weight: 400;
  color: color-mix(in srgb, var(--negative-color) 45%, var(--white));
}

.wpcf7-response-output {
  margin: 14px 0 0;
  padding: 13px 18px;
  border-radius: 18px;
  font-size: 0.88rem;
  border: 1px solid var(--on-dark-line);
  color: var(--on-dark);

  &:empty {
    display: none;
  }
}

form.sent .wpcf7-response-output {
  border-color: var(--sage);
  background: color-mix(in srgb, var(--sage) 20%, transparent);
}

form.failed .wpcf7-response-output,
form.aborted .wpcf7-response-output,
form.spam .wpcf7-response-output,
form.invalid .wpcf7-response-output,
form.unaccepted .wpcf7-response-output {
  border-color: color-mix(in srgb, var(--negative-color) 60%, var(--white));
  background: color-mix(in srgb, var(--negative-color) 14%, transparent);
}

/* Footer: email + round submit in one pill row when the form is laid out
   as [email] [submit] (see contact-form-footer.txt). */
.ftr-form__cf7 {
  margin-top: 14px;

  & .es-mini-row {
    display: flex;
    gap: 6px;
    padding: 5px;
    border-radius: var(--pill);
    background: var(--on-dark-fill);
    border: 1px solid var(--on-dark-line);

    & .wpcf7-form-control-wrap {
      flex: 1;
      min-width: 0;
    }

    & input.wpcf7-form-control:not([type="submit"]) {
      margin: 0;
      padding: 10px 14px;
      background: none;
      border: 0;
    }

    & input.wpcf7-submit.wpcf7-form-control {
      width: auto;
      margin: 0;
      padding: 10px 18px;
      box-shadow: none;
    }
  }

  & .wpcf7-acceptance .wpcf7-list-item label {
    font-size: 0.76rem;
    color: var(--on-dark-3);
  }
}
