.tsg-contact-form-replacement--cta {
    --tsg-contact-form-accent: var(--primary-color, var(--bs-primary, #2271b1));
    margin: 1.75rem 0;
}

.tsg-contact-form-replacement--cta,
.tsg-contact-form-replacement--cta * {
    box-sizing: border-box;
}

.tsg-contact-form-cta {
    position: relative;
    padding: clamp(1.15rem, 2.5vw, 1.75rem);
    background: #f4f5f6;
    border-radius: 12px;
}

.tsg-contact-form-cta__intro {
    max-width: 720px;
    margin: 0 auto 1.25rem;
    text-align: center;
}

.tsg-contact-form-cta__heading {
    margin: 0 0 .45rem;
    color: inherit;
    font: inherit;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
}

.tsg-contact-form-cta__intro p {
    margin: 0;
    color: inherit;
    line-height: 1.55;
    opacity: .82;
}

.tsg-contact-form-cta__grid {
    display: grid;
    gap: .9rem;
}

.tsg-contact-form-cta__grid--1 {
    grid-template-columns: minmax(0, 1fr);
}

.tsg-contact-form-cta__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tsg-contact-form-cta__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tsg-contact-form-cta__grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tsg-contact-form-cta__grid--5,
.tsg-contact-form-cta__grid--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tsg-contact-form-cta__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    text-align: center;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 10px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .06);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tsg-contact-form-cta__card:hover,
.tsg-contact-form-cta__card:focus-within {
    border-color: var(--tsg-contact-form-accent);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.tsg-contact-form-cta__icon {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto .75rem;
    color: var(--tsg-contact-form-accent);
    flex: 0 0 auto;
}

.tsg-contact-form-cta__title {
    margin: 0 0 .4rem;
    color: inherit;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
}

.tsg-contact-form-cta__text {
    flex: 1 1 auto;
    margin: 0 0 .9rem;
    color: inherit;
    line-height: 1.5;
    opacity: .82;
}

.tsg-contact-form-cta__location-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
    width: 100%;
    margin-top: auto;
}

/* Native select remains as a fully functional no-JavaScript fallback. */
.tsg-contact-form-cta__location-select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    margin: 0;
    padding: .55rem 2.25rem .55rem .75rem;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, .20);
    border-radius: 6px;
    color: inherit;
    font: inherit;
    line-height: 1.25;
}

.tsg-contact-form-cta__location-select:focus {
    border-color: var(--tsg-contact-form-accent);
    outline: 2px solid var(--tsg-contact-form-accent);
    outline-offset: 1px;
}

/* JavaScript replaces the native single-line select with this accessible picker. */
.tsg-contact-form-cta__location-select--enhanced {
    display: none;
}

.tsg-contact-form-cta__location-picker {
    position: relative;
    width: 100%;
    text-align: left;
}

.tsg-contact-form-cta__location-picker-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: .65rem 2.75rem .65rem .85rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .20);
    border-radius: 6px;
    color: inherit;
    font: inherit;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.tsg-contact-form-cta__location-picker-toggle:hover {
    border-color: rgba(0, 0, 0, .35);
}

.tsg-contact-form-cta__location-picker-toggle:focus-visible,
.tsg-contact-form-cta__location-action--open .tsg-contact-form-cta__location-picker-toggle {
    border-color: var(--tsg-contact-form-accent);
    outline: 2px solid var(--tsg-contact-form-accent);
    outline-offset: 1px;
}

.tsg-contact-form-cta__location-picker-selection {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .12rem;
}

.tsg-contact-form-cta__location-picker-name,
.tsg-contact-form-cta__location-picker-option-name {
    display: block;
    min-width: 0;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.tsg-contact-form-cta__location-picker-option::before{
    display: none !important;
}

.tsg-contact-form-cta__location-picker-option{
    margin-left: 0 !important;
}

.tsg-contact-form-cta__location-picker-placeholder {
    font-weight: 400;
    text-transform: none !important;
}

.tsg-contact-form-cta__location-picker-place,
.tsg-contact-form-cta__location-picker-option-place {
    display: block;
    margin-top: .15rem;
    font-size: .88em;
    line-height: 1.3;
    opacity: .72;
    overflow-wrap: anywhere;
}

.tsg-contact-form-cta__location-picker-chevron {
    position: absolute;
    top: 50%;
    right: .9rem;
    display: flex;
    width: 1.1rem;
    height: 1.1rem;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.tsg-contact-form-cta__location-picker-chevron svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform .16s ease;
}

.tsg-contact-form-cta__location-action--open .tsg-contact-form-cta__location-picker-chevron svg {
    transform: rotate(180deg);
}

.tsg-contact-form-cta__location-picker-list {
    position: absolute;
    z-index: 100;
    top: calc(100% + .35rem);
    right: 0;
    left: 0;
    max-height: 17rem;
    margin: 0;
    padding: .35rem !important;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .16);
    border-radius: 7px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
    color: #222;
    list-style: none;
}

