/* ================================================================
   Conversion Popup — three-stage reveal
   Stage 1: Loading ring (0→100%)
   Stage 2: Unlock seal + button
   Stage 3: Offer reveal + countdown + CTA
   ================================================================ */

.cv-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cv-overlay.cv-open {
    display: flex;
    opacity: 1;
}

.cv-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.08);
    animation: cvSlideUp 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: 'Poppins', sans-serif;
}
@keyframes cvSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Progress bar across the top — persists across stages */
.cv-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(212, 32, 32, 0.1);
    z-index: 2;
}
.cv-progress-fill {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, #d42020 0%, #e8b830 100%);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(232, 184, 48, 0.4);
}

/* Close button — subtle during stages 1-2, prominent at 3 */
.cv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.06);
    color: #57534e;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cv-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}
.cv-card[data-stage="2"] .cv-close { opacity: 0.6; }
.cv-card[data-stage="3"] .cv-close { opacity: 1; }

/* Stage containers */
.cv-stage {
    padding: 2.25rem 1.75rem 1.75rem;
    text-align: center;
}
.cv-stage[hidden] { display: none; }

.cv-stage-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1c1917;
    margin: 1rem 0 0.25rem;
    letter-spacing: -0.005em;
}
.cv-stage-sub {
    font-size: 0.8rem;
    color: #78716c;
    margin: 0;
    line-height: 1.45;
    min-height: 1.2em;
}

/* ─── Stage 1: Loading ring ─────────────────────────────────── */
.cv-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 0.25rem;
    animation: cvRingAppear 0.5s ease-out;
}
@keyframes cvRingAppear {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}
.cv-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.cv-ring-track {
    fill: none;
    stroke: #f3f4f6;
    stroke-width: 6;
}
.cv-ring-fill {
    fill: none;
    stroke: url(#cvGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 50ms linear;
    filter: drop-shadow(0 0 6px rgba(212, 32, 32, 0.3));
}
/* Warmup: indeterminate "scanning" arc rotating before real progress starts */
.cv-ring-scan {
    fill: none;
    stroke: url(#cvGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 55 285;
    stroke-dashoffset: 0;
    transform-origin: 60px 60px;
    animation: cvRingScan 1.1s linear infinite;
    filter: drop-shadow(0 0 6px rgba(212, 32, 32, 0.25));
    opacity: 1;
    transition: opacity 0.25s ease;
}
.cv-ring--progressing .cv-ring-scan { opacity: 0; }
@keyframes cvRingScan {
    to { transform: rotate(360deg); }
}
.cv-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #d42020;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}
.cv-ring-pct--pulsing {
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    animation: cvPctPulse 0.9s ease-in-out infinite alternate;
}
@keyframes cvPctPulse {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

/* ─── Stage 2: Unlock seal ──────────────────────────────────── */
.cv-seal-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cv-seal {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fef3c7, #e8b830 65%, #b88810 100%);
    box-shadow:
        inset 0 -3px 6px rgba(122, 85, 10, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        0 6px 20px rgba(212, 32, 32, 0.22),
        0 0 0 2px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a1a20;
    font-size: 2.2rem;
    animation: cvSealPulse 1.8s ease-in-out infinite;
    position: relative;
    z-index: 2;
}
/* Two overlapping icons — locked shown by default, open revealed on unlock. */
.cv-seal-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    line-height: 1;
}
.cv-seal-icon--open {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(-45deg);
}
.cv-seal.cv-seal--unlocking { animation: cvSealJolt 0.45s ease-out; }
.cv-seal.cv-seal--unlocking .cv-seal-icon--locked {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(25deg);
}
.cv-seal.cv-seal--unlocking .cv-seal-icon--open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(0deg);
}
@keyframes cvSealJolt {
    0%   { transform: rotate(0deg); }
    30%  { transform: rotate(-8deg) scale(1.08); }
    55%  { transform: rotate(6deg) scale(1.12); }
    80%  { transform: rotate(-3deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1.08); }
}

.cv-seal-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 184, 48, 0.35) 0%, transparent 60%);
    animation: cvSealGlow 2.4s ease-in-out infinite;
    z-index: 1;
}
.cv-seal-wrap.cv-unlocking .cv-seal-glow {
    animation: cvSealGlowBurst 0.6s ease-out;
}
@keyframes cvSealPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}
@keyframes cvSealGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.25); opacity: 1; }
}
@keyframes cvSealGlowBurst {
    0%   { transform: scale(1); opacity: 0.6; }
    50%  { transform: scale(2); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Seal break — happens AFTER the lock has opened */
.cv-seal.cv-seal--breaking {
    animation: cvSealBreak 0.5s ease-in 0s forwards;
}
@keyframes cvSealBreak {
    0%   { transform: scale(1.08) rotate(0deg); opacity: 1; }
    40%  { transform: scale(1.25) rotate(-4deg); opacity: 0.9; }
    100% { transform: scale(0) rotate(12deg); opacity: 0; }
}

.cv-unlock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #d42020 0%, #b91c1c 100%);
    color: #ffffff;
    border: 0;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(212, 32, 32, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.cv-unlock-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: cvShimmer 2.4s infinite;
}
.cv-unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 28px rgba(212, 32, 32, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.cv-unlock-btn:active { transform: translateY(0); }
@keyframes cvShimmer {
    0%   { left: -100%; }
    60%  { left: 120%; }
    100% { left: 120%; }
}

/* Gold particles on unlock */
.cv-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
}
.cv-particles.cv-particles--burst { opacity: 1; }
.cv-particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fef3c7, #e8b830);
    box-shadow: 0 0 6px rgba(232, 184, 48, 0.8);
    animation: cvParticle 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
@keyframes cvParticle {
    0%   { transform: translate(0, 0) scale(0); opacity: 0; }
    20%  { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.1); opacity: 1; }
    100% { transform: translate(calc(var(--dx, 0) * 2.5), calc(var(--dy, 0) * 2.5 + 30px)) scale(0.3); opacity: 0; }
}

/* ─── Stage 3: Reveal ───────────────────────────────────────── */
.cv-reveal-eyebrow {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d42020;
    margin-bottom: 0.5rem;
}
.cv-reveal-big {
    font-family: 'Exo 2', sans-serif;
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #d42020 0%, #e8b830 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    animation: cvBigPop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.1s both;
}
@keyframes cvBigPop {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}
.cv-reveal-big-sub {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #44403c;
    margin-bottom: 1rem;
}

.cv-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    background: linear-gradient(180deg, #fff8e6 0%, #fdf4d8 100%);
    border: 1px solid #e8b830;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #44403c;
}
.cv-example strong {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.05rem;
    color: #7a1a20;
    font-weight: 700;
}
.cv-example-arrow {
    color: #b88810;
    font-size: 0.9rem;
}

.cv-timer-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.75rem;
    background: rgba(212, 32, 32, 0.06);
    border: 1px solid rgba(212, 32, 32, 0.18);
    border-radius: 999px;
    font-size: 0.75rem;
    color: #7a1a20;
    margin-bottom: 1.125rem;
    font-weight: 500;
}
.cv-timer {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    color: #d42020;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    min-width: 64px;
}

