#bg-discount-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#bg-discount-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}
#bg-discount-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 17, 28, 0.70);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#bg-discount-card {
    position: relative;
    z-index: 1;
    background: #04111c;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow:
        0px -4px 10px 2px rgba(45, 177, 251, 0.1),
        0px 4px 10px 2px rgba(45, 177, 251, 0.1),
        inset 0px 4px 6px 0px rgba(45, 177, 251, 0.5);
    transform: translateY(12px);
    transition: transform 0.3s ease;
}
#bg-discount-overlay.is-visible #bg-discount-card {
    transform: translateY(0);
}
#bg-discount-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9991;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#bg-discount-overlay.is-visible #bg-discount-close {
    opacity: 1;
    pointer-events: all;
}
#bg-discount-close:hover {
    background: rgba(45, 177, 251, 0.1);
}
#bg-discount-close svg {
    opacity: 0.70;
}

/* Step visibility */
.bg-popup-step { display: none; }
.bg-popup-step.is-active { display: flex; flex-direction: column; gap: 24px; }

/* Popup header (logo + text) */
.bg-popup-logo {
    display: flex;
    justify-content: center;
}
.bg-popup-logo img {
    height: 40px;
    width: auto;
}
.bg-popup-heading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    width: 100%;
}
.bg-popup-subheading {
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
    background: linear-gradient(180deg, #f5f8fa 0%, #2db1fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(45, 177, 251, 0.6)) drop-shadow(0 0 32px rgba(45, 177, 251, 0.6));
}
.bg-popup-title {
    font-size: 36px;
    font-weight: 600;
    line-height: 44px;
    letter-spacing: -0.72px;
    color: #f5f8fa;
    text-shadow: 0px 0px 12px rgba(247, 247, 247, 0.6), 0px 0px 32px rgba(247, 247, 247, 0.6);
}
.bg-popup-title-sm {
    font-size: 30px;
    font-weight: 600;
    line-height: 38px;
    color: #f5f8fa;
    text-shadow: 0px 0px 12px rgba(247, 247, 247, 0.6), 0px 0px 32px rgba(247, 247, 247, 0.6);
}
.bg-popup-subtitle {
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    color: #a3c4e0;
}
.bg-popup-legal {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: #6da5d5;
}
.bg-popup-legal a { color: #2db1fb; text-decoration: underline; }

/* Buttons */
.bg-popup-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border-radius: 9999px;
    border: 2px solid #b9e5fe;
    background: radial-gradient(ellipse at 50% 100%, #2db1fb 0%, #2694d1 50%, #1e76a7 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0px -2px 4px 2px rgba(45, 177, 251, 0.1);
    transition: opacity 0.2s ease;
}
.bg-popup-btn-primary:hover { opacity: 0.9; color: #fff; }
.bg-popup-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #cecfd2;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.bg-popup-btn-ghost:hover { opacity: 0.7; }
.bg-popup-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid #194e7b;
    background: #082035;
    color: #a3c4e0;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}
.bg-popup-btn-secondary:hover { opacity: 0.8; }

/* Input */
.bg-popup-input {
    width: 100%;
    padding: 8px 14px;
    background: #0c0e12;
    border: 1px solid #373a41;
    border-radius: 8px;
    color: #f7f7f7;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    outline: none;
    transition: border-color 0.2s ease;
}
.bg-popup-input:focus { border-color: #2db1fb; }
.bg-popup-input::placeholder { color: #85888e; }

/* Code row (step 4) */
.bg-popup-code-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.bg-popup-code-row .bg-popup-input {
    flex: 1;
    color: #f7f7f7;
    letter-spacing: 0.5px;
}

/* Phone row */
.bg-popup-phone-wrap {
    position: relative;
}
.bg-popup-phone-row {
    display: flex;
    background: #0c0e12;
    border: 1px solid #373a41;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.2s ease;
}
.bg-popup-phone-row:focus-within { border-color: #2db1fb; }
.bg-popup-phone-prefix {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px 8px 12px;
    border-right: 1px solid #373a41;
    color: #cecfd2;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-left: none;
    border-bottom: none;
    border-radius: 8px 0 0 8px;
    transition: background 0.15s ease;
    min-width: 72px;
}
.bg-popup-phone-prefix:hover { background: rgba(45,177,251,0.08); }
.bg-popup-phone-prefix .bg-phone-flag { font-size: 16px; line-height: 1; }
.bg-popup-phone-prefix .bg-phone-code { font-size: 13px; color: #cecfd2; }
.bg-popup-phone-prefix svg { opacity: 0.6; flex-shrink: 0; transition: transform 0.2s ease; }
.bg-popup-phone-prefix.is-open svg { transform: rotate(180deg); }
.bg-popup-phone-input {
    flex: 1;
    padding: 8px 14px 8px 10px;
    background: transparent;
    border: none;
    color: #f7f7f7;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    outline: none;
    min-width: 0;
}
.bg-popup-phone-input::placeholder { color: #85888e; }

/* Country dropdown */
.bg-popup-country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    width: 280px;
    background: #0d1f2e;
    border: 1px solid #1e4060;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(45,177,251,0.1);
    overflow: hidden;
    display: none;
}
.bg-popup-country-dropdown.is-open { display: block; }
.bg-popup-country-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #1e4060;
}
.bg-popup-country-search {
    width: 100%;
    padding: 6px 10px;
    background: #04111c;
    border: 1px solid #2a4a65;
    border-radius: 6px;
    color: #f7f7f7;
    font-size: 13px;
    outline: none;
}
.bg-popup-country-search::placeholder { color: #6da5d5; }
.bg-popup-country-list {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2db1fb transparent;
}
.bg-popup-country-list::-webkit-scrollbar { width: 4px; }
.bg-popup-country-list::-webkit-scrollbar-thumb { background: #2db1fb; border-radius: 2px; }
.bg-popup-country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #cecfd2;
    transition: background 0.1s ease;
}
.bg-popup-country-item:hover,
.bg-popup-country-item.is-selected { background: rgba(45,177,251,0.12); color: #f5f8fa; }
.bg-popup-country-item .ci-flag { font-size: 16px; flex-shrink: 0; }
.bg-popup-country-item .ci-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-popup-country-item .ci-dial { color: #6da5d5; font-size: 12px; flex-shrink: 0; }

/* Step dots / progress */
.bg-popup-steps-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}
.bg-popup-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #373a41;
    transition: background 0.2s ease;
}
.bg-popup-dot.is-active { background: #2db1fb; }

/* Bubble (bottom-left re-open trigger) */
#bg-discount-bubble {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9989;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 10px;
    border-radius: 9999px;
    border: 1.5px solid #b9e5fe;
    background: radial-gradient(ellipse at 50% 100%, rgba(45,177,251,0.25) 0%, rgba(4,17,28,0.95) 100%);
    box-shadow: 0 0 20px rgba(45, 177, 251, 0.25);
    cursor: pointer;
    animation: bg-bubble-pulse 3s ease-in-out infinite;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#bg-discount-bubble.is-visible { display: flex; }
#bg-discount-bubble:hover {
    transform: scale(1.04);
    box-shadow: 0 0 32px rgba(45, 177, 251, 0.4);
}
.bg-bubble-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 100%, #2db1fb 0%, #1e76a7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bg-bubble-icon img { width: 22px; height: auto; filter: brightness(0) invert(1); }
.bg-bubble-text {
    display: flex;
    flex-direction: column;
}
.bg-bubble-tag {
    font-size: 10px;
    font-weight: 600;
    color: #2db1fb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}
.bg-bubble-label {
    font-size: 13px;
    font-weight: 700;
    color: #f5f8fa;
    line-height: 1.3;
    white-space: nowrap;
}

@keyframes bg-bubble-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(45, 177, 251, 0.25); }
    50% { box-shadow: 0 0 32px rgba(45, 177, 251, 0.5); }
}

/* Copied feedback */
.bg-popup-copy-feedback {
    font-size: 12px;
    color: #2db1fb;
    text-align: center;
    height: 16px;
    transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
    .bg-popup-title { font-size: 26px; line-height: 34px; }
    .bg-popup-title-sm { font-size: 22px; line-height: 30px; }
    .bg-popup-subheading { font-size: 18px; line-height: 26px; }
    #bg-discount-card { padding: 20px; gap: 24px; }
}
