/* ==========================================================================
   KN SMART POPUP — STYLES
   ========================================================================== */

/* Overlay */
.knsp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 10, 40, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.knsp-overlay.active {
    display: block;
    opacity: 1;
}

/* Popup container */
.knsp-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 99999;
    width: 92%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px;
    padding: 44px 36px 36px;
    text-align: center;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 26, 87, 0.05);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.knsp-popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Close button */
.knsp-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}
.knsp-close:hover {
    background: #f3f4f6;
    color: #333;
}

/* Badge */
.knsp-badge {
    display: inline-block;
    background: linear-gradient(135deg, #EE5F18 0%, #ff8a50 100%);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 50px;
    margin-bottom: 18px;
    animation: knspPulse 2s infinite;
}
@keyframes knspPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(238, 95, 24, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(238, 95, 24, 0); }
}

/* Heading */
.knsp-popup h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    color: #001a57;
    line-height: 1.25;
    margin: 0 0 12px;
}

/* Text */
.knsp-popup p {
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 24px;
}
.knsp-popup p strong {
    color: #001a57;
}

/* Form */
.knsp-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.knsp-form input[type="tel"],
.knsp-form input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem;
    color: #333;
    background: #f9fafb;
    transition: all 0.2s;
    outline: none;
}
.knsp-form input[type="tel"]:focus,
.knsp-form input[type="email"]:focus {
    border-color: #EE5F18;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(238, 95, 24, 0.1);
}
.knsp-form input[type="tel"]::placeholder,
.knsp-form input[type="email"]::placeholder {
    color: #9ca3af;
}

/* Submit button */
.knsp-form button[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #EE5F18 0%, #d65514 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.knsp-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(238, 95, 24, 0.35);
}
.knsp-form button[type="submit"]:active {
    transform: translateY(0);
}
.knsp-form button[type="submit"].loading {
    pointer-events: none;
    opacity: 0.8;
}
.knsp-form button[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: knspSpin 0.6s linear infinite;
    right: 20px;
    top: 50%;
    margin-top: -10px;
}
@keyframes knspSpin {
    to { transform: rotate(360deg); }
}

/* Trust points */
.knsp-trust {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 4px;
}
.knsp-trust span {
    font-family: 'Rubik', sans-serif;
    font-size: 0.78rem;
    color: #6b7280;
}

/* Success state */
.knsp-success {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #16a34a;
    padding: 30px 0;
    line-height: 1.5;
}

/* Exit popup: different accent (more urgent) */
#knspExit .knsp-badge {
    background: linear-gradient(135deg, #001a57 0%, #002878 100%);
}
#knspExit h2 {
    color: #001a57;
}
#knspExit .knsp-form button[type="submit"] {
    background: linear-gradient(135deg, #001a57 0%, #002878 100%);
}
#knspExit .knsp-form button[type="submit"]:hover {
    box-shadow: 0 8px 25px rgba(0, 26, 87, 0.35);
}
#knspExit .knsp-form input:focus {
    border-color: #001a57;
    box-shadow: 0 0 0 4px rgba(0, 26, 87, 0.1);
}

/* Top decorative line */
.knsp-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #EE5F18, #f5a623, #EE5F18);
    border-radius: 20px 20px 0 0;
}
#knspExit::before {
    background: linear-gradient(90deg, #001a57, #002878, #001a57);
}

/* Mobile */
@media (max-width: 768px) {
    .knsp-popup {
        padding: 36px 24px 28px;
        max-width: 95%;
        border-radius: 16px;
    }
    .knsp-popup h2 {
        font-size: 1.3rem;
    }
    .knsp-popup p {
        font-size: 0.88rem;
    }
    .knsp-trust span {
        font-size: 0.72rem;
    }
}

/* Hide on mobile if disabled */
.knsp-no-mobile .knsp-popup,
.knsp-no-mobile .knsp-overlay {
    display: none !important;
}
