/* =============================================================================
   SCRATCH POPUP
   ============================================================================= */

/* ── Overlay ── */
#scratch-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    width: 100vw;
    height: 100vh;
    /* Desktop: blurred frosted glass — website visible behind */
    background: rgba(30, 14, 6, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}
#scratch-popup.sp-visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Card box ── */
.sp-box {
    background: linear-gradient(135deg, #b84a10 0%, #d4691e 45%, #9e3d0e 100%);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 28px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.45);
    width: 100%;
    max-width: 460px;
    position: relative;
    overflow: hidden;
}

/* ── Close button ── */
#scratch-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 10;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
#scratch-close:hover { background: rgba(255,255,255,0.25); }

/* ── Steps ── */
.sp-step {
    width: 100%;
    padding: 52px 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}
/* CRITICAL: use visibility+opacity not display:none for steps so transitions work */
.sp-step { display: flex; }
.sp-hidden { display: none !important; }

.sp-step.sp-fade-in  { animation: spIn  0.35s ease forwards; }
.sp-step.sp-fade-out { animation: spOut 0.25s ease forwards; }
@keyframes spIn  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes spOut { from { opacity:1; } to { opacity:0; } }

/* ── Logo ── */
.sp-logo { margin-bottom: 16px; }
.sp-logo img { height: 36px; width: auto; filter: brightness(0) invert(1); }

/* ── Badge ── */
.sp-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-family: Manrope, sans-serif;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.18em; text-transform: uppercase;
    padding: 4px 14px; border-radius: 9999px;
    margin-bottom: 14px;
}

/* ── Typography ── */
.sp-heading {
    font-family: Epilogue, sans-serif;
    font-size: 28px; font-weight: 800;
    color: #fff; line-height: 1.15;
    margin: 0 0 10px;
}
.sp-sub {
    font-family: Manrope, sans-serif;
    font-size: 14px; color: rgba(255,255,255,0.82);
    margin: 0 0 24px; line-height: 1.6;
}
.sp-eyebrow {
    font-family: Manrope, sans-serif;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: rgba(255,255,255,0.65); margin: 0 0 8px;
}
.sp-reward-text {
    font-family: Epilogue, sans-serif;
    font-size: 58px; font-weight: 800;
    color: #fff; line-height: 1; margin: 0 0 6px;
}
.sp-reward-sub {
    font-family: Manrope, sans-serif;
    font-size: 13px; color: rgba(255,255,255,0.7);
    margin: 0 0 28px;
}

/* ── Canvas ── */
.sp-canvas-wrap {
    position: relative;
    width: 296px; height: 156px;
    border-radius: 18px; overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.sp-prize-reveal {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: Epilogue, sans-serif;
    font-size: 26px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg,#7a1d00,#a43716 50%,#c54f2c);
    user-select: none; gap: 4px;
}
.sp-prize-reveal span {
    font-family: Manrope, sans-serif;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.8;
}
#scratch-canvas {
    position: absolute; inset: 0;
    cursor: crosshair; touch-action: none;
}
.sp-scratch-hint {
    font-family: Manrope, sans-serif;
    font-size: 11px; color: rgba(255,255,255,0.5);
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 20px;
}

/* ── Product images ── */
.sp-products { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.sp-product-img {
    width: 68px; height: 68px; border-radius: 12px; overflow: hidden;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.2);
}
.sp-product-img img { width: 100%; height: 100%; object-fit: cover; }

/* ── CTA button ── */
.sp-btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 15px 40px;
    background: #fff; color: #a43716;
    border: none; border-radius: 9999px;
    font-family: Manrope, sans-serif;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    cursor: pointer; text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    margin-bottom: 12px;
    width: 100%; max-width: 300px;
}
.sp-btn-primary:hover { background: #ffe9e4; transform: scale(0.98); color: #832000; }

/* ── No thanks ── */
.sp-no-thanks {
    background: none; border: none;
    font-family: Manrope, sans-serif; font-size: 12px;
    color: rgba(255,255,255,0.5); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    padding: 6px; transition: color 0.2s;
}
.sp-no-thanks:hover { color: rgba(255,255,255,0.85); }

/* ── Misc ── */
.sp-success-icon { font-size: 54px; margin-bottom: 14px; line-height: 1; }
.sp-divider { width: 40px; height: 2px; background: rgba(255,255,255,0.25); border-radius: 9999px; margin: 0 auto 18px; }

/* =============================================
   FLUENT FORM — JS-built inline pill row
   ============================================= */
.sp-form-wrap { width: 100%; margin-bottom: 16px; }
.sp-form-wrap label,
.sp-form-wrap .ff-label { display: none !important; }
.sp-form-wrap .ff-message-success { display: none !important; }

/* The inline wrapper JS will create */
.sp-inline-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 50px !important;
    border-radius: 9999px !important;
    overflow: hidden !important;
    border: 1.5px solid rgba(255,255,255,0.25) !important;
}
.sp-inline-row input[type="email"],
.sp-inline-row input[type="text"] {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 50px !important;
    background: rgba(255,255,255,0.92) !important;
    border: none !important; border-radius: 0 !important;
    padding: 0 18px !important;
    font-family: Manrope, sans-serif !important;
    font-size: 13px !important; color: #1c1c19 !important;
    outline: none !important; box-shadow: none !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
}
.sp-inline-row input::placeholder { color: #8b716a !important; }
.sp-inline-row button[type="submit"],
.sp-inline-row input[type="submit"] {
    flex: 0 0 auto !important;
    height: 50px !important;
    background: #7a1d00 !important;
    color: #fff !important;
    border: none !important; border-radius: 0 !important;
    padding: 0 20px !important;
    font-family: Manrope, sans-serif !important;
    font-size: 10px !important; font-weight: 700 !important;
    letter-spacing: 0.12em !important; text-transform: uppercase !important;
    white-space: nowrap !important; cursor: pointer !important;
    transition: background 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
}
.sp-inline-row button[type="submit"]:hover { background: #a43716 !important; }

/* ── Mobile: full screen, solid orange bg ── */
@media (max-width: 600px) {
    #scratch-popup {
        padding: 0;
        align-items: flex-start;
        background: linear-gradient(135deg,#b84a10 0%,#d4691e 45%,#9e3d0e 100%);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .sp-box {
        max-width: 100%; border-radius: 0;
        box-shadow: none; border: none;
        min-height: 100svh;
        background: transparent;
    }
    .sp-step {
        padding: 60px 22px 36px;
        min-height: 100svh; justify-content: center;
    }
    .sp-heading { font-size: 24px; }
    .sp-reward-text { font-size: 46px; }
    .sp-canvas-wrap { width: 272px; height: 144px; }
    .sp-inline-row input[type="email"] { font-size: 12px !important; padding: 0 14px !important; }
    .sp-inline-row button[type="submit"] { padding: 0 14px !important; font-size: 9px !important; }
}
