/* ==========================================
   ISA Exit-Intent Popup Styles
   Premium gradient design matching brand
   ========================================== */

/* Overlay */
.exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exit-popup-overlay.active {
    opacity: 1;
}

/* Container */
.exit-popup-container {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(0, 212, 255, 0.1),
        inset 0 0 120px rgba(139, 92, 246, 0.05);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.exit-popup-overlay.active .exit-popup-container {
    transform: translateY(0);
}

/* Gradient border effect */
.exit-popup-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #00D4FF, #8B5CF6);
    border-radius: 20px;
    opacity: 0.3;
    z-index: -1;
    animation: gradient-rotate 4s linear infinite;
}

@keyframes gradient-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Close button */
.exit-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #FAFAFA;
    z-index: 10;
}

.exit-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Content */
.exit-popup-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Icon */
.exit-popup-icon {
    position: relative;
    margin: 0 auto 24px;
    width: 60px;
    height: 60px;
}

.icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3), transparent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.1;
    }
}

/* Headline */
.exit-popup-headline {
    font-size: 28px;
    font-weight: 700;
    color: #FAFAFA;
    margin-bottom: 16px;
    line-height: 1.3;
}

.gradient-text {
    background: linear-gradient(135deg, #00D4FF, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subheadline */
.exit-popup-subheadline {
    font-size: 16px;
    color: #B8F3FF;
    margin-bottom: 28px;
    line-height: 1.5;
    opacity: 0.9;
}

/* Form */
.exit-popup-form {
    margin-bottom: 20px;
}

.exit-popup-form .form-group {
    margin-bottom: 16px;
}

.exit-popup-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #FAFAFA;
    font-size: 16px;
    transition: all 0.3s ease;
}

.exit-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.exit-popup-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #00D4FF;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* Submit button */
.exit-popup-submit {
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, #00D4FF, #8B5CF6);
    color: #0A0A0A;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exit-popup-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.exit-popup-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.exit-popup-submit:hover::before {
    left: 100%;
}

/* Trust indicators */
.exit-popup-trust {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.trust-item svg {
    flex-shrink: 0;
}

/* Success/Error states (reuse existing styles) */
.exit-popup-form .form-alert {
    margin-top: 16px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .exit-popup-overlay {
        padding: 10px;
    }

    .exit-popup-container {
        padding: 30px 20px;
        border-radius: 16px;
        max-width: calc(100vw - 20px);
    }

    .exit-popup-headline {
        font-size: 24px;
    }

    .exit-popup-subheadline {
        font-size: 14px;
    }

    .exit-popup-close {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
    }

    .trust-item {
        font-size: 12px;
    }

    .exit-popup-input,
    .exit-popup-submit {
        font-size: 15px;
        padding: 12px 18px;
    }
}

/* Very small devices */
@media (max-width: 380px) {
    .exit-popup-container {
        padding: 25px 15px;
    }

    .exit-popup-headline {
        font-size: 20px;
    }

    .exit-popup-trust {
        flex-direction: column;
        gap: 12px;
    }
}

/* Accessibility - Focus styles */
.exit-popup-close:focus,
.exit-popup-input:focus,
.exit-popup-submit:focus {
    outline: 2px solid #00D4FF;
    outline-offset: 2px;
}

/* Animation for form elements */
.exit-popup-form > * {
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
}

.exit-popup-form > *:nth-child(1) { animation-delay: 0.1s; }
.exit-popup-form > *:nth-child(2) { animation-delay: 0.2s; }

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
    from {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* Loading state for button */
.exit-popup-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.exit-popup-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #0A0A0A;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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