/* Shared HubSpot form confirmation */
body.mastech-thank-you-open {
    overflow: hidden;
}

.mastech-form-thank-you-layer {
    position: fixed;
    top: var(--mastech-thank-you-header-offset, 0px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(2px);
}

body.case-study-form-open .mastech-form-thank-you-layer {
    top: 0;
    z-index: 20100;
}

.mastech-form-thank-you {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(975px, 100%);
    min-height: clamp(390px, 56vh, 535px);
    padding: 72px 64px;
    background:
        radial-gradient(ellipse 72% 92% at 50% 18%, rgba(9, 73, 112, 0.34), transparent 70%),
        linear-gradient(125deg, #080d12 0%, #06131d 100%);
    border: 1px solid rgba(139, 183, 212, 0.2);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.mastech-form-thank-you__close {
    position: absolute;
    top: 22px;
    right: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: rgba(242, 244, 241, 0.72);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(242, 244, 241, 0.18);
    border-radius: 0;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mastech-form-thank-you__close .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mastech-form-thank-you__close:hover,
.mastech-form-thank-you__close:focus-visible {
    color: var(--green);
    background: rgba(0, 227, 122, 0.08);
    border-color: rgba(0, 227, 122, 0.55);
    box-shadow: none;
    transform: none;
    outline: none;
}

.mastech-form-thank-you__content {
    width: 100%;
    max-width: 760px;
}

.mastech-form-thank-you__title {
    margin: 0 0 24px;
    color: var(--green);
    font-family: var(--inter);
    font-size: clamp(52px, 5vw, 76px);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
}

.mastech-form-thank-you__message {
    margin: 0 auto;
    color: var(--offwhite);
    font-family: var(--inter);
    font-size: clamp(18px, 1.5vw, 24px);
    font-weight: 300;
    line-height: 1.45;
}

.mastech-form-thank-you__actions,
.mastech-form-thank-you__back {
    display: none !important;
}

/* Contact page: keep the confirmation inside the form column. */
.contact-page .contact-wrap .right.is-thank-you-active {
    display: flex;
    min-height: var(--contact-thank-you-height, 280px);
}

.contact-page .contact-wrap .right.is-thank-you-active > .hbspt-form,
.contact-page .contact-wrap .right.is-thank-you-active > form,
.contact-page .contact-wrap .right.is-thank-you-active > .submitted-message {
    display: none !important;
}

.contact-page .contact-wrap .right .mastech-form-thank-you-layer {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    min-height: var(--contact-thank-you-height, 280px);
    padding: 0;
    background: transparent;
    backdrop-filter: none;
}

.contact-page .contact-wrap .right .mastech-form-thank-you {
    width: 100%;
    min-height: inherit;
    padding: 28px 34px;
}

.contact-page .contact-wrap .right .mastech-form-thank-you__title {
    margin-bottom: 18px;
    font-size: clamp(42px, 3.5vw, 58px);
}

.contact-page .contact-wrap .right .mastech-form-thank-you__message {
    font-size: 18px;
}

@media screen and (max-width: 1023px) {
    .mastech-form-thank-you {
        min-height: 450px;
        padding: 58px 42px;
    }

    .contact-page .contact-wrap .right.is-thank-you-active,
    .contact-page .contact-wrap .right .mastech-form-thank-you-layer {
        min-height: 340px;
    }
}

@media screen and (max-width: 767px) {
    .mastech-form-thank-you-layer {
        padding: 16px;
    }

    .mastech-form-thank-you {
        min-height: 390px;
        padding: 48px 22px;
    }

    .mastech-form-thank-you__title {
        margin-bottom: 20px;
        font-size: 46px;
        letter-spacing: -1px;
    }

    .mastech-form-thank-you__message {
        font-size: 17px;
    }

    .mastech-form-thank-you__close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }

    .contact-page .contact-wrap .right .mastech-form-thank-you {
        padding: 36px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mastech-form-thank-you-layer {
        scroll-behavior: auto;
    }
}
