/* ============================================================
   CONVITE DIGITAL INTERATIVO 3D • LAURA BEATRIZ XV
   100% Responsivo Mobile & Desktop + Limite de Compartilhamento
   ============================================================ */

:root {
  --bg-dark: #12040a;
  --rose-gold: #d48b98;
  --gold-primary: #d4af37;
  --text-dark: #4a2831;
  --door-w-left: 62.8472%;
  --door-w-right: 37.1528%;
  --img-w-left: 159.115%;
  --img-w-right: 269.158%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: radial-gradient(circle at 50% 30%, #280d19 0%, #14050d 55%, #080105 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  overscroll-behavior-y: auto;
}

/* Container do Celular (100dvh) */
.story-viewport {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* O Canvas do Convite mantém rigorosamente a proporção 9:16 (576 x 1024) */
.invite-card-canvas {
  width: 100%;
  max-width: min(480px, calc(100dvh * 576 / 1024));
  height: 100%;
  max-height: min(100dvh, calc(100vw * 1024 / 576));
  aspect-ratio: 576 / 1024;
  position: relative;
  overflow: hidden;
  perspective: 1400px;
  background: #fdf2f4;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

@media (min-width: 500px) and (min-height: 700px) {
  .invite-card-canvas {
    border-radius: 18px;
  }
}

/* Camada de Brilhos Flutuantes */
.sparkles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  background: radial-gradient(circle, #ffffff 0%, rgba(253, 224, 71, 0.8) 50%, transparent 80%);
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.7));
  animation: floatSparkle infinite ease-in-out;
}

@keyframes floatSparkle {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  30% { opacity: 0.85; }
  70% { opacity: 0.85; }
  100% { transform: translateY(-100vh) scale(1.1); opacity: 0; }
}

/* Botão de Som Discreto no Topo Direito (🔊 / 🔇) */
.icon-audio-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--gold-primary);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.icon-audio-btn:active {
  transform: scale(0.92);
}

.icon-audio-btn.playing i {
  animation: rotateSound 4s linear infinite;
  color: var(--gold-primary);
}

@keyframes rotateSound {
  100% { transform: rotate(360deg); }
}

/* ============================================================
   PORTAS 3D DO CONVITE (MATEMATICAMENTE ENCAIXADAS + SELO INTEIRO)
   ============================================================ */
.gatefold-doors-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: visibility 1.2s ease;
}

.gatefold-doors-container.opened {
  pointer-events: none;
  visibility: hidden;
  transition-delay: 1.2s;
}

/* Folha Esquerda (Abre em 3D para a esquerda) */
.door-panel-left {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--door-w-left);
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.35, 1);
  z-index: 3;
  box-shadow: 6px 0 20px rgba(0, 0, 0, 0.25);
}

.door-slice-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.door-panel-left .door-img-slice {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--img-w-left);
  height: 100%;
  max-width: none !important;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* O Selo / Lacre de Cera 100% Inteiro e Sobreposto */
.wax-seal-overlap {
  position: absolute;
  top: 57.6%;
  right: 0;
  transform: translate(50%, -50%);
  width: 76px;
  height: 76px;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  animation: sealPulse 2.5s infinite ease-in-out;
}

.wax-seal-overlap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes sealPulse {
  0%, 100% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(50%, -50%) scale(1.05); }
}

/* Folha Direita (Abre em 3D para a direita) */
.door-panel-right {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--door-w-right);
  height: 100%;
  transform-origin: right center;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.35, 1);
  z-index: 1;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.door-panel-right .door-img-slice {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--img-w-right);
  height: 100%;
  max-width: none !important;
  object-fit: cover;
  object-position: right center;
  display: block;
}

/* Abertura 3D das Folhas */
.gatefold-doors-container.opened .door-panel-left {
  transform: rotateY(-125deg);
}

.gatefold-doors-container.opened .door-panel-right {
  transform: rotateY(125deg);
}

/* Dica de Toque sobre a Capa (Mais delicado e elegante) */
.door-tap-hint {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-dark);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), 0 0 8px rgba(212, 175, 55, 0.25);
  animation: bounceHint 1.8s infinite ease-in-out;
  z-index: 20;
  pointer-events: none;
}

.door-tap-hint i {
  font-size: 0.9rem;
  color: var(--gold-primary);
}

@keyframes bounceHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 5px); }
}

/* ============================================================
   SEQUÊNCIA DE TELAS APÓS ABERTURA (SLIDE 1, 2 e 3)
   ============================================================ */
.slides-sequence-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #fdf2f4;
}

.slide-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.97);
  cursor: pointer;
}

.slide-screen.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* Indicador de Próxima Página / Toque (Mais compacto, linha única sem quebra) */
.slide-tap-next {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-dark);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 30px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  pointer-events: none;
  animation: bounceHint 1.8s infinite ease-in-out;
  max-width: 90%;
}

.slide-tap-next i {
  font-size: 0.75rem;
  color: var(--gold-primary);
}

/* ============================================================
   SLIDE 3: O CONVITE OFICIAL COM BOTÕES 100% TRANSPARENTES
   ============================================================ */
.slide-official-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.hotspot-map-btn {
  position: absolute;
  top: 81.25%;
  left: 10.38%;
  width: 38.06%;
  height: 5.66%;
  background: transparent;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  outline: none;
  z-index: 20;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hotspot-rsvp-btn {
  position: absolute;
  top: 81.25%;
  left: 51.55%;
  width: 38.06%;
  height: 5.66%;
  background: transparent;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  outline: none;
  z-index: 20;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hotspot-map-btn:active,
.hotspot-rsvp-btn:active {
  transform: scale(0.96);
  background: rgba(184, 78, 104, 0.1);
}

/* ============================================================
   TELA DE LIMITE DE COMPARTILHAMENTO ATINGIDO (BLOQUEIO DE LUXO)
   ============================================================ */
.limit-reached-screen {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 30%, #2d0e1d 0%, #15050e 60%, #080105 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.limit-reached-screen.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.limit-card-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--gold-primary);
  border-radius: 24px;
  padding: 34px 22px;
  backdrop-filter: blur(12px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 380px;
}

.limit-icon-lock {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #fcf6ba, #bf953f);
  color: #3b1722;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.6);
}

.limit-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.limit-message-text {
  font-size: 0.9rem;
  color: #fcecef;
  line-height: 1.6;
}

.btn-contact-organizer {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s;
  margin-top: 6px;
}

.btn-contact-organizer:active {
  transform: scale(0.96);
}

/* ============================================================
   MODAIS INTERATIVOS (WHATSAPP & MAPA)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 6, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 370px;
  background: linear-gradient(165deg, #ffffff, #fff2f5);
  border: 1.5px solid var(--gold-primary);
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.3);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-dark);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: #a0495f;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.modal-desc {
  font-size: 0.88rem;
  color: #633644;
  line-height: 1.5;
  margin-bottom: 16px;
}

.form-group {
  text-align: left;
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: #8f5060;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid #e09f9f;
  background: #ffffff;
  color: #4a2831;
  font-size: 0.95rem;
  outline: none;
  font-family: 'Montserrat', sans-serif;
}

.btn-modal-action {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
  margin-top: 10px;
}

.btn-modal-action:active {
  transform: scale(0.97);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: 1px solid #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-maps {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid #38bdf8;
}

.btn-waze {
  background: #33ccff;
  color: #020d18;
}
