/* Prevent background scrolling */
body.stampli-popup-open {
    overflow: hidden;
}

/* Overlay */
.stampli-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 31, 57, 0.65);
    overflow-y: auto;
}

.stampli-popup-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.stampli-popup-overlay.stampli-popup-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Dialog */
.stampli-popup-dialog {
    position: relative;
    width: 100%;
    max-width: var(--stampli-popup-width, 700px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 48px;
    overflow-y: auto;
    border-radius: 24px;
    background: #fff;
    color: #1e3c74;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Close button */
.stampli-popup-close {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1e3c74;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.stampli-popup-close:hover {
    opacity: 0.65;
}

.stampli-popup-close:focus-visible {
    outline: 2px solid #1e3c74;
    outline-offset: 3px;
}

/* Content */
.stampli-popup-heading {
    margin: 0 0 16px;
    color: #1e3c74;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
}

.stampli-popup-description {
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.6;
}

.stampli-popup-description p:last-child,
.stampli-popup-legal p:last-child {
    margin-bottom: 0;
}

/* HubSpot form */
.stampli-popup-form {
    min-height: 100px;
    transition: opacity 0.2s ease;
}


.stampli-popup-form iframe {
    max-width: 100%;
}

/* Legal copy */
.stampli-popup-legal {
    margin-top: 24px;
    font-size: 12px;
    line-height: 1.6;
    color: #63748c;
}

.stampli-popup-legal a {
    text-decoration: underline;
}

/* Custom confirmation after a successful HubSpot submission */
.stampli-popup-submitted .stampli-popup-form {
    min-height: 0;
}
.stampli-popup-submitted .stampli-popup-form p:last-child {
    margin-bottom: 0;
}

/* Stable loading area while HubSpot initializes. */
.stampli-popup-overlay.stampli-popup-loading .stampli-popup-form {
    min-height: 320px;
}

.stampli-popup-loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    color: #63748c;
    font-size: 15px;
    text-align: center;
}

/* Initial AJAX loading shell uses the same dialog proportions. */
.stampli-popup-overlay.stampli-popup-loading > .stampli-popup-dialog {
    min-height: 320px;
}

/* Conditional HubSpot Meetings modal */
.stampli-popup-meetings {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.stampli-popup-meetings__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 31, 57, 0.65);
}
.stampli-popup-meetings__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 900px);
    max-height: calc(100dvh - 48px);
    padding: 48px 24px 24px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.2);
    overflow: auto;
    outline: none;
}
.stampli-popup-meetings__close {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 2;
    border: 0;
    background: transparent;
    color: #1e3c74;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
.stampli-popup-meetings__close:focus-visible {
    outline: 2px solid #1e3c74;
    outline-offset: 3px;
}
.stampli-popup-meetings__embed {
    height: min(650px, calc(100dvh - 140px));
    min-height: 300px;
}
.stampli-popup-meetings__embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}


.stampli-popup-submitted .stampli-popup-description,
.stampli-popup-submitted .stampli-popup-legal {
	display: none;
}

/* Mobile */
@media (max-width: 767px) {
    .stampli-popup-overlay {
        padding: 16px;
    }

    .stampli-popup-dialog {
        max-height: calc(100dvh - 32px);
        padding: 48px 24px 32px;
        border-radius: 16px;
    }

    .stampli-popup-heading {
        font-size: 26px;
    }

    .stampli-popup-close {
        top: 12px;
        right: 12px;
    }
	
    /* Full-screen Meetings iframe avoids nested mobile scrolling. */
    .stampli-popup-meetings {
        padding: 0;
        align-items: stretch;
    }

    .stampli-popup-meetings__dialog {
        width: 100%;
        height: 100dvh;
        max-height: none;
        padding: 48px 0 0;
        border-radius: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .stampli-popup-meetings__embed {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    .stampli-popup-meetings__embed iframe {
        width: 100%;
        height: 100%;
        display: block;
    }
	
}

@media (prefers-reduced-motion: reduce) {
    .stampli-popup-overlay {
        transition: none;
    }
}


/* Keep keyboard focus visible on the scheduler container. */
.stampli-popup-meetings__dialog:focus-visible {
    outline: 2px solid #1e3c74;
    outline-offset: 2px;
}

/* Avoid scroll chaining into the page behind either dialog. */
.stampli-popup-dialog,
.stampli-popup-meetings__dialog {
    overscroll-behavior: contain;
}
