/* Homepage only. The hosted form keeps its existing fields and submission flow. */
body.quote-popup-open {
    overflow: hidden !important;
}

#quote-popup {
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background: #fff;
    color: #223f6f;
    box-shadow: 0 32px 100px rgba(13, 27, 46, 0.3);
    overflow: hidden;
}

#quote-popup[open] {
    display: flex;
    flex-direction: column;
    animation: quote-popup-enter 550ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

#quote-popup::backdrop {
    background: rgba(13, 27, 46, 0.58);
    backdrop-filter: blur(7px);
    animation: quote-backdrop-enter 400ms ease both;
}

#quote-popup.is-closing {
    animation: quote-popup-exit 260ms ease both;
    pointer-events: none;
}

#quote-popup.is-closing::backdrop {
    animation: quote-backdrop-exit 260ms ease both;
}

.quote-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px 12px 24px;
    border-top: 4px solid #c91f2e;
    border-bottom: 1px solid #edf0f5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.quote-popup-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #223f6f;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.quote-popup-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.quote-popup-content {
    position: relative;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#home-quote-frame {
    display: block;
    width: 100%;
    height: 645px;
    border: 0;
    background: white;
}

.quote-popup-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
}

.quote-popup-loading[hidden] { display: none; }

.quote-popup-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid #edf0f5;
    background: #f8fafc;
    font-size: 12px;
    color: #64748b;
}

.quote-popup-footer p { margin: 0; }
.quote-popup-footer button,
.quote-popup-footer a {
    color: #223f6f;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    cursor: pointer;
}

.quote-popup-footer button { padding: 6px 0; }
.quote-popup-footer button[hidden] { display: none; }
#quote-popup :focus-visible { outline: 3px solid #2bb5c6; outline-offset: 3px; }
.quote-popup-timer { height: 3px; background: #e2e8f0; flex-shrink: 0; }
.quote-popup-timer span {
    display: block;
    height: 100%;
    background: #c91f2e;
    transform-origin: left;
    transition: transform 100ms linear;
}

@keyframes quote-popup-enter {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes quote-popup-exit {
    to { opacity: 0; transform: translateY(16px) scale(0.98); }
}
@keyframes quote-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes quote-backdrop-exit { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 480px) {
    #quote-popup { width: calc(100vw - 16px); border-radius: 18px; }
    .quote-popup-header { padding-left: 16px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    #quote-popup[open], #quote-popup::backdrop { animation-duration: 1ms; }
    #quote-popup .quote-popup-close, #quote-popup .quote-popup-timer span { transition: none; }
}
