/* Theme Popup — native Bootstrap-modal replacement for the SG Popup Builder popup.
   Scoped entirely under .modal.theme-popup so it never touches any other modal
   on the site (e.g. the existing .partner_modal). */

/* Card shell */
.modal.theme-popup .modal-dialog {
    max-width: 576px;
}

.modal.theme-popup .modal-content {
    background: none;
    border: 8px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    box-shadow: none;
    overflow: hidden;
    padding: 0;
}

/* Backdrop — blurred navy overlay, scoped via :has() so other modals keep the
   site's default backdrop */
body:has(.modal.theme-popup.show) .modal-backdrop {
    background: rgba(41, 48, 84, 0.80);
    backdrop-filter: blur(5.5px);
    -webkit-backdrop-filter: blur(5.5px);
}

/* Entrance animation — recreate the original popup's large drop-in */
.modal.theme-popup.fade .modal-dialog {
    transition: transform 0.3s ease;
    transform: translateY(-2000px);
}

.modal.theme-popup.show .modal-dialog {
    transform: translateY(0);
}

/* Content card */
.modal.theme-popup .form_wrapper {
    background-color: #fff;
    padding: 24.5px 32px 28px;
    position: relative;
}

.modal.theme-popup .close-popup {
    position: absolute;
    cursor: pointer;
    top: 16px;
    right: 16px;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    padding: 0;
}

.modal.theme-popup .close-popup:hover {
    filter: contrast(2);
}

.modal.theme-popup .close-popup svg {
    display: block;
}

.modal.theme-popup .form_wrapper h3 {
    font-family: "DM Serif Display", sans-serif;
    font-size: 32px;
    line-height: 35px;
    font-weight: 400;
    text-align: center;
    color: #293054;
    padding-bottom: 17px;
}

/* HubSpot form fields — same styling already proven elsewhere on this theme
   (custom-hubspot.css / demo-form.css), reused verbatim so any HubSpot form
   embed pasted into a Theme Popup's content field looks native */
.modal.theme-popup .hbspt-form {
    width: 100%;
}

.modal.theme-popup .hbspt-form form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal.theme-popup .hbspt-form form > div {
    position: relative;
}

/* Dependent fields (e.g. Country -> State) come wrapped in an extra HubSpot
   div; unwrap it from the grid so each dependent select gets its own cell
   instead of being cramped together in one */
.modal.theme-popup .hbspt-form form .hs-dependent-field {
    display: contents !important;
}

.modal.theme-popup .hbspt-form form .hs-dependent-field > div {
    position: relative !important;
}

/* Country has no dependent State field until "United States" is selected
   (tracked via the has-state-field class theme-popup.js already toggles) —
   until then, let Country take the full row instead of half */
.modal.theme-popup .hbspt-form:not(.has-state-field) .hs_country_region_2 {
    grid-column: span 2;
}

.modal.theme-popup .hbspt-form form .hs_job_function_2,
.modal.theme-popup .hbspt-form form .legal-consent-container,
.modal.theme-popup .hbspt-form form > div:has(> .hs-richtext) {
    grid-column: span 2;
}

