/**
 * Know More Tears forms (Become an Angel, Get in Touch, newsletter).
 *
 * Per the brand guide's Forms pattern, and matching the green Register button
 * on the event forms. Labels inherit the surrounding text colour so the same
 * form reads on the white pages and on the dark site footer.
 */
.kmt-form-wrap {
    --kmt-form-cta: #32b444;
    --kmt-form-cta-hover: #2a9a3a;
    --kmt-form-border: #e5e5e5;
    --kmt-form-focus: #2da3f2;
    --kmt-form-error: #d63638;
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
}

.kmt-form__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.kmt-form__field {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.kmt-form__field--half {
    flex: 1 1 calc(50% - 8px);
}

@media (max-width: 480px) {
    .kmt-form__field--half {
        flex-basis: 100%;
    }
}

.kmt-form__label {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    color: inherit;
}

.kmt-form__required {
    color: var(--kmt-form-error);
}

.kmt-form input[type="text"],
.kmt-form input[type="email"],
.kmt-form input[type="tel"],
.kmt-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--kmt-form-border);
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kmt-form textarea {
    min-height: 120px;
    resize: vertical;
}

.kmt-form input:focus,
.kmt-form textarea:focus {
    outline: none;
    border-color: var(--kmt-form-focus);
    box-shadow: 0 0 0 1px var(--kmt-form-focus), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.kmt-form__choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}

.kmt-form__choice input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--kmt-form-cta);
}

/* The angel sign-up page (/be-an-angel/): its title and the intro above the
 * form are centred. Keyed to the form rather than a page ID, which differs
 * between staging and production. */
article:has(.kmt-form-wrap--angel_signup) .entry-title,
.entry-content:has(> .kmt-form-wrap--angel_signup) > p:first-child {
    text-align: center;
}

/* The intro as wide as the form under it, with room before the first field
 * (Divi zeroes the padding under a page's last paragraph). */
.entry-content:has(> .kmt-form-wrap--angel_signup) > p:first-child {
    max-width: 640px;
    margin: 0 auto 32px;
}

/* A form with an aside (the angel sign-up): register on the left, give on
 * the right in a tinted panel, stacked on narrow screens. */
.kmt-form-wrap--split {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 48px;
    align-items: start;
    max-width: 1080px;
    /* Room before the footer, which Divi butts against the page's last line. */
    padding-bottom: 48px;
}

.kmt-form-split__title {
    margin: 0 0 24px;
    padding: 0;
    color: #2f3193;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
}

.kmt-form-split__aside {
    padding: 40px 32px;
    border-radius: 12px;
    background: #f5f5f5;
    text-align: center;
}

.kmt-form-split__aside p {
    margin: 0 0 24px;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
}

.kmt-form-split__aside p:last-child {
    margin-bottom: 0;
}

.kmt-form-split__note {
    font-size: 14px !important;
    color: #555;
}

@media (max-width: 980px) {
    .kmt-form-wrap--split {
        grid-template-columns: minmax(0, 1fr);
        max-width: 640px;
    }
}

/* Under "Make a monetary donation": reopens the GiveButter modal. */
.kmt-form__gb-note {
    margin: 4px 0 0 28px;
    font-size: 14px;
    line-height: 1.5;
}

.kmt-form__gb-note a {
    font-weight: 600;
    text-decoration: underline;
}

.kmt-form__choice input:focus-visible {
    outline: 2px solid var(--kmt-form-focus);
    outline-offset: 2px;
}

.kmt-form__field--invalid input[type="text"],
.kmt-form__field--invalid input[type="email"],
.kmt-form__field--invalid input[type="tel"],
.kmt-form__field--invalid textarea {
    border-color: var(--kmt-form-error);
}

.kmt-form__field-error {
    margin: 6px 0 0;
    padding: 0;
    color: var(--kmt-form-error);
    font-size: 14px;
}

.kmt-form__error {
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fcf0f1;
    color: var(--kmt-form-error);
    font-size: 15px;
}

.kmt-form__submit,
.kmt-form__donate {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    border: 1px solid var(--kmt-form-cta);
    border-radius: 8px;
    background: var(--kmt-form-cta);
    color: #fff;
    font-family: Poppins, "Helvetica Neue", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.kmt-form__submit:hover,
.kmt-form__submit:focus-visible,
.kmt-form__donate:hover,
.kmt-form__donate:focus-visible {
    background: var(--kmt-form-cta-hover);
    border-color: var(--kmt-form-cta-hover);
    color: #fff;
}

/* The aside's Donate Now: the form's green CTA, as a link. */
.kmt-form__donate {
    margin-top: 0;
    font-size: 16px;
    text-decoration: none;
}

.kmt-form__submit:focus-visible,
.kmt-form__donate:focus-visible {
    outline: 2px solid var(--kmt-form-focus);
    outline-offset: 2px;
}

.kmt-form__submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.kmt-form__success {
    padding: 16px 20px;
    border-radius: 8px;
    background: #edf8ef;
    color: #1a4d23;
    font-size: 16px;
}

.kmt-form__success:focus {
    outline: none;
}

.kmt-form__success p:last-child,
.kmt-form__after p:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.kmt-form__after {
    margin-top: 20px;
    font-size: 15px;
}

/* The honeypot: off-screen rather than display:none, which some bots skip. */
.kmt-form__hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Footer newsletter: centred under its heading, as the old form was. */
.kmt-form-wrap--newsletter {
    max-width: 520px;
}

.kmt-form-wrap--newsletter .kmt-form {
    text-align: center;
}

.kmt-form-wrap--newsletter .kmt-form__field {
    text-align: left;
}

/* "Loading the donation form..." under GiveButter's spinner, which is centred
 * on screen in their modal. A popover, so it can sit above that modal. */
.kmt-gb-loading[popover] {
    position: fixed;
    inset: auto;
    top: calc(50% + 40px);
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #FFFFFF;
    font-family: var(--font-body, 'Open Sans', sans-serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}
