/* ============================================
   Exit Intent Popup - Instant Quote CTA
   Animated visual panel + clean CTA design.
   Optimized for older users: larger fonts,
   better contrast, bigger tap targets.
   ============================================ */

.sr-exit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: srExitFadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes srExitFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes srExitSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sr-exit-popup {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    position: relative;
    animation: srExitSlideUp 0.4s ease-out;
}

/* ============================================
   LEFT PANEL — Animated Visual
   ============================================ */

.sr-exit-popup-image {
    flex: 0 0 320px;
    background: linear-gradient(165deg, #0d1f3c 0%, #142F57 40%, #1a4070 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

.sr-exit-visual {
    text-align: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Radial glow behind the illustration */
.sr-exit-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(94, 191, 64, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: srExitPulseGlow 4s ease-in-out infinite;
}

@keyframes srExitPulseGlow {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

/* Decorative ring */
.sr-exit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 0;
}

/* House SVG icon */
.sr-exit-icon-wrap {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.sr-exit-house-svg {
    width: 110px;
    height: 110px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* Coin float animations inside SVG */
.sr-exit-coin-1 {
    animation: srExitCoinFloat1 3s ease-in-out infinite;
}
.sr-exit-coin-2 {
    animation: srExitCoinFloat2 3.5s ease-in-out infinite;
}
.sr-exit-coin-3 {
    animation: srExitCoinFloat3 2.8s ease-in-out infinite;
}

@keyframes srExitCoinFloat1 {
    0%, 100% { transform: translateY(0);    opacity: 0.9; }
    50%      { transform: translateY(-6px); opacity: 1; }
}
@keyframes srExitCoinFloat2 {
    0%, 100% { transform: translateY(0) rotate(0deg);    opacity: 0.85; }
    50%      { transform: translateY(-8px) rotate(5deg); opacity: 1; }
}
@keyframes srExitCoinFloat3 {
    0%, 100% { transform: translateY(0);    opacity: 0.8; }
    50%      { transform: translateY(-5px); opacity: 1; }
}

/* Dollar amount display */
.sr-exit-amount {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 20px rgba(94, 191, 64, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sr-exit-dollar {
    color: #5EBF40;
}

.sr-exit-amount-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Sparkle particles */
.sr-exit-sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(94, 191, 64, 0.7);
    border-radius: 50%;
    z-index: 1;
}

.sr-exit-sparkle-1 { top: 12%; left: 18%;  animation: srExitSparkle 2.5s ease-in-out infinite 0s; }
.sr-exit-sparkle-2 { top: 25%; right: 12%; animation: srExitSparkle 3s   ease-in-out infinite 0.5s; }
.sr-exit-sparkle-3 { bottom: 20%; left: 10%;  animation: srExitSparkle 2.2s ease-in-out infinite 1s; }
.sr-exit-sparkle-4 { bottom: 30%; right: 18%; animation: srExitSparkle 2.8s ease-in-out infinite 1.5s; width: 4px; height: 4px; background: rgba(212, 168, 67, 0.6); }
.sr-exit-sparkle-5 { top: 40%; left: 8%;  animation: srExitSparkle 3.2s ease-in-out infinite 2s;   width: 3px; height: 3px; background: rgba(59, 122, 222, 0.5); }

@keyframes srExitSparkle {
    0%, 100% { opacity: 0;   transform: scale(0)   translateY(0); }
    30%      { opacity: 1;   transform: scale(1)   translateY(-4px); }
    70%      { opacity: 0.8; transform: scale(0.8) translateY(-8px); }
}

/* ============================================
   RIGHT PANEL — Content & CTA
   ============================================ */

.sr-exit-popup-content {
    flex: 1;
    padding: 48px 44px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sr-exit-popup-content h2 {
    margin: 0 0 16px 0;
    font-size: 1.875rem;
    line-height: 1.35;
    color: #142F57;
    font-weight: 600;
}

.sr-exit-popup-content h2 strong {
    color: #142F57;
    font-weight: 800;
}

.sr-exit-description {
    font-size: 1.125rem;
    line-height: 1.65;
    color: #555;
    margin: 0 0 28px 0;
}

/* Close Button */
.sr-exit-top-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
}

.sr-exit-top-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* CTA Button (anchor styled as button) */
.sr-exit-cta-button {
    display: block;
    width: 100%;
    /* Darker green keeps white label text at 5.2:1 (WIN-70; #5EBF40 was 2.3:1) */
    background: #2F7D1E;
    color: white !important;
    border: none;
    padding: 18px 24px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(94, 191, 64, 0.3);
    box-sizing: border-box;
}

.sr-exit-cta-button:hover {
    background: #266818;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(94, 191, 64, 0.4);
    color: white !important;
    text-decoration: none !important;
}

.sr-exit-cta-button:active {
    transform: translateY(0);
}

.sr-exit-cta-arrow {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.3s;
}

.sr-exit-cta-button:hover .sr-exit-cta-arrow {
    transform: translateX(4px);
}

/* Trust Signals */
.sr-exit-trust-signal {
    text-align: center;
    margin: 18px 0 10px 0;
    font-size: 0.9375rem;
    color: #1E7B34;
    font-weight: 600;
}

/* Disclaimer */
.sr-exit-disclaimer {
    margin: 8px 0 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #666;
    text-align: center;
}

.sr-exit-disclaimer a {
    color: #2E5EB1;
    text-decoration: underline;
}

.sr-exit-top-close:focus-visible,
.sr-exit-cta-button:focus-visible,
.sr-exit-disclaimer a:focus-visible {
    outline: 3px solid #142F57;
    outline-offset: 3px;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet and smaller */
@media (max-width: 768px) {
    .sr-exit-overlay {
        padding: 10px;
    }
    
    .sr-exit-popup {
        flex-direction: column;
        max-height: 95vh;
    }
    
    .sr-exit-popup-image {
        flex: 0 0 auto;
        padding: 24px 20px;
    }
    
    .sr-exit-glow {
        width: 180px;
        height: 180px;
    }
    
    .sr-exit-ring {
        width: 150px;
        height: 150px;
    }
    
    .sr-exit-house-svg {
        width: 70px;
        height: 70px;
    }
    
    .sr-exit-amount {
        font-size: 2.25rem;
    }
    
    .sr-exit-amount-label {
        font-size: 0.6875rem;
    }
    
    .sr-exit-popup-content {
        padding: 28px 24px;
    }
    
    .sr-exit-popup-content h2 {
        font-size: 1.5rem;
    }
    
    .sr-exit-description {
        font-size: 1rem;
        margin-bottom: 22px;
    }
    
    .sr-exit-top-close {
        background: rgba(0, 0, 0, 0.3) !important;
        color: #ffffff !important;
        font-weight: 300;
    }
    
    .sr-exit-top-close:hover {
        background: rgba(0, 0, 0, 0.5) !important;
        color: #ffffff !important;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .sr-exit-popup-content {
        padding: 24px 20px;
    }
    
    .sr-exit-popup-content h2 {
        font-size: 1.375rem;
        margin-bottom: 10px;
    }
    
    .sr-exit-description {
        font-size: 0.9375rem;
        margin-bottom: 18px;
    }
    
    .sr-exit-cta-button {
        font-size: 1.0625rem;
        padding: 16px 20px;
    }
    
    .sr-exit-popup-image {
        padding: 20px 16px;
    }
    
    .sr-exit-house-svg {
        width: 56px;
        height: 56px;
    }
    
    .sr-exit-amount {
        font-size: 1.875rem;
    }
    
    .sr-exit-amount-label {
        font-size: 0.625rem;
        letter-spacing: 2px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sr-exit-cta-button {
        border: 2px solid #003d82;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sr-exit-overlay,
    .sr-exit-popup {
        animation: none;
    }
    
    .sr-exit-glow {
        animation: none;
    }
    
    .sr-exit-sparkle {
        display: none;
    }
    
    .sr-exit-coin-1,
    .sr-exit-coin-2,
    .sr-exit-coin-3 {
        animation: none;
    }
    
    .sr-exit-cta-button:hover {
        transform: none;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .sr-exit-popup {
        max-width: 1000px;
    }
    
    .sr-exit-popup-content {
        padding: 56px 52px;
    }
}
