/* Boas-vindas: envelope com selo de cera e uma carta em papel de carta. */
.boas-vindas { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 16px 60px; position: relative; z-index: 1; }

/* ---------- envelope ---------- */
.bv-envelope { position: relative; width: min(420px, 88vw); aspect-ratio: 1.45; margin-top: 60px; perspective: 1200px; }
.bv-env-fundo { position: absolute; inset: 0; z-index: -2; border-radius: 6px; background: #E9DCC4; box-shadow: 0 30px 50px -28px rgba(40, 25, 10, .55), 0 2px 4px rgba(0,0,0,.08); }
.bv-env-carta {
  position: absolute; left: 6%; right: 6%; top: 8%; height: 84%; z-index: 0; border-radius: 3px; background: #FFFDF7;
  box-shadow: 0 2px 4px rgba(0,0,0,.08); display: flex; align-items: flex-start; padding: 18px 22px; color: #3A3426; font-size: 24px;
  transition: transform .8s cubic-bezier(.3, .8, .3, 1) .35s;
}
.bv-env-frente {
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none; z-index: 1;
  background: linear-gradient(100deg, #E3D3B7, #EADDC5 45%, #E0CFB2);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 -1px 0 rgba(0,0,0,.06));
}
.bv-env-aba {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; transform-origin: 50% 0; z-index: 2;
  background: linear-gradient(170deg, #EFE3CC, #E0CFB0); clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.12));
  transition: transform .6s cubic-bezier(.5, 0, .3, 1), z-index 0s .3s;
}
.bv-selo {
  position: absolute; left: 50%; top: 58%; width: 74px; height: 74px; margin: -37px 0 0 -37px; z-index: 3; padding: 0; border: 0; cursor: pointer;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 35% 30%, #D2585A, #9C2129 60%, #7A161D);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.35), inset 0 3px 4px rgba(255,255,255,.25), 0 6px 10px -4px rgba(60, 10, 10, .6), 0 0 0 5px rgba(156, 33, 41, .35);
  transition: transform .4s ease, opacity .3s ease;
  animation: pulsar-selo 2.4s ease-in-out infinite;
}
.bv-selo svg { width: 60%; height: 60%; margin: 20%; display: block; }
/* o rostinho prensado na cera: tom da cera, com relevo */
.bv-selo-rosto { display: block; width: 66%; margin: 17%; mix-blend-mode: luminosity; opacity: .62; filter: contrast(1.35) brightness(1.15) drop-shadow(0 -1px 0 rgba(255,255,255,.25)) drop-shadow(0 1px 1px rgba(0,0,0,.35)); pointer-events: none; }
.bv-selo:focus-visible { outline: 3px solid var(--destaque); outline-offset: 6px; }
@keyframes pulsar-selo { 50% { transform: scale(1.05); } }
.bv-dica { position: absolute; left: 0; right: 0; bottom: -54px; text-align: center; font-size: 24px; color: var(--cor-topo, var(--tinta)); text-shadow: 0 0 12px var(--brilho-topo, transparent); }
.bv-envelope.abrindo .bv-selo { transform: scale(.6) translateY(-10px); opacity: 0; animation: none; }
.bv-envelope.abrindo .bv-env-aba { transform: rotateX(180deg); z-index: -1; }
.bv-envelope.abrindo .bv-env-carta { transform: translateY(-62%); }

/* ---------- carta ---------- */
.bv-carta {
  position: relative; width: min(640px, 100%); padding: 40px 44px 34px; border-radius: 4px; color: #3A3426;
  background:
    linear-gradient(90deg, transparent 30px, rgba(214, 90, 90, .28) 30px 31.5px, transparent 31.5px),
    #FFFDF7;
  box-shadow: 0 2px 0 #F1EADC, 0 4px 0 #E6DECC, 0 30px 50px -28px rgba(40, 25, 10, .6);
}
.bv-carta.chega { animation: chegar-carta .5s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes chegar-carta { from { transform: translateY(40px) rotate(-1.5deg); opacity: 0; } }
.bv-passo { margin: 0 0 18px; font-size: 13.5px; font-weight: 600; color: #6A604C; }
.bv-saudacao { margin: 0 0 18px; font-size: 34px; line-height: 1.2; color: #3A3426; }
.bv-linha-nome input {
  width: min(260px, 60vw); border: 0; border-bottom: 2px solid #B9AE98; background: transparent; padding: 0 4px; font: inherit; color: var(--destaque);
}
.bv-linha-nome input:focus { outline: none; border-bottom-color: var(--destaque); }
.bv-texto { margin: 0 0 12px; font-size: 16.5px; line-height: 1.6; color: #4A4234; max-width: 46ch; }
.bv-titulo { margin: 0 0 8px; font-family: 'Pacifico', serif; font-size: 28px !important; font-style: normal !important; color: #3A3426 !important; letter-spacing: 0 !important; text-transform: none !important; background: none !important; padding: 0 !important; }
.bv-botoes { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 26px; }
.bv-botoes.centro { justify-content: center; }
.bv-carta .botao-texto { color: #3A3426; }

/* mostruário de tecidos */
.bv-grupo { margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: #4A4234; }
.bv-retalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px 12px; }
.bv-retalho { position: relative; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: #3A3426; }
.bv-tecido {
  display: block; aspect-ratio: 1.15; border-radius: 0;
  clip-path: polygon(0 4%, 4% 0, 8% 4%, 12% 0, 16% 4%, 20% 0, 24% 4%, 28% 0, 32% 4%, 36% 0, 40% 4%, 44% 0, 48% 4%, 52% 0, 56% 4%, 60% 0, 64% 4%, 68% 0, 72% 4%, 76% 0, 80% 4%, 84% 0, 88% 4%, 92% 0, 96% 4%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 0 6px 10px -6px rgba(0,0,0,.4);
  transition: transform .2s ease;
}
.bv-retalho:hover .bv-tecido { transform: translateY(-2px) rotate(-1deg); }
.bv-etiqueta { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.bv-retalho.escolhido .bv-tecido { outline: 3px solid #3A3426; outline-offset: 3px; }
.bv-retalho.escolhido .bv-etiqueta::after { content: ''; display: inline-block; width: 6px; height: 11px; margin-left: 6px; border: solid var(--destaque); border-width: 0 2.5px 2.5px 0; transform: rotate(40deg) translateY(-2px); }
.bv-retalho:focus-visible { outline: 2px solid var(--destaque); outline-offset: 4px; }

/* abas como adesivos */
.bv-adesivos { display: flex; flex-wrap: wrap; gap: 12px 10px; margin-top: 16px; }
.bv-adesivo {
  position: relative; padding: 11px 18px; border: 2px dashed rgba(58, 52, 38, .35); border-radius: 12px; background: #FFFDF7;
  font: inherit; font-size: 15.5px; font-weight: 600; color: #3A3426; cursor: pointer; transform: rotate(var(--r));
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.bv-adesivo:hover { transform: rotate(var(--r)) translateY(-2px); }
.bv-adesivo.escolhido { border: 2px solid #fff; background: var(--destaque); color: var(--destaque-texto, #fff); box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 8px 12px -8px rgba(0,0,0,.45); }
.bv-ordem { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: #FFFDF7; color: #3A3426; font-size: 12px; line-height: 22px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.bv-conta { margin: 16px 0 0; font-size: 14px; color: #5A5242; }

/* fim: carimbo */
.bv-fim { text-align: center; }
.bv-fim .bv-texto { margin-left: auto; margin-right: auto; }
.bv-carimbo { width: 150px; margin: 18px auto 4px; color: #A33A3A; opacity: 0; transform: scale(2.2) rotate(-24deg); }
.bv-carimbo.carimbou { animation: carimbar-bv .55s cubic-bezier(.3, 1.6, .5, 1) .2s forwards; }
@keyframes carimbar-bv { to { opacity: .92; transform: scale(1) rotate(-10deg); } }
.bv-carimbo-texto { font-family: 'Pacifico', serif; font-size: 15px; fill: currentColor; letter-spacing: 1px; }
.bv-assinatura { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 0; font-family: 'Pacifico', cursive; font-size: 28px; color: var(--destaque); }
.bv-assinatura-rosto { width: 46px; height: auto; }

/* nas estéticas elegantes, a letra de mão da carta continua de mão */
body[data-tema] .boas-vindas .mao { font-family: 'Kalam', cursive !important; font-style: normal !important; font-weight: 400 !important; }

@media (max-width: 560px) {
  .bv-carta { padding: 30px 20px 26px 30px; background: linear-gradient(90deg, transparent 18px, rgba(214, 90, 90, .28) 18px 19.5px, transparent 19.5px), #FFFDF7; }
  .bv-saudacao { font-size: 28px; }
  .bv-retalhos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .bv-etiqueta { font-size: 12px; }
  .bv-botoes { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .bv-selo, .bv-carta, .bv-carimbo.carimbou { animation: none !important; opacity: 1; transform: none; } }
.bv-tecido.previa { height: auto; border-radius: 0; }
.bv-tecido.previa::after { display: none; }