.tsg-contact-form-cta__location-picker-list[hidden] {
    display: none;
}

.tsg-contact-form-cta__location-picker-option {
    display: block;
    margin: 0;
    padding: .65rem .7rem;
    border-radius: 5px;
    cursor: pointer;
    outline: 0;
}

.tsg-contact-form-cta__location-picker-option:hover,
.tsg-contact-form-cta__location-picker-option:focus,
.tsg-contact-form-cta__location-picker-option[aria-selected="true"] {
    background: color-mix(in srgb, var(--tsg-contact-form-accent) 12%, #fff);
}

@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
    .tsg-contact-form-cta__location-picker-option:hover,
    .tsg-contact-form-cta__location-picker-option:focus,
    .tsg-contact-form-cta__location-picker-option[aria-selected="true"] {
        background: rgba(0, 0, 0, .06);
    }
}

.tsg-contact-form-cta__location-picker-option:focus {
    box-shadow: inset 0 0 0 2px var(--tsg-contact-form-accent);
}

.tsg-contact-form-cta__card .tsg-contact-form-cta__button {
    margin-top: 0;
    padding: var(--tsg-button-pad-y, 10px) var(--tsg-button-pad-x, 24px);
}

.tsg-contact-form-cta__location-button[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

.tsg-contact-form-cta__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/*
 * Native-theme color adapter. The invisible probe carries the exact same
 * button classes as the visible CTA buttons. JavaScript reads its computed
 * background color and writes that value to --tsg-contact-form-accent.
 * This keeps icons and subtle accents synchronized with each site's actual
 * configured primary color without copying theme color values into TSG Roles.
 */
.tsg-contact-form-cta__theme-color-probe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    display: block !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/*
 * Supported TSG themes receive their native button classes in the markup.
 * Keep this base selector structural only so the theme remains responsible
 * for color, border, radius, typography, hover states, and other button UI.
 */
.tsg-contact-form-cta__button {
    margin-top: auto;
}

/* Fallback styling is used only when no supported TSG theme is detected. */
.tsg-contact-form-cta__button--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .65rem 1rem;
    background: var(--tsg-contact-form-accent);
    border-radius: 999px;
    color: #fff !important;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    transition: transform .18s ease, filter .18s ease;
}

.tsg-contact-form-cta__button--fallback:hover,
.tsg-contact-form-cta__button--fallback:focus {
    color: #fff !important;
    filter: brightness(.92);
    transform: translateY(-1px);
    text-decoration: none !important;
}

.tsg-contact-form-cta__button--fallback:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/*
 * Container-aware refinements keep the CTA balanced whether it replaces a
 * form in a half-width contact column or a full-width page section.
 */
.tsg-contact-form-cta {
    container-type: inline-size;
}

@container (min-width: 980px) {
    .tsg-contact-form-cta__grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tsg-contact-form-cta__grid--5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@container (max-width: 620px) {
    .tsg-contact-form-cta__grid--3,
    .tsg-contact-form-cta__grid--5,
    .tsg-contact-form-cta__grid--6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 420px) {
    .tsg-contact-form-cta__grid--2,
    .tsg-contact-form-cta__grid--3,
    .tsg-contact-form-cta__grid--4,
    .tsg-contact-form-cta__grid--5,
    .tsg-contact-form-cta__grid--6 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .tsg-contact-form-cta {
        padding: 1rem;
        border-radius: 8px;
    }

    .tsg-contact-form-cta__grid--2,
    .tsg-contact-form-cta__grid--3,
    .tsg-contact-form-cta__grid--4,
    .tsg-contact-form-cta__grid--5,
    .tsg-contact-form-cta__grid--6 {
        grid-template-columns: minmax(0, 1fr);
    }

    .tsg-contact-form-cta__card {
        padding: 1.05rem;
    }
}
