/* ==========================================================
   SRM Exit Intent — Instant Quote Pages
   "Stay and finish" popup with progress-ring animation.
   ========================================================== */

/* ---------- Overlay ---------- */
.sriq-exit-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: sriqFadeIn 0.35s ease-out;
    padding: 16px;
}

/* ---------- Popup card ---------- */
.sriq-exit-popup {
    position: relative;
    display: flex;
    max-width: 760px;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: sriqSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Close button ---------- */
.sriq-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 10;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s, transform 0.2s;
}
.sriq-close:hover {
    color: #fff;
    transform: scale(1.15);
}

/* ==========================================================
   LEFT PANEL — progress ring visual
   ========================================================== */
.sriq-left {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(155deg, #0b1d3a 0%, #132e5b 50%, #193f70 100%);
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

/* Ambient glow */
.sriq-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 191, 64, 0.18) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: sriqPulse 3s ease-in-out infinite;
}

.sriq-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* SVG progress ring */
.sriq-progress-ring {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 0 18px rgba(94, 191, 64, 0.3));
}

.sriq-ring-fill {
    transition: stroke-dashoffset 0.05s linear;
}

/* Timer row */
.sriq-timer-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sriq-timer-icon {
    width: 16px;
    height: 16px;
    animation: sriqTick 1s steps(1) infinite;
}

.sriq-timer-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.4px;
}

/* Sparkles */
.sriq-sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5EBF40;
    animation: sriqSparkle 2.4s ease-in-out infinite;
}
.sriq-sparkle-1 { top: 18%; left: 22%; animation-delay: 0s; }
.sriq-sparkle-2 { top: 14%; right: 20%; animation-delay: 0.6s; }
.sriq-sparkle-3 { bottom: 20%; left: 18%; animation-delay: 1.2s; }
.sriq-sparkle-4 { bottom: 16%; right: 22%; animation-delay: 1.8s; }

/* ==========================================================
   RIGHT PANEL — copy & CTA
   ========================================================== */
.sriq-right {
    flex: 1;
    background: linear-gradient(170deg, #ffffff 0%, #f7f9fc 100%);
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.sriq-right h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    color: #0d2240;
    margin: 0 0 14px;
}
.sriq-right h2 strong {
    color: #5EBF40;
}

.sriq-desc {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 22px;
}
.sriq-desc strong {
    color: #0d2240;
}

/* CTA button */
.sriq-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #5EBF40 0%, #4da635 100%);
    color: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 700;
    padding: 15px 32px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 14px rgba(94, 191, 64, 0.35), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    width: 100%;
    max-width: 340px;
}
.sriq-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 191, 64, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #6bd04b 0%, #5EBF40 100%);
}
.sriq-cta:active {
    transform: translateY(0);
}
.sriq-cta-arrow {
    font-size: 20px;
    transition: transform 0.2s;
}
.sriq-cta:hover .sriq-cta-arrow {
    transform: translateX(3px);
}

/* Trust & social proof */
.sriq-trust {
    margin: 14px 0 0;
    color: #718096;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 12px;
    text-align: center;
}
.sriq-trust small {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.sriq-social-proof {
    margin: 8px 0 0;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 12px;
    color: #718096;
    text-align: center;
}
.sriq-social-proof strong {
    color: #5EBF40;
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */
@keyframes sriqFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sriqSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sriqPulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes sriqTick {
    0%  { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes sriqSparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50%      { opacity: 1; transform: scale(1); }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
    .sriq-exit-popup {
        flex-direction: column;
        max-width: 400px;
    }
    .sriq-left {
        flex: 0 0 auto;
        padding: 28px 20px;
    }
    .sriq-progress-ring {
        width: 120px;
        height: 120px;
    }
    .sriq-right {
        padding: 28px 24px 24px;
    }
    .sriq-right h2 {
        font-size: 20px;
    }
    .sriq-desc {
        font-size: 14px;
    }
    .sriq-cta {
        font-size: 15px;
        padding: 13px 24px;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .sriq-exit-overlay {
        padding: 10px;
    }
    .sriq-left {
        padding: 22px 16px;
    }
    .sriq-right {
        padding: 22px 18px 20px;
    }
    .sriq-right h2 {
        font-size: 18px;
    }
}

/* ==========================================================
   ACCESSIBILITY
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    .sriq-exit-overlay,
    .sriq-exit-popup,
    .sriq-glow,
    .sriq-timer-icon,
    .sriq-sparkle {
        animation: none !important;
    }
    .sriq-ring-fill {
        transition: none !important;
    }
}

@media (prefers-contrast: more) {
    .sriq-right h2 { color: #000; }
    .sriq-desc { color: #222; }
    .sriq-cta {
        background: #2e7d32;
        border: 2px solid #000;
    }
}
