.mfod-modal[hidden] { display: none; }
.mfod-modal .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.mfod-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    font-family: inherit;
}
.mfod-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .58); backdrop-filter: blur(3px); }
.mfod-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(240px, .9fr) minmax(320px, 1.1fr);
    grid-template-rows: minmax(0, 1fr);
    width: min(860px, 100%);
    /* margin: auto keeps the card centred but still lets the container scroll when it is taller than the viewport. */
    margin: auto;
    min-height: 480px;
    min-height: min(480px, calc(100vh - 40px));
    min-height: min(480px, calc(100dvh - 40px));
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}
.mfod-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(25, 25, 25, .55);
    border-radius: 50%;
    background: rgba(255, 255, 255, .86);
    color: #151515;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.mfod-close:hover, .mfod-close:focus-visible { background: #151515; color: #fff; }
.mfod-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 320px;
    overflow: hidden;
    background: #8d8177 url("modal-visual.jpg") center 38% / cover no-repeat;
    color: #fff;
}
.mfod-visual::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 15, 12, .42) 0%, rgba(20, 15, 12, .58) 100%);
    content: '';
}
.mfod-visual-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .15em;
    text-shadow: 0 1px 14px rgba(0, 0, 0, .45);
}
.mfod-visual-copy span { font-size: 12px; }
.mfod-visual-copy strong { font-family: Georgia, serif; font-size: clamp(76px, 10vw, 128px); font-weight: 400; line-height: .9; letter-spacing: -.06em; }
.mfod-visual-copy em { font-size: 13px; font-style: normal; letter-spacing: .19em; }

.mfod-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: clamp(36px, 6vw, 72px) clamp(28px, 6vw, 64px);
    overflow-y: auto;
}
.mfod-content h2 { margin: 0 0 24px; color: #111; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(34px, 4vw, 48px); font-weight: 400; line-height: .98; letter-spacing: -.04em; }
.mfod-content > #mfod-desc { max-width: 350px; margin: 0 0 28px; color: #595959; font-size: 13px; line-height: 1.55; }
.mfod-content form { display: grid; gap: 10px; }
.mfod-content input {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid #b9b9b9;
    border-radius: 0;
    background: #fff;
    color: #111;
    font: inherit;
}
.mfod-content input:focus { border-color: #111; outline: 2px solid rgba(17, 17, 17, .15); outline-offset: 1px; }
.mfod-content button[type="submit"] {
    min-height: 46px;
    border: 0;
    border-radius: 0;
    background: #050505;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, opacity .2s ease;
}
.mfod-content button[type="submit"]:hover, .mfod-content button[type="submit"]:focus-visible { background: #333; }
.mfod-content button[type="submit"]:disabled { cursor: wait; opacity: .62; }

.mfod-content input[readonly] { background: #f5f2ee; color: #5a5a5a; cursor: default; }
.mfod-content .mfod-actions { margin: 0 0 10px; }
.mfod-content .mfod-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    background: #050505;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}
.mfod-content .mfod-cta:hover, .mfod-content .mfod-cta:focus-visible { background: #333; color: #fff; }

.mfod-email-sent {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 0;
    padding: 0 18px;
    background: #050505;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1.45;
    text-align: center;
    text-transform: uppercase;
}

.mfod-message { min-height: 19px; margin: 12px 0 0; font-size: 13px; line-height: 1.5; }
.mfod-message:empty { margin: 0; min-height: 0; }
.mfod-message.is-success { color: #176b3a; }
.mfod-message.is-error { color: #a33131; }
.mfod-message.is-loading { color: #666; }

/* [hidden] must be re-stated because the form rule above sets display:grid. */
.mfod-content form[hidden] { display: none; }

.mfod-content small { display: block; max-width: 360px; margin-top: 14px; color: #6b6b6b; font-size: 11px; line-height: 1.5; }
html.mfod-open, html.mfod-open body { overflow: hidden; }

/* Corner launcher: the collapsed state of the popup, shown while the account is still eligible. */
.mfod-launcher {
    position: fixed;
    right: 24px;
    /* Sits above the theme's #to-top button (right:2px / bottom:2px / 50x50). */
    bottom: 68px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.mfod-launcher[hidden] { display: none; }
.mfod-launcher:hover, .mfod-launcher:focus-visible { background: #333; transform: translateY(-1px); }
.mfod-launcher-badge {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

@media (max-width: 640px) {
    .mfod-modal { padding: 10px; }
    .mfod-card {
        display: block;
        min-height: min(480px, calc(100vh - 20px));
        min-height: min(480px, calc(100dvh - 20px));
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        overflow: auto;
    }
    .mfod-content { overflow: visible; padding: 32px 24px 36px; }
    .mfod-visual { min-height: 190px; }
    .mfod-visual-copy strong { font-size: 74px; }
    .mfod-content h2 { margin-bottom: 18px; font-size: 36px; }
    /* Theme lifts #to-top to bottom:45px on mobile, so clear that too. */
    .mfod-launcher { right: 12px; bottom: 110px; padding: 7px 14px 7px 7px; font-size: 10px; letter-spacing: .1em; }
    .mfod-launcher-badge { width: 34px; height: 34px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .mfod-content button[type="submit"] { transition: none; }
}
