.acptsp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 16px;
    overflow: hidden;
    background: rgba(var(--acptsp-overlay-rgb, 25, 29, 105), var(--acptsp-overlay-opacity, .8));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.acptsp-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.acptsp-dialog {
    position: relative;
    box-sizing: border-box;
    width: min(var(--acptsp-width, 80vw), var(--acptsp-max-width, 1000px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    /* Keep scrolling functional without showing the narrow browser scrollbar. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    outline: none;
}

.acptsp-dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.acptsp-widget-frame.Wt-domRoot {
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Keep the CRM's internal panel styling; remove only its outside navy frame and padding. */
#acptsp-wt-dom-root #widgetset-handle-personal-info.signup-request-form {
    box-sizing: border-box;
    width: 100%;
    background: transparent !important;
    padding: 0 !important;
}

.acptsp-close {
    position: absolute;
    z-index: 1000000;
    top: var(--acptsp-close-top, 10px);
    right: var(--acptsp-close-right, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--acptsp-close-size, 32px);
    height: var(--acptsp-close-size, 32px);
    margin: 0;
    padding: 0 0 2px;
    border: 0;
    border-radius: 50%;
    background: var(--acptsp-close-color, #315b7c);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: calc(var(--acptsp-close-size, 32px) * .85);
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
}

.acptsp-close:hover,
.acptsp-close:focus {
    background: var(--acptsp-close-color, #315b7c);
    color: #fff;
    filter: brightness(1.08);
}

.acptsp-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

html.acptsp-no-scroll,
body.acptsp-no-scroll {
    overflow: hidden !important;
}

@media (max-width: 680px) {
    .acptsp-overlay {
        padding: 12px;
    }
    .acptsp-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .acptsp-overlay {
        transition: none;
    }
}


/* Ensure typed values remain readable on the light ACPT form panel. */
#acptsp-wt-dom-root #widgetset-handle-personal-info input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea,
#acptsp-wt-dom-root #widgetset-handle-personal-info select {
    color: #17245f !important;
    -webkit-text-fill-color: #17245f !important;
    caret-color: #17245f !important;
}

#acptsp-wt-dom-root #widgetset-handle-personal-info input::placeholder,
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea::placeholder {
    color: #58678a !important;
    -webkit-text-fill-color: #58678a !important;
    opacity: 1 !important;
}

/* Google Places legacy autocomplete suggestions must appear above the modal overlay. */
.pac-container {
    z-index: 1000001 !important;
}


/* Keep all editable ACPT fields light, including values populated by browser autofill.
   Do not alter borders so ACPT's red validation indicators remain visible. */
#acptsp-wt-dom-root #widgetset-handle-personal-info input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]),
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea,
#acptsp-wt-dom-root #widgetset-handle-personal-info select {
    color-scheme: light;
    background-color: #fff !important;
    background-image: none !important;
}

#acptsp-wt-dom-root #widgetset-handle-personal-info input:-webkit-autofill,
#acptsp-wt-dom-root #widgetset-handle-personal-info input:-webkit-autofill:hover,
#acptsp-wt-dom-root #widgetset-handle-personal-info input:-webkit-autofill:focus,
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea:-webkit-autofill,
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea:-webkit-autofill:hover,
#acptsp-wt-dom-root #widgetset-handle-personal-info textarea:-webkit-autofill:focus,
#acptsp-wt-dom-root #widgetset-handle-personal-info select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #17245f !important;
    caret-color: #17245f !important;
}


/* Normalize ACPT service-option icons. The first two Font Awesome icons can
   inherit large padding from site-wide icon rules, pushing them outside their
   44px circular holders. Scope the reset to this widget only. */
#acptsp-wt-dom-root .signup-service-list .signup-service-option > .signup-service-icon {
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
}

#acptsp-wt-dom-root .signup-service-list .signup-service-option > .signup-service-icon > i {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}
