#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: 20px;
    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;
}

/* 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: 8px;
    padding: 12px 20px;
    border-radius: 9999px;
    border: none;
    border-top: 1px solid var(--blue);
    background: #082035;
    box-shadow:
        0px -4px 10px 0px rgba(45, 177, 251, 0.1),
        0px 4px 10px 2px rgba(45, 177, 251, 0.1),
        inset 0px 0px 0px 1px rgba(12, 14, 18, 0.18),
        inset 0px -2px 0px 0px rgba(12, 14, 18, 0.05);
    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:
        0px -4px 14px 0px rgba(45, 177, 251, 0.18),
        0px 4px 14px 2px rgba(45, 177, 251, 0.18),
        inset 0px 0px 0px 1px rgba(12, 14, 18, 0.18),
        inset 0px -2px 0px 0px rgba(12, 14, 18, 0.05);
}
#bg-bubble-open-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #a3c4e0;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    cursor: pointer;
    white-space: nowrap;
}
#bg-bubble-dismiss-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
#bg-bubble-dismiss-btn:hover { opacity: 1; }

/* 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; }
}
