/* Popup "Você ganhou 5% OFF" (coupon-popup.js) — mesmo desenho do popup do Smarth Turbo
   nas cores do Modão de Ouro (couro/café + dourado). */
.cpn {
    width: min(90vw, 360px);
    max-height: 92vh;
    margin: auto;
    padding: 24px 20px 14px;
    border: 1px solid rgba(255, 225, 74, 0.35);
    border-radius: 18px;
    background: radial-gradient(120% 70% at 50% 0%, #3D1A7A 0%, #170833 60%, #07060c 100%);
    color: #F1ECFA;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.cpn.is-open { opacity: 1; transform: none; }
.cpn:focus { outline: none; }
/* Fundo escuro sólido (sem blur): o desfoque redesenhava a página rolando atrás e criava
   o efeito de "dobra/duplicado". A página fica travada enquanto o popup está aberto. */
.cpn::backdrop { background: rgba(0, 0, 0, 0.72); }
html.cpn-lock,
html.cpn-lock body { overflow: hidden; overscroll-behavior: none; }
.cpn { overscroll-behavior: contain; }

.cpn button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cpn .cpn-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #B9AED6;
}
.cpn .cpn-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Logo + presente animado */
.cpn-logo { display: block; width: 170px; height: auto; margin: 2px auto 14px; }
.cpn-gift {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 225, 74, 0.16);
    border: 1px solid rgba(255, 225, 74, 0.45);
    color: #FFE14A;
}
.cpn-gift svg { width: 30px; height: 30px; animation: cpnGift 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes cpnGift {
    0%, 55%, 100% { transform: rotateY(0) translateY(0); }
    15% { transform: rotateY(180deg) translateY(-4px); }
    30% { transform: rotateY(360deg) translateY(0); }
    40% { transform: rotate(-8deg); }
    48% { transform: rotate(8deg); }
}

.cpn-title {
    margin: 14px 0 6px;
    font-size: clamp(1.35rem, 6vw, 1.6rem);
    font-weight: 850;
    line-height: 1.14;
    letter-spacing: -0.035em;
    color: #fff;
}
.cpn-title span { color: #FFE14A; }
/* Validade em vermelho, com a data de hoje */
.cpn-valid { margin: 0; font-size: 14px; font-weight: 800; color: #FF6B5E; }

/* Cupom compacto */
.cpn-ticket {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 14px auto;
    max-width: 250px;
    padding: 9px 12px;
    border: 1.5px dashed #FFE14A;
    border-radius: 10px;
    background: rgba(255, 225, 74, 0.12);
}
.cpn-ticket-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #FFE14A; }
.cpn-ticket-code { font-size: 1.2rem; font-weight: 900; letter-spacing: 0.12em; color: #fff; line-height: 1.25; }
.cpn-ticket-note { font-size: 11.5px; color: #5B5470; }

/* Mesmo verde do botão da oferta */
.cpn .cpn-cta {
    width: 100%;
    min-height: 52px;
    border-radius: 10px;
    background: linear-gradient(180deg, #1a9461, #147c4e);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: filter 0.15s ease;
}
.cpn .cpn-cta:hover { filter: brightness(1.08); }
.cpn .cpn-decline {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #8E83AC;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cpn .cpn-decline:hover { color: #4A4260; }

/* Destaque rápido no card da oferta depois de aceitar */
.cpn-highlight { animation: cpnPulse 1.3s ease 2; }
@keyframes cpnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 225, 74, 0); }
    50% { box-shadow: 0 0 0 6px rgba(255, 225, 74, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
    .cpn { transition: none; }
    .cpn-gift svg,
    .cpn-highlight { animation: none; }
}

/* ==========================================================
   Versão clara (01/10): popup branco, X fácil de tocar,
   confirmação "Cupom ativado" com confete.
   ========================================================== */
.cpn {
    padding: 26px 20px 14px;
    border: 0;
    background: #fff;
    color: #3B2A1E;
    box-shadow: 0 24px 64px rgba(18, 6, 42, 0.35);
}
.cpn::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, #A3175A, #FFE14A, #A3175A);
}
.cpn::backdrop { background: rgba(18, 6, 42, 0.62); }

.cpn .cpn-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #F1EDF7;
    color: #3D1A7A;
    transition: background 0.15s ease, transform 0.15s ease;
}
.cpn .cpn-close svg { width: 18px; height: 18px; }
.cpn .cpn-close:hover { background: #E4DAF2; color: #12062A; }
.cpn .cpn-close:active { transform: scale(0.92); }
/* Área de toque maior que o círculo */
.cpn .cpn-close::after { content: ""; position: absolute; inset: -6px; }

.cpn-logo { width: 150px; margin: 4px auto 14px; }
.cpn-gift { background: #F6EEFF; border: 1px solid #DCCBF5; color: #C2185B; }
.cpn-title { color: #12062A; }
.cpn-title span { color: #2dbb2f; }
.cpn-valid { color: #D9433A; }
.cpn-ticket { border-color: #FFE14A; background: #FBF8FF; }
.cpn-ticket-label { color: #A3175A; }
.cpn-ticket-code { color: #12062A; }
.cpn-ticket-note { color: #5B5470; }
.cpn .cpn-cta {
    background: #2dbb2f;
    border: 1px solid #39C43C;
    box-shadow: 0 4px 0 #208622;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease;
}
.cpn .cpn-cta:hover { filter: none; background: #28a92a; }
.cpn .cpn-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 #208622; }
.cpn .cpn-decline { margin-top: 10px; color: #8E83AC; }
.cpn .cpn-decline:hover { color: #12062A; }

/* ---------- Confirmação "Cupom ativado" ---------- */
.cpn-ok {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(18, 6, 42, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.cpn-ok.is-open { opacity: 1; }
.cpn-ok-card {
    width: min(100%, 320px);
    padding: 26px 22px 18px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 20px 50px rgba(18, 6, 42, 0.3);
    transform: translateY(16px) scale(0.94);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.cpn-ok.is-open .cpn-ok-card { transform: none; }
.cpn-ok-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2dbb2f;
    color: #fff;
    box-shadow: 0 0 0 7px #E6F7E6;
}
.cpn-ok-icon svg { width: 30px; height: 30px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.cpn-ok.is-open .cpn-ok-icon svg { animation: cpnTick 0.45s 0.2s ease forwards; }
@keyframes cpnTick { to { stroke-dashoffset: 0; } }
.cpn-ok-title { display: block; font-size: 1.25rem; font-weight: 850; letter-spacing: -0.02em; color: #12062A; }
.cpn-ok-text { margin: 6px 0 16px; font-size: 0.95rem; line-height: 1.45; color: #4A4260; }
.cpn-ok-text b { color: #12062A; }
.cpn-ok-btn {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: #12062A;
    color: #F1ECFA;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}
.cpn-ok-btn:hover { background: #23104A; }
.cpn-confetti { position: fixed; inset: 0; z-index: 10001; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    .cpn-ok, .cpn-ok-card { transition: none; }
    .cpn-ok-icon svg { stroke-dashoffset: 0; animation: none; }
}
