/* ============================================
   🎯 EXIT INTENT POPUP - Стили
   Премиум дизайн для максимальной конверсии
   ============================================ */

/* ========== OVERLAY ========== */
#exit-intent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#exit-intent-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== POPUP КОНТЕЙНЕР ========== */
.exit-intent-popup {
    background: var(--white, #fff);
    border-radius: 12px;
    padding: 48px 40px;
    max-width: 560px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 100px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--border-color, #e2e8f0);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: popupBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    flex-shrink: 0;
}

@keyframes popupBounce {
    0% {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }

    50% {
        transform: scale(1.05) translateY(-5px);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#exit-intent-overlay.active .exit-intent-popup {
    transform: scale(1) translateY(0);
}

/* ========== КНОПКА ЗАКРЫТИЯ ========== */
.exit-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    font-size: 26px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    /* Mobile touch fix */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
    margin: 0;
}

.exit-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.exit-close:active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: scale(0.9);
}

/* ========== ИКОНКА ========== */
.exit-icon {
    text-align: center;
    margin-bottom: 24px;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ========== ЗАГОЛОВКИ ========== */
.exit-title {
    font-size: 36px;
    font-weight: 850;
    text-align: center;
    margin: 0 0 12px;
    background: linear-gradient(90deg, #ff4d30, #ff8c30);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1.5px;
}

.exit-subtitle {
    font-size: 18px;
    color: #64748b;
    text-align: center;
    margin: 0 0 32px;
    font-weight: 500;
}

/* ========== СКИДКА БЕЙДЖ ========== */
.exit-discount {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.discount-badge {
    background: linear-gradient(135deg, #ff4d30 0%, #ff8c30 100%);
    border-radius: 12px;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(255, 77, 48, 0.4);
    animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.discount-number {
    font-size: 56px;
    font-weight: 900;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.discount-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ========== ФОРМА СБОРА ДАННЫХ ========== */
.exit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.exit-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.exit-input-group i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.exit-input-group input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

.exit-input-group input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 77, 48, 0.1);
}

.exit-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.exit-privacy {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.exit-privacy i {
    color: #10b981;
}

/* ========== ПРОМОКОД ========== */
.promo-code-block {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.promo-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.promo-code {
    font-size: 28px;
    font-weight: 900;
    color: #1e293b;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    margin-bottom: 12px;
    user-select: all;
    padding: 8px;
    background: white;
    border-radius: 8px;
    display: inline-block;
}

.promo-copy-btn {
    background: linear-gradient(135deg, #ff4d30 0%, #ff8c30 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.promo-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(255, 77, 48, 0.4);
}

.promo-copy-btn:active {
    transform: translateY(0);
}

.success-icon {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 20px;
}

/* ========== ТАЙМЕР ========== */
.exit-timer {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#exit-timer-display {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 900;
    color: #b45309;
}

/* ========== КНОПКИ ДЕЙСТВИЙ ========== */
.exit-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.exit-btn-primary,
.exit-btn-secondary {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.exit-btn-primary {
    background: linear-gradient(135deg, #ff4d30 0%, #ff8c30 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(255, 77, 48, 0.39);
}

.exit-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 48, 0.5);
}

.exit-btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.exit-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ========== ПРЕИМУЩЕСТВА ========== */
.exit-features {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.exit-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.exit-feature-item i {
    font-size: 20px;
    color: var(--primary-color);
}

/* ========== УВЕДОМЛЕНИЕ ========== */
.exit-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    z-index: 100000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exit-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.exit-notification i {
    font-size: 20px;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    #exit-intent-overlay {
        align-items: flex-start;
        padding: 20px 12px;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .exit-intent-popup {
        padding: 32px 24px;
        border-radius: 20px;
        max-height: none;
        margin: auto 0;
    }

    .exit-title {
        font-size: 28px;
    }

    .exit-subtitle {
        font-size: 16px;
    }

    .discount-number {
        font-size: 48px;
    }

    .promo-code {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .exit-close {
        top: 8px;
        right: 8px;
        width: 48px;
        height: 48px;
        font-size: 28px;
        background: rgba(0, 0, 0, 0.08);
    }

    .exit-actions {
        flex-direction: column;
    }

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

    .exit-feature-item {
        flex-direction: row;
        justify-content: flex-start;
    }

    .exit-notification {
        bottom: 16px;
        right: 16px;
        left: 16px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .exit-intent-popup {
        padding: 24px 20px;
    }

    .exit-title {
        font-size: 24px;
    }

    .discount-badge {
        padding: 16px 32px;
    }

    .discount-number {
        font-size: 40px;
    }

    .promo-code {
        font-size: 20px;
    }
}

/* ========== ТЕМНАЯ ТЕМА ========== */
.dark-mode #exit-intent-overlay {
    background: rgba(0, 0, 0, 0.95);
}

.dark-mode .exit-intent-popup {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark-mode .exit-close {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.dark-mode .exit-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.dark-mode .exit-subtitle {
    color: #94a3b8;
}

.dark-mode .exit-text {
    color: #cbd5e1;
}

.dark-mode .promo-code-block {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
}

.dark-mode .promo-label {
    color: #94a3b8;
}

.dark-mode .promo-code {
    background: #0f172a;
    color: #f1f5f9;
}

.dark-mode .exit-btn-secondary {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.dark-mode .exit-btn-secondary:hover {
    background: #475569;
}

.dark-mode .exit-features {
    border-top-color: #334155;
}

.dark-mode .feature-item {
    color: #94a3b8;
}