.modal.theme-popup .hbspt-form form .hs-error-msgs + .hs-error-msgs label {
    position: relative;
    top: 0 !important;
    left: 0 !important;
    padding: 0 !important;
    font-size: var(--Paragraphs-P-14, 14px) !important;
    font-weight: 400 !important;
    line-height: 140% !important;
    color: var(--Text-error, #FF4349) !important;
}

.modal.theme-popup .hbspt-form form .hs_error_rollup {
    grid-column: span 2;
    padding: 0;
}

.modal.theme-popup .hbspt-form form .hs_error_rollup label {
    position: relative !important;
    left: 0 !important;
}

.modal.theme-popup .hbspt-form form .hs_submit {
    grid-column: span 2;
    text-align: center;
    margin: 8px 0 4px;
}

.modal.theme-popup .hbspt-form form label:not(.hs-error-msg) {
    font-size: 16px;
    line-height: 22px;
    font-weight: 400;
    color: rgba(41, 48, 84, 0.70);
    z-index: 1;
    width: auto;
    pointer-events: none;
    position: absolute;
    left: 16.5px;
    top: 16.5px;
    margin: 0;
    transition: all 0.3s ease-in-out 0s;
}

.modal.theme-popup .hbspt-form form .focus label:not(.hs-error-msg),
.modal.theme-popup .hbspt-form form .active label:not(.hs-error-msg) {
    font-size: 12px;
    line-height: 17px;
    top: -9px;
    left: 12px;
    padding: 0 5px;
    background-color: #fff;
}

.modal.theme-popup .hbspt-form form .invalid label:not(.hs-error-msg) {
    color: var(--Text-error, #FF4349);
}

.modal.theme-popup .hbspt-form form input,
.modal.theme-popup .hbspt-form form select,
.modal.theme-popup .hbspt-form form textarea {
    font-size: 16px;
    line-height: 22px;
    font-weight: 400;
    color: #293054;
    border-radius: 16px;
    border: 1px solid #ECF2F2;
    background-color: #fff;
    height: auto;
    box-shadow: none;
    outline: none;
    padding: 16px 15px;
}

.modal.theme-popup .hbspt-form form input.error,
.modal.theme-popup .hbspt-form form select.error,
.modal.theme-popup .hbspt-form form textarea.error {
    display: block;
}

.modal.theme-popup .hbspt-form form input:-webkit-autofill,
.modal.theme-popup .hbspt-form form input:-webkit-autofill:hover,
.modal.theme-popup .hbspt-form form input:-webkit-autofill:focus,
.modal.theme-popup .hbspt-form form select:-webkit-autofill,
.modal.theme-popup .hbspt-form form select:-webkit-autofill:hover,
.modal.theme-popup .hbspt-form form select:-webkit-autofill:focus,
.modal.theme-popup .hbspt-form form textarea:-webkit-autofill,
.modal.theme-popup .hbspt-form form textarea:-webkit-autofill:hover,
.modal.theme-popup .hbspt-form form textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(126, 126, 126, 0) inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
    -webkit-text-fill-color: #293054 !important;
    position: relative;
}

/* Fires a CSS animation the moment the browser autofills a field (and again
   when autofill is cancelled), so theme-popup.js's "animationstart" listener
   can sync the floating-label .active state — autofilled values don't
   otherwise dispatch input/change events */
@keyframes onAutoFillStart {
    from {}
    to {}
}

@keyframes onAutoFillCancel {
    from {}
    to {}
}

.modal.theme-popup .hbspt-form form input:-webkit-autofill {
    animation-name: onAutoFillStart;
}

.modal.theme-popup .hbspt-form form input:not(:-webkit-autofill) {
    animation-name: onAutoFillCancel;
}

.modal.theme-popup .hbspt-form form input::-moz-placeholder,
.modal.theme-popup .hbspt-form form select::-moz-placeholder,
.modal.theme-popup .hbspt-form form textarea::-moz-placeholder {
    opacity: 0;
}

.modal.theme-popup .hbspt-form form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cg clip-path='url(%23clip0_13244_73)'%3E%3Cpath d='M5 7L8.29289 10.2929C8.68342 10.6834 9.31658 10.6834 9.70711 10.2929L13 7' stroke='%23293054' stroke-opacity='0.7' stroke-width='1.5'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_13244_73'%3E%3Crect width='18' height='18' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 30px;
    display: block;
}

