:root {
  --bg-pergaminho: #efe7d6;
  --borda-cartao: #d9ccb2;
  --oliva-arte: #777424;
  --oliva-escuro: #5c5a18;
  --rosa-suave: #f5c2db;
  --vinho-placa: #6b2420;
  --texto-escuro: #2c251c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 50% 20%, #f8f3e8 0%, var(--bg-pergaminho) 72%, #e4d9c3 100%);
  color: var(--texto-escuro);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pagina-convite {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}

.convite-palco {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  container-type: inline-size;
  border-radius: 24px;
  overflow: hidden;
  background-color: #f3ede0;
  border: 1px solid var(--borda-cartao);
  box-shadow: 0 24px 60px -20px rgba(62, 48, 28, 0.38);
  user-select: none;
}

.tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.97);
  transition:
    opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.36s;
}

.tela.ativa {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.arte-convite {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =====================================================
   TELA 1: CAPA INTERATIVA ("Toque para abrir")
   ===================================================== */
.area-abrir-capa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.area-abrir-capa:focus-visible {
  outline: 4px solid var(--vinho-placa);
  outline-offset: -4px;
}

.realce-placa {
  position: absolute;
  left: 46%;
  top: 36.5%;
  width: 39%;
  height: 26.5%;
  border-radius: 18px;
  border: 2px solid rgba(245, 194, 219, 0.45);
  box-shadow: 0 0 0 0 rgba(245, 194, 219, 0.45);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  animation: pulsar-capa 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.area-abrir-capa:hover .realce-placa {
  border-color: rgba(245, 194, 219, 0.9);
  background-color: rgba(245, 194, 219, 0.1);
}

.area-abrir-capa:active .realce-placa {
  transform: scale(0.96);
}

@keyframes pulsar-capa {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

/* =====================================================
   TELA 2: DATA, HORÁRIO E BOTÕES CLICÁVEIS
   ===================================================== */
.data-esquerda,
.data-direita,
.horario-centro {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.data-esquerda {
  left: 10%;
  top: 43.4%;
  width: 29%;
}

.data-direita {
  left: 61%;
  top: 42.3%;
  width: 29.5%;
  gap: 0.4cqw;
}

.horario-centro {
  left: 22%;
  top: 54.4%;
  width: 56%;
}

.texto-oliva-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 6.1cqw;
  line-height: 1.05;
  color: #848129;
  letter-spacing: -0.01em;
  text-shadow:
    0 1px 0 rgba(255, 252, 244, 0.8),
    1px 2px 3px rgba(46, 40, 26, 0.18);
}

.texto-ano {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 4.5cqw;
  line-height: 1;
  color: #726f21;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 252, 244, 0.8);
}

.texto-horario {
  font-size: 6.4cqw;
  color: #7f7c26;
}

/* Os 3 botões clicáveis alinhados com os ícones originais */
.botao-convite {
  position: absolute;
  top: 63.2%;
  width: 24.4%;
  height: 17.6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.botao-convite:hover {
  transform: scale(1.04);
}

.botao-convite:active {
  transform: scale(0.95);
}

.botao-convite:focus-visible {
  outline: 2px solid var(--oliva-escuro);
  outline-offset: 2px;
}

.botao-localizacao {
  left: 10.6%;
}

.botao-confirmar {
  left: 37.8%;
}

.botao-presente {
  left: 65%;
}

.anel-botao {
  margin-top: 3.5%;
  width: 82%;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  border: 2px solid rgba(119, 116, 36, 0.38);
  background-color: rgba(245, 194, 219, 0.08);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  animation: pulsar-botao 2.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.botao-convite:hover .anel-botao {
  border-color: rgba(119, 116, 36, 0.85);
  background-color: rgba(245, 194, 219, 0.24);
  box-shadow: 0 4px 14px rgba(119, 116, 36, 0.2);
}

@keyframes pulsar-botao {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.95;
  }
}

.legenda-botao {
  margin-top: 5.5%;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 3.15cqw;
  line-height: 1.15;
  text-align: center;
  color: var(--oliva-escuro);
  text-shadow: 0 1px 0 rgba(255, 252, 244, 0.85);
}

/* =====================================================
   TELA 3: VÍDEO DE SUGESTÃO DE PRESENTE
   ===================================================== */
.tela-presente {
  background-color: #f3ede0;
}

.video-presente {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.btn-tocar-video {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid #d5c8af;
  border-radius: 9999px;
  background-color: rgba(255, 251, 242, 0.94);
  color: var(--texto-escuro);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(44, 37, 28, 0.22);
}

.btn-tocar-video.oculto {
  display: none;
}

/* =====================================================
   TELA 4: CONFIRMAR PRESENÇA (FORMULÁRIO INTERNO)
   ===================================================== */
.tela-confirmar {
  background-color: #f3ede0;
}

.arte-fundo-rsvp {
  filter: blur(1.5px) saturate(0.9);
  opacity: 0.92;
}

.painel-rsvp {
  position: absolute;
  inset: 9.5% 8.5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5cqw 5cqw;
  border-radius: 20px;
  background: rgba(250, 246, 237, 0.95);
  border: 1px solid #d9ccb2;
  box-shadow: 0 14px 36px -14px rgba(56, 44, 24, 0.25);
  overflow-y: auto;
}

.cabecalho-rsvp {
  text-align: center;
  margin-bottom: 3.2cqw;
}

.titulo-rsvp {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 7.2cqw;
  line-height: 1.08;
  color: #cf6b9f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.subtitulo-rsvp {
  margin-top: 1cqw;
  font-size: 3cqw;
  font-weight: 600;
  color: var(--oliva-escuro);
}

.form-rsvp {
  display: flex;
  flex-direction: column;
  gap: 2.8cqw;
}

.campo-grupo {
  display: flex;
  flex-direction: column;
  gap: 1.2cqw;
}

.rotulo-rsvp {
  font-size: 3.35cqw;
  font-weight: 700;
  color: var(--texto-escuro);
  line-height: 1.25;
}

.input-rsvp {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #d5c8af;
  background-color: #ffffff;
  color: var(--texto-escuro);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-rsvp::placeholder {
  color: #9b8f7a;
}

.input-rsvp:focus {
  outline: none;
  border-color: var(--oliva-arte);
  box-shadow: 0 0 0 3px rgba(119, 116, 36, 0.18);
}

.controle-quantidade {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 8px;
  align-items: center;
}

.btn-qtd {
  min-height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1.5px solid #d5c8af;
  background-color: #f8d8e8;
  color: #4f2238;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.btn-qtd:hover {
  background-color: #f5c2db;
}

.btn-qtd:active {
  transform: scale(0.95);
}

.input-qtd {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.dica-rsvp {
  font-size: 3cqw;
  color: #6b614e;
  line-height: 1.3;
}

.erro-rsvp {
  font-size: 3.1cqw;
  font-weight: 600;
  color: #8f221e;
  background-color: #fdecea;
  border: 1px solid #f2c4bf;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.erro-rsvp.oculto {
  display: none;
}

.link-abrir-gmail {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background-color: #6e6c1f;
  color: #ffffff;
  font-family: inherit;
  font-size: 3.7cqw;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(92, 90, 24, 0.45);
  transition: background-color 0.15s ease, transform 0.14s ease;
}

.link-abrir-gmail:hover {
  background-color: var(--oliva-escuro);
}

.link-abrir-gmail:active {
  transform: scale(0.98);
}

.link-abrir-gmail:focus-visible,
.btn-voltar-rsvp:focus-visible,
.btn-qtd:focus-visible {
  outline: 2px solid var(--oliva-escuro);
  outline-offset: 2px;
}

.nota-email-rsvp {
  font-size: 2.9cqw;
  line-height: 1.35;
  text-align: center;
  color: #635a49;
}

.btn-voltar-rsvp {
  align-self: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid #d5c8af;
  background-color: #ffffff;
  color: #4f4638;
  font-family: inherit;
  font-size: 3.2cqw;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.14s ease;
}

.btn-voltar-rsvp:hover {
  background-color: #f6efe0;
}

.btn-voltar-rsvp:active {
  transform: scale(0.97);
}

/* =====================================================
   CONTROLE DE RODAPÉ E TOAST DE AVISO
   ===================================================== */
.barra-rodape {
  margin-top: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-voltar-capa {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #d5c8af;
  border-radius: 9999px;
  background-color: rgba(255, 251, 242, 0.85);
  color: #4f4638;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.2s ease;
}

.btn-voltar-capa:hover {
  background-color: #ffffff;
}

.btn-voltar-capa:active {
  transform: scale(0.97);
}

.btn-voltar-capa.oculto {
  display: none;
}

.aviso-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 20px;
  border-radius: 14px;
  background-color: #2c251c;
  color: #fbf7ee;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.aviso-toast.visivel {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 460px) {
  .pagina-convite {
    padding: max(6px, env(safe-area-inset-top)) 6px max(10px, env(safe-area-inset-bottom));
  }

  .convite-palco {
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tela,
  .realce-placa,
  .anel-botao,
  .aviso-toast {
    animation: none;
    transition: none;
  }
}
