/* The site's subscribe forms on Mega Forms (the footer form and the subscribe popup), given the
   look the Gravity forms had. Both forms carry the CSS class kbd-subscribe-form (Mega Forms >
   form > Settings > CSS class, set by tasks/forms/data/forms.json). Loaded by
   includes/class-forms.php after Mega Forms' own stylesheet. */

.kbd-subscribe-form {
    --kbd-form-text: #383835;
    --kbd-form-line: #A2A2A2;
    --kbd-form-button: #333333;
    --kbd-form-button-hover: #565D45;
    --kbd-form-error: #C02B0A;
    color: var(--kbd-form-text);
}

/* Fields: one column, 10 px apart, no list markers or Mega Forms spacing. */
.kbd-subscribe-form .mform_fields,
.kbd-subscribe-form .mf_col {
    margin: 0;
    padding: 0;
    list-style: none;
}
.kbd-subscribe-form .mf_col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kbd-subscribe-form .mfield {
    margin: 0;
    padding: 0;
}
.kbd-subscribe-form .mf_field_container,
.kbd-subscribe-form .mf_input_container {
    margin: 0;
    padding: 0;
}

/* "Stay Connected." and its line, and the same heading in the thank-you message. */
.kbd-subscribe-form .mf_input_html h3,
.kbd-subscribe-form .mform_success_msg h3 {
    margin: 0 0 10px;
    font-family: "gravita-geo-variable";
    font-size: 3.1vw;
    font-weight: 300;
    line-height: 1.1em;
    letter-spacing: -2.4px;
    word-spacing: 0;
    text-transform: capitalize;
    color: var(--e-global-color-primary);
}
.kbd-subscribe-form .mform_success_msg h3 {
    margin-bottom: -15px;
}
@media (max-width: 544px) {
    .kbd-subscribe-form .mf_input_html h3,
    .kbd-subscribe-form .mform_success_msg h3 {
        font-size: 50px;
    }
}
.kbd-subscribe-form .mf_input_html p,
.kbd-subscribe-form .mform_success_msg p {
    margin: 0;
    color: var(--e-global-color-primary);
}

/* Name and email: full width, outlined, transparent. */
.kbd-subscribe-form .mf_sub_field.mf_half {
    display: block;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
}
.kbd-subscribe-form input[type="text"],
.kbd-subscribe-form input[type="email"] {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    height: auto;
    margin: 0;
    padding: .75em;
    border: 1px solid var(--kbd-form-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.4;
    color: var(--kbd-form-text);
    transition: all .2s linear;
}
.kbd-subscribe-form input[type="text"]::placeholder,
.kbd-subscribe-form input[type="email"]::placeholder {
    color: var(--kbd-form-text);
    opacity: 1;
}
.kbd-subscribe-form input:-webkit-autofill,
.kbd-subscribe-form input:-webkit-autofill:hover,
.kbd-subscribe-form input:-webkit-autofill:focus {
    transition: background-color 5000s ease-in-out 0s;
}

/* A field's error sits under it in small red text; the field keeps its outline. */
.kbd-subscribe-form .mf_input_error input,
.kbd-subscribe-form .mf_sub_input_error input {
    border-color: var(--kbd-form-line);
}
.kbd-subscribe-form .mf_notice,
.kbd-subscribe-form .mf_compound_notice {
    position: static;
    display: block;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    line-height: 1.43;
    color: var(--kbd-form-error);
}

/* Messages above the form: hidden while a field shows its own error (as the Gravity forms hid
   their summary), shown for a request that failed or a submission the form refused. */
.kbd-subscribe-form .mform_response_msg {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: none;
}
.kbd-subscribe-form .mform_response_msg .mform_error_msg {
    display: block;
    /* Mega Forms sets this margin with !important. */
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    line-height: 1.43;
    color: var(--kbd-form-error);
}
.kbd-subscribe-form form:has(.mf_input_error, .mf_compound_error) .mform_header {
    display: none;
}
.kbd-subscribe-form .mform_response_msg:has(.mform_success_msg) {
    margin: 0;
}
.kbd-subscribe-form .mform_response_msg .mform_success_msg {
    display: block;
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: none;
    color: var(--kbd-form-text);
}
/* Gravity turned the line break between the heading and the text into a blank line. */
.kbd-subscribe-form .mform_success_msg p {
    margin-top: 1lh;
}

/* The button: dark, square, uppercase. The child theme gives every "form .button" a 10 px top
   margin and, with !important, its own padding, spacing and text colour, so these must be too. */
.kbd-subscribe-form .mform_footer {
    margin: 20px 0 0;
    padding: 0;
}
.kbd-subscribe-form .mform_footer .mf-submit-btn {
    width: auto;
    height: auto;
    padding: 15px 40px !important;
    border: 1px solid var(--kbd-form-button);
    border-radius: 0;
    background-color: var(--kbd-form-button);
    box-shadow: none;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 1px !important;
    text-transform: uppercase;
    color: #fff !important;
}
.kbd-subscribe-form .mform_footer .mf-btn-txt {
    padding: 0;
}
.kbd-subscribe-form .mform_footer .mf-submit-btn:hover,
.kbd-subscribe-form .mform_footer .mf-submit-btn:focus-visible {
    background-color: var(--kbd-form-button-hover);
}