.modal.theme-popup .hbspt-form form .focus input,
.modal.theme-popup .hbspt-form form .focus select,
.modal.theme-popup .hbspt-form form .focus textarea {
    border: 1px solid var(--Text-default, #293054);
}

.modal.theme-popup .hbspt-form form .invalid input,
.modal.theme-popup .hbspt-form form .invalid select,
.modal.theme-popup .hbspt-form form .invalid textarea {
    border: 1px solid var(--Text-error, #FF4349);
}

.modal.theme-popup .hbspt-form form .hs-error-msgs li {
    padding: 0;
}

.modal.theme-popup .hbspt-form form .hs-error-msgs li:before {
    display: none;
}

.modal.theme-popup .hbspt-form form .hs-error-msgs label {
    font-size: var(--Paragraphs-P-14, 14px);
    font-weight: 400;
    line-height: 140%;
    color: var(--Text-error, #FF4349);
    margin: 0px auto 0;
    display: block;
}

.modal.theme-popup .hbspt-form form select option {
    color: #293054;
}

.modal.theme-popup .hbspt-form form .focused input,
.modal.theme-popup .hbspt-form form .focused select,
.modal.theme-popup .hbspt-form form .focused textarea {
    border-color: #293054;
}

/* Privacy / legal-consent text — some HubSpot forms wrap this in
   .legal-consent-container (checkbox-style consent), others just render a
   plain div containing .hs-richtext (privacy-text-only forms, no wrapper
   class) — style both the same way */
.modal.theme-popup .hbspt-form form .legal-consent-container,
.modal.theme-popup .hbspt-form form .hs-richtext {
    font-size: 12px;
    line-height: 17px;
    font-weight: 400;
    text-align: center;
    max-width: 100%;
    color: #193446;
    padding: 0;
}

.modal.theme-popup .hbspt-form form .legal-consent-container a,
.modal.theme-popup .hbspt-form form .hs-richtext a {
    display: inline-block;
    font-weight: 400;
}

.modal.theme-popup .hbspt-form form .hs-button {
    max-width: 220px;
    width: 100%;
    border-radius: 100px;
    padding: 16px;
    margin-top: 1px;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    box-shadow: none !important;
    background: #c423f9;
    color: #ffffff;
}

@media (hover: hover) {
    .modal.theme-popup .hbspt-form form .hs-button:hover {
        background: var(--Buttons-primary-hover, #1BFFC3);
        color: var(--Text-default, #293054);
    }
}

.modal.theme-popup .hbspt-form form .hs-button:active {
    background: var(--Buttons-primary-active, #1BFFC3);
    color: var(--Text-default, #293054);
}

@media (max-width: 991.98px) {
    .modal.theme-popup .form_wrapper {
        padding: 24.5px 52px 28px;
    }

    .modal.theme-popup .hbspt-form form .legal-consent-container {
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
        margin-left: -20px;
    }
}

@media (max-width: 767.98px) {
    .modal.theme-popup .modal-dialog {
        max-width: calc(100% - 26px);
        margin: 10px auto;
    }

    .modal.theme-popup .form_wrapper {
        padding: 26.5px 16px 28.5px !important;
    }

    .modal.theme-popup .close-popup {
        top: 12px;
        right: 12px;
    }

    .modal.theme-popup .form_wrapper h3 {
        font-size: 24px;
        line-height: 26px;
        text-align: center;
        padding-bottom: 19px;
    }

    .modal.theme-popup .hbspt-form form {
        grid-template-columns: 100%;
    }

    .modal.theme-popup .hbspt-form form input,
    .modal.theme-popup .hbspt-form form select,
    .modal.theme-popup .hbspt-form form textarea {
        line-height: 19px !important;
        min-height: 48px !important;
        padding-top: 13px;
        padding-bottom: 13px;
        font-size: 14px;
    }

    .modal.theme-popup .hbspt-form form label:not(.hs-error-msg) {
        font-size: 14px;
        line-height: 19px;
        left: 16px;
        top: 13.5px;
    }

    .modal.theme-popup .hbspt-form form .focus label:not(.hs-error-msg),
    .modal.theme-popup .hbspt-form form .active label:not(.hs-error-msg) {
        font-size: 10px;
        line-height: 14px;
        top: -8px;
    }

    .modal.theme-popup .hbspt-form form .hs_error_rollup {
        grid-column: span 1;
        padding: 0;
    }

    .modal.theme-popup .hbspt-form form .hs_submit {
        grid-column: span 1;
        margin: 8px 0 4px;
    }

    .modal.theme-popup .hbspt-form form .hs-button {
        max-width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .modal.theme-popup .hbspt-form form .legal-consent-container {
        grid-column: span 1;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        font-size: 10px;
        line-height: 14px;
    }

    .modal.theme-popup .hbspt-form form .hs_job_function_2 {
        grid-column: span 1;
    }
}