/* Phone input (stage 3) */
.cv-phone-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.375rem 0.6rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    box-sizing: border-box;
}
.cv-phone-wrap:focus-within {
    border-color: #d42020;
    box-shadow: 0 0 0 3px rgba(212, 32, 32, 0.1);
}
.cv-phone-wrap .iti {
    display: flex;
    width: 100%;
}
.cv-phone-wrap .iti input.cv-phone-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}
.cv-phone-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    padding: 0.45rem 0;
}
.cv-phone-wrap.cv-phone-wrap--error {
    border-color: #dc2626;
    animation: cvShake 0.35s ease-in-out;
}
@keyframes cvShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* intl-tel-input appends its country-list dropdown to document.body
   (via dropdownContainer option). Its default z-index (~1060) is lower
   than our popup overlay (9999), so without this override the dropdown
   opens but is covered by the backdrop and can't be clicked. */
.iti--container {
    z-index: 10001 !important;
}

.cv-claim-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9375rem 1rem;
    background: linear-gradient(135deg, #d42020 0%, #b91c1c 100%);
    color: #ffffff;
    border: 0;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 6px 22px rgba(212, 32, 32, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.cv-claim-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: cvShimmer 2.8s infinite;
}
.cv-claim-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow:
        0 10px 30px rgba(212, 32, 32, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cv-trust {
    margin-top: 0.875rem;
    font-size: 0.7rem;
    color: #a8a29e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.cv-trust i { color: #16a34a; }

/* Mobile tightening */
@media (max-width: 480px) {
    .cv-card { max-width: 380px; border-radius: 16px; }
    .cv-stage { padding: 1.75rem 1.25rem 1.375rem; }
    .cv-ring, .cv-seal-wrap { width: 104px; height: 104px; }
    .cv-seal { width: 80px; height: 80px; font-size: 1.95rem; }
    .cv-ring-pct { font-size: 1.4rem; }
    .cv-reveal-big { font-size: 2.75rem; }
    .cv-reveal-big-sub { font-size: 0.875rem; }
    .cv-example { font-size: 0.8rem; padding: 0.625rem 0.75rem; }
    .cv-stage-title { font-size: 1.05rem; }
}
