/* Shared funnel footer bar + Terms / Privacy modals */

/* Match sibling content wrappers: plf-wrap 980px, pco-wrap/pl-wrap/premium 960px, store 1120px */
body.pay-landing-body,
body.pay-funnel-body {
    --funnel-layout-max: 980px;
    --funnel-layout-pad-x: 20px;
}

body.pay-landing-body:has(.pco-wrap),
body.pay-funnel-body:has(.pco-wrap),
body.pay-landing-body:has(.pl-wrap),
body.pay-funnel-body:has(.pl-wrap),
body.pay-landing-body:has(.pay-premium-landing),
body.pay-funnel-body:has(.pay-premium-landing) {
    --funnel-layout-max: 960px;
}

body.store-funnel-body {
    --funnel-layout-max: 1120px;
    --funnel-layout-pad-x: 20px;
}

@media (max-width: 760px) {
    body.pay-landing-body:has(.pco-wrap),
    body.pay-funnel-body:has(.pco-wrap),
    body.pay-landing-body:has(.pl-wrap),
    body.pay-funnel-body:has(.pl-wrap) {
        --funnel-layout-pad-x: 16px;
    }
}

@media (max-width: 480px) {
    body.pay-landing-body:has(.plf-wrap),
    body.pay-funnel-body:has(.plf-wrap) {
        --funnel-layout-pad-x: 12px;
    }

    body.pay-landing-body:has(.pco-wrap),
    body.pay-funnel-body:has(.pco-wrap) {
        --funnel-layout-pad-x: 12px;
    }

    body.pay-landing-body:has(.pl-wrap),
    body.pay-funnel-body:has(.pl-wrap) {
        --funnel-layout-pad-x: 12px;
    }

    body.store-funnel-body {
        --funnel-layout-pad-x: 12px;
    }
}

.funnel-profile-slot--pre-footer {
    width: 100%;
    max-width: var(--funnel-layout-max, 980px);
    margin: 0 auto;
    padding: 0 var(--funnel-layout-pad-x, 20px) 8px;
    box-sizing: border-box;
    flex-shrink: 0;
}

body.pay-landing-body:has(.pl-wrap) .funnel-profile-slot--pre-footer {
    max-width: 980px;
}

body.pay-landing-body:has(.pl-wrap) .funnel-profile-slot--pre-footer,
body.pay-landing-body:has(.pl-wrap--split-scroll) .funnel-profile-slot--pre-footer {
    max-width: 980px;
}

body.pay-landing-body:has(.pay-premium-landing) .funnel-profile-slot--pre-footer {
    max-width: 960px;
}

body.pay-landing-body .funnel-page-shell--personal .funnel-profile-slot--pre-footer,
body.pay-funnel-body .funnel-page-shell--personal .funnel-profile-slot--pre-footer {
    max-width: 960px;
}

/* Footer follows natural document scroll on all funnel pages */
body.pay-landing-body:has(.funnel-legal-footer),
body.pay-funnel-body:has(.funnel-legal-footer),
body.store-funnel-body:has(.funnel-legal-footer) {
    min-height: 100dvh;
}

.funnel-legal-footer,
.funnel-site-footer.funnel-legal-footer,
.pl-footer.funnel-legal-footer,
.pco-footer.funnel-legal-footer,
.sh-footer.funnel-legal-footer {
    text-align: left;
    padding: 0;
    font-size: 12px;
    color: #64748b;
    border-top: none;
    background: transparent;
    margin-top: 32px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
}

.funnel-legal-footer__inner {
    width: 100%;
    max-width: var(--funnel-layout-max, 980px);
    margin: 0 auto;
    padding: 16px var(--funnel-layout-pad-x, 20px);
    box-sizing: border-box;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.funnel-legal-footer__copy {
    margin: 0;
    line-height: 1.55;
    color: #64748b;
}

.funnel-legal-footer__copy a {
    color: #1a3c6e;
    font-weight: 600;
    text-decoration: none;
}

.funnel-legal-footer__copy a:hover {
    text-decoration: underline;
}

.funnel-legal-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.funnel-legal-footer__nav a,
.funnel-legal-footer__link-btn {
    color: #1a3c6e;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
}

.funnel-legal-footer__nav a:hover,
.funnel-legal-footer__link-btn:hover {
    text-decoration: underline;
}

.funnel-legal-footer__sep {
    color: #cbd5e1;
    font-weight: 400;
    user-select: none;
}

@media (max-width: 760px) {
    .funnel-legal-footer__inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }

    .funnel-legal-footer__copy {
        text-align: center;
    }

    .funnel-legal-footer__nav {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Legal modal */
body.funnel-legal-open {
    overflow: hidden;
}

.funnel-legal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.funnel-legal-overlay[hidden] {
    display: none !important;
}

.funnel-legal-dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: min(85vh, 720px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.funnel-legal-dialog__close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.funnel-legal-dialog__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.funnel-legal-dialog__title {
    margin: 0;
    padding: 20px 52px 12px 22px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.funnel-legal-dialog__body {
    padding: 16px 22px 24px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.65;
    color: #334155;
}

.funnel-legal-dialog__body h3 {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.funnel-legal-dialog__body h3:first-of-type {
    margin-top: 8px;
}

.funnel-legal-dialog__body p {
    margin: 0 0 10px;
}

.funnel-legal-dialog__body ul {
    margin: 0 0 12px;
    padding-left: 1.25rem;
}

.funnel-legal-dialog__body li {
    margin-bottom: 6px;
}

.funnel-legal-dialog__body a {
    color: #1a3c6e;
    font-weight: 600;
}

.funnel-legal-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 14px !important;
}

@media (max-width: 480px) {
    .funnel-legal-overlay {
        padding: 12px;
    }

    .funnel-legal-dialog {
        max-height: 92vh;
        border-radius: 14px;
    }

    .funnel-legal-dialog__title {
        font-size: 1.05rem;
        padding-left: 16px;
    }

    .funnel-legal-dialog__body {
        padding: 14px 16px 20px;
    }
}
