/* Selo da fralda conforto (bebês e maternidade).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): rótulo e botões; pacote menta,
 * pastéis e ouro em hex direto. Nunca azul.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - Zoom e anel são JS, pelo relógio; aqui o contorno dourado e a medalha que
 *    abre (prêmio) ou a câmera voltando e os benefícios do selo (sem prêmio).
 *  - Selo em (100,70) do viewBox → 62,5% / 63,6%.
 */

.fd__palco {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 16 / 11;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 35%, #FBFDF9, var(--jg-eaf3ec, #EAF3EC) 65%, var(--jg-dceae0, #DCEAE0));
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35);
    user-select: none;
    font-family: Arial, sans-serif;
}
.fd__camera { position: absolute; inset: 0; transform-origin: 62.5% 63.6%; }
.fd__cena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.fd__selo-ouro { opacity: 0; }
.fd--premiou .fd__selo-ouro { animation: fd-ouro .5s ease-out forwards; }
@keyframes fd-ouro { to { opacity: 1; filter: drop-shadow(0 0 2px #F4D77A); } }

.fd__selo-destaque { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.fd--consolo .fd__selo-destaque { animation: fd-destaque 1.2s .5s ease-out forwards; }
@keyframes fd-destaque { 0% { opacity: 0; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } 100% { opacity: .9; transform: scale(1); } }

/* sem prêmio: a câmera volta e o pacote se estabiliza */
.fd--consolo .fd__camera { animation: fd-volta .8s ease-in-out forwards; }
@keyframes fd-volta { to { transform: scale(1); } }

/* ---------------- medalha (só no prêmio) ---------------- */

.fd__medalha {
    position: absolute;
    left: 62.5%; top: 63.6%;
    width: 44%; aspect-ratio: 1;
    transform: translate(-50%, -50%) scale(.72);
    opacity: 0;
    z-index: 6;
}
.fd__fitas::before, .fd__fitas::after {
    content: '';
    position: absolute;
    top: 62%;
    width: 26%; height: 50%;
    background: linear-gradient(180deg, #F2BFA2, #E8A888);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.fd__fitas::before { left: 22%; transform: rotate(14deg); }
.fd__fitas::after  { right: 22%; transform: rotate(-14deg); }
.fd__disco {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #FFF8E1, #F7E7B4 55%, #E9CD78);
    box-shadow: 0 0 0 4px #D4AF37, 0 0 0 6px #F4D77A, 0 0 24px 8px rgba(244, 215, 122, .6), 0 14px 24px -8px rgba(90, 60, 20, .5);
}
.fd__miolo {
    position: absolute; inset: 12%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-align: center;
}
.fd__miolo b { font: italic 700 clamp(10px, 2.8vw, 14px)/1 Georgia, serif; color: #8A5A10; }
.fd__miolo img { width: 32%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid #D4AF37; background: #fff; }
.fd__miolo small { font: 700 clamp(7px, 1.8vw, 9px)/1 Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #9A6A40; }
.fd__miolo span { font: 700 clamp(11px, 3vw, 15px)/1.1 Arial, sans-serif; color: #5A3A20; overflow-wrap: anywhere; }
.fd__porta {
    position: absolute; top: 0; bottom: 0; width: 50%;
    background: radial-gradient(circle at 100% 50%, #F8E8B0, #E6C766 70%, #D4AF37);
}
.fd__porta--e { left: 0; border-radius: 999px 0 0 999px; transform-origin: 0 50%; box-shadow: inset -1px 0 0 #B8922A; }
.fd__porta--d { right: 0; border-radius: 0 999px 999px 0; transform-origin: 100% 50%; background: radial-gradient(circle at 0 50%, #F8E8B0, #E6C766 70%, #D4AF37); box-shadow: inset 1px 0 0 #B8922A; }
.fd__porta::after { content: '★'; position: absolute; top: 50%; transform: translateY(-50%); font-size: clamp(14px, 4vw, 22px); color: #FFF3C4; }
.fd__porta--e::after { right: 8%; }
.fd__porta--d::after { left: 8%; }
.fd--premiou .fd__medalha { animation: fd-medalha .8s .45s cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes fd-medalha {
    0%   { left: 62.5%; top: 63.6%; transform: translate(-50%, -50%) scale(.72); opacity: 0; }
    20%  { opacity: 1; }
    100% { left: 50%; top: 46%; transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.fd--premiou .fd__porta--e { animation: fd-porta-e .7s 1.3s ease-in-out forwards; }
.fd--premiou .fd__porta--d { animation: fd-porta-d .7s 1.3s ease-in-out forwards; }
@keyframes fd-porta-e { to { transform: perspective(500px) rotateY(-100deg); opacity: 0; } }
@keyframes fd-porta-d { to { transform: perspective(500px) rotateY(100deg); opacity: 0; } }

.fd__faiscas { position: absolute; left: 50%; top: 46%; width: 0; height: 0; z-index: 7; pointer-events: none; }
.fd__faiscas i {
    position: absolute; left: 0; top: 0;
    width: 10px; height: 10px; margin: -5px 0 0 -5px;
    background: #FFF1B8;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, .95));
    opacity: 0;
}
.fd__faiscas i:nth-child(1) { --dx: -150px; --dy: -50px; }
.fd__faiscas i:nth-child(2) { --dx: 150px;  --dy: -56px; animation-delay: .05s; }
.fd__faiscas i:nth-child(3) { --dx: -160px; --dy: 40px;  animation-delay: .1s; }
.fd__faiscas i:nth-child(4) { --dx: 160px;  --dy: 46px;  animation-delay: .07s; }
.fd__faiscas i:nth-child(5) { --dx: -60px;  --dy: -110px; animation-delay: .12s; }
.fd__faiscas i:nth-child(6) { --dx: 70px;   --dy: -104px; animation-delay: .03s; }
.fd--premiou .fd__faiscas i { animation: fd-faisca 1s 1.4s ease-out forwards; }
@keyframes fd-faisca {
    0%   { transform: translate(0, 0) scale(.3) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(60deg); opacity: .9; }
}

/* ---------------- benefícios do selo padrão (só sem prêmio) ---------------- */

.fd__beneficios {
    position: absolute;
    right: 3%; top: 14%;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    z-index: 6;
}
.fd__beneficios span {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--jg-a8d2bd, #A8D2BD);
    box-shadow: 0 4px 10px -6px rgba(var(--jg-rgb-28503c, 40,80,60), .4);
    font: 700 clamp(9px, 2.4vw, 11px)/1 Arial, sans-serif;
    color: var(--jg-2f6b4f, #2F6B4F);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(16px);
}
.fd__beneficios span::before { content: '✓'; color: #FFFFFF; background: var(--jg-6cc49a, #6CC49A); border-radius: 50%; width: 13px; height: 13px; display: inline-grid; place-items: center; font-size: 9px; }
.fd--consolo .fd__beneficios span { animation: fd-chip .45s ease-out forwards; }
.fd--consolo .fd__beneficios span:nth-child(1) { animation-delay: .7s; }
.fd--consolo .fd__beneficios span:nth-child(2) { animation-delay: .85s; }
.fd--consolo .fd__beneficios span:nth-child(3) { animation-delay: 1s; }
@keyframes fd-chip { to { opacity: 1; transform: translateX(0); } }

.fd__rotulo {
    position: absolute;
    left: 2%; bottom: 2%;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--jg-14532d, #14532d);
    border: 1px solid #C9A227;
    font: 700 10px/1 Arial, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #FFF3C4;
    white-space: nowrap;
    z-index: 8;
}
.fd__rotulo img { width: 12px; height: 12px; }

/* ---------------- botão e mensagem ---------------- */

.fd__botao {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 10px auto 0;
    padding: 12px 10px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--jg-2aa152, #2AA152), var(--jg-0a7a00, #0A7A00));
    color: #fff;
    font: 700 15px/1.2 Arial, sans-serif;
    letter-spacing: .02em;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 6px 14px -6px rgba(var(--jg-rgb-0a7a00, 10,122,0), .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.fd__botao:hover:not(:disabled) { filter: brightness(1.06); }
.fd__botao:disabled { opacity: .55; cursor: default; }

.fd__msg {
    max-width: 480px;
    min-height: 56px;
    margin: 10px auto 0;
    padding: 8px 12px;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    text-align: center;
    font: 700 clamp(11px, 3vw, 14px)/1.35 Arial, sans-serif;
    color: #46564c;
    background: var(--jg-eef4ef, #EEF4EF);
    border: 1px solid var(--jg-dce6de, #DCE6DE);
}
.fd__msg--premiado { background: var(--jg-e3f5e6, #E3F5E6); border-color: var(--jg-9fd8ab, #9FD8AB); color: var(--jg-14532d, #14532d); }
.fd__msg--consolo  { background: #F1F3F1; border-color: #CDD5CE; color: #4F5A52; }
.fd__msg b { color: var(--jg-0a7a00, #0A7A00); }
.fd__msg--consolo b { color: #5C6B60; }

/* ---------------- vitrine ---------------- */

.fd__premios {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    margin: 14px auto 0; max-width: 640px;
}
.fd__titulo-vitrine {
    width: 100%; text-align: center;
    font: 700 13px/1.3 Arial, sans-serif; color: var(--jg-14532d, #14532d); margin-bottom: 2px;
}
.fd__premio { width: 74px; text-align: center; font: 600 10px/1.2 Arial, sans-serif; color: #46564c; }
.fd__premio img { width: 100%; border-radius: 6px; display: block; margin-bottom: 3px; }

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .fd--premiou .fd__selo-ouro { animation: none; opacity: 1; }
    .fd--consolo .fd__selo-destaque { animation: none; opacity: .9; }
    .fd--consolo .fd__camera { animation: none; transform: scale(1) !important; }   /* o JS escreve o zoom inline */
    .fd--premiou .fd__medalha { animation: none; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(1); opacity: 1; }
    .fd--premiou .fd__porta--e, .fd--premiou .fd__porta--d { animation: none; opacity: 0; }
    .fd--premiou .fd__faiscas i { animation: none; opacity: .9; transform: translate(var(--dx), var(--dy)) scale(1) rotate(60deg); }
    .fd--consolo .fd__beneficios span { animation: none; opacity: 1; transform: none; }
}
