/* ===========================================================
   Estimate popup modal (LeadConnector form)
   =========================================================== */

.estimate-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(9, 20, 40, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.32s ease;
    overscroll-behavior: contain;
}

.estimate-modal-overlay[hidden] {
    display: none;
}

.estimate-modal-overlay.is-open {
    opacity: 1;
}

/* Dialog card */
.estimate-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 48px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px -12px rgba(9, 20, 40, 0.45),
                0 8px 24px -8px rgba(9, 20, 40, 0.25);
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.32s ease;
    will-change: transform, opacity;
}

.estimate-modal-overlay.is-open .estimate-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header */
.estimate-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    background: linear-gradient(135deg, #0F54AD 0%, #0A4293 100%);
    color: #fff;
    flex-shrink: 0;
}

.estimate-modal-eyebrow {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.82;
    margin-bottom: 3px;
}

.estimate-modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.estimate-modal-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: -4px -6px 0 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.estimate-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg);
}

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

/* Body / iframe */
.estimate-modal-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
}

.estimate-modal-iframe {
    display: block;
    width: 100%;
    height: 600px;
    max-height: 100%;
    border: none;
    background: #fff;
}

/* Loader */
.estimate-modal-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: opacity 0.3s ease;
}

.estimate-modal-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.estimate-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(15, 84, 173, 0.18);
    border-top-color: #0F54AD;
    border-radius: 50%;
    animation: estimate-spin 0.8s linear infinite;
}

@keyframes estimate-spin {
    to { transform: rotate(360deg); }
}

/* Body scroll lock */
body.estimate-modal-open {
    overflow: hidden;
}

/* ---------- Mobile: full-screen sheet ---------- */
@media (max-width: 560px) {
    .estimate-modal-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .estimate-modal {
        max-width: none;
        max-height: none;
        height: 100dvh;
        border-radius: 0;
        /* slide up from bottom on mobile */
        transform: translateY(100%);
    }

    .estimate-modal-overlay.is-open .estimate-modal {
        transform: translateY(0);
    }

    .estimate-modal-head {
        padding: 16px 18px;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .estimate-modal-title {
        font-size: 1.18rem;
    }

    .estimate-modal-iframe {
        height: 100%;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .estimate-modal-overlay,
    .estimate-modal {
        transition: opacity 0.2s ease;
    }
    .estimate-modal {
        transform: none !important;
    }
    .estimate-modal-close:hover {
        transform: none;
    }
}

/* ===========================================================
   Inline widget form (replaces the native contact form)
   =========================================================== */
.contact-widget-form {
    position: relative;
    width: 100%;
    min-height: 581px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.contact-widget-iframe {
    display: block;
    width: 100%;
    min-height: 581px;
    height: 581px;
    border: none;
    background: #fff;
    border-radius: 14px;
}

.contact-widget-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 14px;
    transition: opacity 0.3s ease;
}

.contact-widget-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Homepage white card already has 40px padding — let the widget breathe less */
.contact-form-wrap .contact-widget-form {
    box-shadow: 0 1px 3px rgba(9, 20, 40, 0.06);
    border: 1px solid #eef1f6;
}

/* Contact page (dark glass card): keep the widget on a clean white panel */
.page-contact .contact-form-wrap .contact-widget-form {
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 40px rgba(2, 13, 30, 0.35);
}

/* All four corners use the top-left radius (28px) */
.page-contact .contact-form-wrap .contact-widget-form,
.page-contact .contact-form-wrap .contact-widget-iframe,
.page-contact .contact-form-wrap .contact-widget-loader {
    border-radius: 28px;
}

@media (max-width: 560px) {
    .contact-widget-form,
    .contact-widget-iframe {
        min-height: 620px;
    }
}

/* ===========================================================
   Thank You page
   =========================================================== */
.thankyou {
    padding: 90px 0 110px;
    background: linear-gradient(180deg, #f7fafc 0%, #eef2f7 100%);
}

.thankyou-card {
    max-width: 620px;
    margin: 40px auto 0;
    text-align: center;
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 28px;
    padding: 56px 40px;
    box-shadow: 0 24px 60px -20px rgba(9, 20, 40, 0.22);
}

.thankyou-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 26px;
    color: #fff;
    background: linear-gradient(135deg, #16a34a 0%, #12833d 100%);
    border-radius: 50%;
    box-shadow: 0 12px 28px -8px rgba(18, 131, 61, 0.55);
    animation: thankyou-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes thankyou-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.thankyou-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #0b1b34;
    margin: 0 0 14px;
}

.thankyou-text {
    font-size: 1.12rem;
    line-height: 1.6;
    color: #48566f;
    margin: 0 auto 26px;
    max-width: 460px;
}

.thankyou-subtext {
    font-size: 0.95rem;
    color: #6a7690;
    margin: 0 0 12px;
}

.thankyou-call {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #0F54AD 0%, #0A4293 100%);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    border-radius: 14px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thankyou-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -8px rgba(15, 84, 173, 0.5);
}

.thankyou-home {
    display: block;
    margin-top: 26px;
    color: #0F54AD;
    font-weight: 600;
    text-decoration: none;
}

.thankyou-home:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .thankyou { padding: 60px 0 80px; }
    .thankyou-card { padding: 40px 22px; border-radius: 22px; }
}
