/* Scoped to the popup root to avoid leaking styles to global page */
#refer-popup .popup-container {
    display: flex;
    width: 920px;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    color: #000;
    padding: 2px 0 2px 2px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
#refer-popup .popup-container p,
#refer-popup .popup-container h2 {
   color: #000 !important;
}
#refer-popup .popup-container .ph-fill.ph-check-circle:before {
    content: "\e184";
    color: goldenrod;
}
#refer-popup .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

/* Left Section */
#refer-popup .popup-left {
    flex: 1.1;
    background-size: cover;
    background-position: center;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #000;
}

#refer-popup .header-text h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-align: center;
    font-weight: 600;
}

#refer-popup .header-text p {
    font-size: 18px;
    text-align: center;
    font-weight: 500;
    max-width: 348px;
    margin: -20px auto 0 auto;
    line-height: 20px;
}

#refer-popup .benefit-cards {
    display: flex;
    gap: 10px;
    margin-top: auto;
    margin-bottom: 40px;
}

#refer-popup .card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    padding: 10px 5px;
    border-radius: 8px;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #fff;
    display: inline-flex;
}
#refer-popup .card img {
    width: auto;
    height: 40px;
    object-fit: contain;
    margin-right: 12px;
}
#refer-popup .card p {
    margin: 0;
    line-height: 1.2;
    flex: 1 1 auto;
    text-align: center;
}
#refer-popup .cta-step p {
    font-style: italic;
    font-size: 14px;
    color: #1f2937;
}
/* Right Section */
#refer-popup .popup-right {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
}

#refer-popup .popup-right h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

#refer-popup .steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#refer-popup .steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    color: #333;
    line-height: 1.4;
}

#refer-popup .steps-list img {
    margin-top: 5px;
}

#refer-popup .cta-step img {
    width: 28px;
    height: auto;
}

#refer-popup .main-cta {
    width: 100%;
    height: 57px;
    background: rgba(194,159,32,1);
    opacity: 1;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(197, 160, 33, 0.3);
}

#refer-popup .header-text {
    text-align: center;
}

#refer-popup .header-text img.divider {
    position: relative;
    width: 270px;
    height: 3px;
    margin-top: -20px;
    margin-bottom: 20px;
}

#refer-popup .popup-right img.divider {
    position: relative;
    width: 170px;
    height: 3px;
    margin-top: -26px;
    margin-bottom: 20px;
}

#refer-popup .main-cta:hover {
    background-color: rgb(236, 190, 24);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 33, 0.4);
}

#refer-popup .terms {
    text-align: left;
    font-size: 0.9rem;
    margin-top: 15px;
}

#refer-popup .terms a {
    color: inherit;
    font-weight: 600;
}
/* The Sweeping Shine Streak */
.popup-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-25deg);
    animation: shine 4s infinite ease-in-out;
}

@keyframes shine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

/* Glitter Particle Container */
.glitter-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glitter {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 3s infinite;
    filter: blur(1px);
}

@keyframes sparkle {
    0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 0.8; }
}
/* Responsive */
@media (max-width: 800px) {
    #refer-popup .header-text h1 {
        font-size: 1.7rem;
        font-family: arial;
        font-weight: 800;
        letter-spacing: -0.025em;
        margin-top: 20px;
    }
    #refer-popup .header-text img.divider{
        width: 210px;
    }
    #refer-popup .header-text p{
        margin-bottom: 20px;
        font-size: 15px;
        font-family: arial;
        font-weight: 600;
    }
    .header-text{
        background: rgba(255, 255, 255, 0.5);
        border-radius: 15px;
    }
    #refer-popup .popup-container {
        flex-direction: column;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    #refer-popup .popup-left {
        height: 300px;
    }


}

/* Modal overlay root - make popup appear as modal centered on screen */
#refer-popup {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: none; /* toggled by JS */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
}

/* animate the container when overlay becomes visible */
#refer-popup .popup-container{
    max-width: 920px;
    width: 100%;
    box-sizing: border-box;
    transform: translateY(-12px);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
}

#refer-popup.visible {
    display: flex;
}
#refer-popup.visible .popup-container{
    transform: translateY(0);
    opacity: 1;
}