/* ============================================
   Exit Intent Popup - Enhanced Styles
   Optimized for older users with larger fonts,
   better contrast, and 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: fadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    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: slideUp 0.4s ease-out;
}

.sr-exit-popup-image {
    flex: 0 0 300px;
    background: #142F57;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.sr-exit-popup-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
}

.sr-exit-popup-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.sr-exit-popup-content h2 {
    margin: 0 0 16px 0;
    font-size: 2rem;
    line-height: 1.3;
    color: #142F57;
    font-weight: 700;
}

.sr-exit-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 0 0 24px 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);
}

/* Form Styles */
.sr-exit-form {
    margin: 0;
}

.sr-exit-form-step {
    animation: fadeIn 0.3s ease-out;
}

.sr-exit-form-row {
    margin-bottom: 20px;
}

.sr-exit-form-field {
    display: flex;
    flex-direction: column;
}

.sr-exit-form-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.sr-exit-form-field .required {
    color: #d9534f;
    font-weight: 700;
}

.sr-exit-form-field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.0625rem;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
}

.sr-exit-form-field input:focus {
    outline: none;
    border-color: #3B7ADE;
    box-shadow: 0 0 0 3px rgba(59, 122, 222, 0.1);
}

.sr-exit-form-field input::placeholder {
    color: #999;
}

/* Submit Button */
.sr-exit-submit-button {
    width: 100%;
    background: #5EBF40;
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sr-exit-submit-button:hover:not(:disabled) {
    background: #4da935;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(94, 191, 64, 0.3);
}

.sr-exit-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.sr-exit-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Trust Signals */
.sr-exit-trust-signal {
    text-align: center;
    margin: 16px 0 12px 0;
    font-size: 0.9375rem;
    color: #28a745;
    font-weight: 600;
}

/* Disclaimer */
.sr-exit-disclaimer {
    margin: 12px 0 20px 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #666;
    text-align: center;
}

.sr-exit-disclaimer a {
    color: #3B7ADE;
    text-decoration: underline;
}

/* Back Button */
.sr-exit-back-button {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid #d0d0d0;
    color: #666;
    font-size: 1rem;
    padding: 12px 24px;
    margin-top: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.sr-exit-back-button:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}

/* No Thanks Button */
.sr-exit-no-thanks {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.9375rem;
    padding: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.sr-exit-no-thanks:hover {
    color: #333;
}

/* Success Message */
.sr-exit-success {
    text-align: center;
    padding: 20px 0;
}

.sr-exit-success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.sr-exit-success h2 {
    color: #28a745;
    margin-bottom: 16px;
}

.sr-exit-success-message {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.sr-exit-success-submessage {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 24px;
}

.sr-exit-success-submessage strong {
    color: #333;
}

.sr-exit-close-success {
    background: #3B7ADE;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.sr-exit-close-success:hover {
    background: #2d63b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 122, 222, 0.3);
}

/* ============================================
   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;
        min-height: 160px;
        padding: 24px;
        max-height: 260px;
    }
    
    .sr-exit-popup-image img {
        max-width: 95%;
        max-height: 240px;
        margin: 0 auto;
        object-fit: contain;
    }
    
    .sr-exit-popup-content {
        padding: 30px 24px;
    }
    
    .sr-exit-popup-content h2 {
        font-size: 1.625rem;
    }
    
    .sr-exit-description {
        font-size: 1rem;
    }
    
    /* White X button on mobile/tablet */
    .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.5rem;
        margin-bottom: 12px;
    }
    
    .sr-exit-description {
        font-size: 0.9375rem;
        margin-bottom: 20px;
    }
    
    .sr-exit-form-row {
        margin-bottom: 16px;
    }
    
    .sr-exit-form-field input {
        font-size: 1rem;
        padding: 12px 14px;
    }
    
    .sr-exit-submit-button {
        font-size: 1rem;
        padding: 14px 20px;
    }
    
    .sr-exit-popup-image {
        min-height: 140px;
        padding: 20px;
        max-height: 240px;
    }
    
    .sr-exit-popup-image img {
        max-width: 90%;
        max-height: 220px;
        margin: 0 auto;
        object-fit: contain;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sr-exit-form-field input {
        border-width: 3px;
    }
    
    .sr-exit-submit-button {
        border: 2px solid #003d82;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sr-exit-overlay,
    .sr-exit-popup,
    .sr-exit-success-icon {
        animation: none;
    }
    
    .sr-exit-submit-button:hover:not(:disabled),
    .sr-exit-close-success:hover {
        transform: none;
    }
}

/* Large screens - limit max width */
@media (min-width: 1200px) {
    .sr-exit-popup {
        max-width: 1000px;
    }
    
    .sr-exit-popup-content {
        padding: 50px;
    }
}
