:root {
  /* Paleta amostrada diretamente do convite original (convite/IMG_9950.PNG) */
  --creme-claro: #f8f1e7;
  --creme-escuro: #f4e4ce;
  --card-bg: #ecd2af;
  --marrom-escuro: #443012;
  --marrom-medio: #b07834;
  --verde: #83845e;
  --verde-escuro: #6a693f;
  --dourado: #c9a15d;
  --branco: #fffaf0;
  --sombra: rgba(68, 48, 18, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--marrom-escuro);
  background-color: var(--creme-claro);
  background-image: url('../img/fundo-xadrez.jpg');
  background-repeat: repeat;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ---------- Convite recriado ---------- */

.convite-recriado {
  position: relative;
  margin-bottom: 28px;
}

.convite-moldura-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 800 / 1218;
}

.convite-moldura-imagem {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.titulo-arco-svg {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  max-width: 220px;
  height: auto;
  overflow: visible;
}

.titulo-arco-texto {
  fill: var(--verde-escuro);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 3px;
}

.conteudo-moldura {
  position: absolute;
  top: 36%;
  left: 15%;
  width: 70%;
  text-align: center;
}

.intro-arco {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--marrom-medio);
  margin: 0;
  line-height: 1.25;
}

.subtitulo-arco {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.86rem;
  color: var(--verde-escuro);
  margin: 1px 0;
}

.nome-bebe {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--marrom-escuro);
  margin: 0 0 6px;
}

.detalhes-arco {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 6px 0;
  margin-bottom: 6px;
  border-top: 1px solid rgba(124, 140, 102, 0.35);
  border-bottom: 1px solid rgba(124, 140, 102, 0.35);
}

.detalhes-arco .item {
  text-align: center;
}

.icone-foto {
  width: 24px;
  height: auto;
  display: block;
  margin: 0 auto 2px;
}

.detalhes-arco .rotulo {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--verde-escuro);
  font-weight: 700;
  margin-top: 1px;
}

.detalhes-arco .valor {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--marrom-escuro);
}

.separador-vertical {
  width: 1px;
  align-self: stretch;
  background: rgba(124, 140, 102, 0.35);
}

.local-arco {
  margin-bottom: 4px;
}

.icone-pin-foto {
  width: 20px;
}

.local-arco-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.local-arco .rotulo {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--verde-escuro);
  font-weight: 700;
  margin-bottom: 1px;
}

.local-arco-nome {
  color: var(--marrom-escuro);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.25;
  border-bottom: 1px dashed var(--marrom-medio);
}

.local-arco-instrucao {
  font-size: 0.64rem;
  color: var(--marrom-medio);
  opacity: 0.85;
  font-style: italic;
  margin: 2px 0 0;
}

.mensagem-arco {
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--marrom-medio);
  font-style: italic;
  margin: 0;
}

@media (max-width: 480px) {
  .conteudo-moldura {
    top: 34%;
    width: 64%;
    left: 18%;
  }

  .mensagem-arco {
    font-size: 0.7rem;
  }

  .intro-arco {
    line-height: 1.1;
  }

  .subtitulo-arco {
    margin: 0;
  }

  .nome-bebe {
    font-size: 2.2rem;
    margin: 0 0 2px;
  }

  .detalhes-arco {
    gap: 14px;
    padding: 2px 0;
    margin-bottom: 2px;
  }

  .icone-foto {
    width: 16px;
    margin: 0 auto 1px;
  }

  .local-arco {
    margin-bottom: 1px;
  }

  .icone-pin-foto {
    width: 13px;
  }

  .local-arco-nome {
    line-height: 1.1;
  }

  .local-arco-instrucao {
    margin: 0;
  }

  .mensagem-arco {
    line-height: 1.15;
  }
}

/* ---------- Cartão RSVP ---------- */

.card {
  background: var(--card-bg);
  border: 2px dashed var(--verde);
  border-radius: 24px;
  padding: 28px 22px;
  box-shadow: 0 10px 24px var(--sombra);
  margin-bottom: 24px;
}

.card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  text-align: center;
  color: var(--marrom-escuro);
  font-size: 1.7rem;
  margin: 0 0 4px;
}

.subtitulo {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--verde-escuro);
  font-weight: 700;
  margin-bottom: 18px;
}

.detalhes-evento {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  text-align: center;
  margin: 18px 0 22px;
  padding: 16px 0;
  border-top: 1px solid rgba(124, 140, 102, 0.35);
  border-bottom: 1px solid rgba(124, 140, 102, 0.35);
}

.detalhes-evento .item .rotulo {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--verde-escuro);
  font-weight: 700;
  margin-bottom: 4px;
}

.detalhes-evento .item .valor {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--marrom-escuro);
}

.local {
  text-align: center;
  margin-bottom: 22px;
}

.local .rotulo {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--verde-escuro);
  font-weight: 700;
  margin-bottom: 4px;
}

.local a {
  color: var(--marrom-escuro);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed var(--marrom-medio);
}

.ajuda {
  font-size: 0.85rem;
  color: var(--marrom-medio);
  margin: -8px 0 18px;
}

.ajuda-centro {
  text-align: center;
  margin: 0;
}

.ajuda-discreta {
  font-style: italic;
  text-align: center;
  margin: -6px 0 18px;
}

/* ---------- Aviso de link exclusivo (index) ---------- */

.card-aviso-link {
  text-align: center;
}

.icone-aviso {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(124, 140, 102, 0.18);
}

.icone-aviso svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--verde-escuro);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.texto-aviso {
  text-align: center;
  font-size: 1rem;
  margin: 0 0 12px;
}

/* ---------- Link inválido (familia.php) ---------- */

.card-token-invalido {
  text-align: center;
}

.dec-mini {
  width: 76px;
  height: auto;
  margin: 0 auto 14px;
  display: block;
  border-radius: 46% 54% 52% 48% / 42% 46% 58% 54%;
  box-shadow: 0 8px 18px var(--sombra);
}

/* ---------- Confirmação por família ---------- */

.card-familia .texto-instrucao {
  text-align: center;
  font-weight: 700;
  margin: 4px 0 16px;
  color: var(--marrom-escuro);
}

.lista-membros {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.membro-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--branco);
  border: 2px solid rgba(124, 140, 102, 0.35);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.membro-item.confirmado {
  background: rgba(124, 140, 102, 0.16);
  border-color: var(--verde-escuro);
}

.membro-item.salvo {
  animation: pulso-salvo 1s ease;
}

@keyframes pulso-salvo {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(124, 140, 102, 0.5);
  }

  30% {
    transform: scale(1.015);
    box-shadow: 0 0 0 6px rgba(124, 140, 102, 0.16);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(124, 140, 102, 0);
  }
}

.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.checkbox-custom input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.check-visual {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--verde);
  background: var(--branco);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.check-visual::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: solid var(--branco);
  border-width: 0 3px 3px 0;
  transform: rotate(40deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checkbox-custom input:checked+.check-visual {
  background: var(--verde-escuro);
  border-color: var(--verde-escuro);
}

.checkbox-custom input:checked+.check-visual::after {
  opacity: 1;
}

.checkbox-custom input:focus-visible+.check-visual {
  box-shadow: 0 0 0 3px rgba(124, 140, 102, 0.35);
}

.membro-nome {
  color: var(--marrom-escuro);
  overflow-wrap: anywhere;
}

.membro-status {
  flex: 0 0 auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--marrom-medio);
}

.membro-item.confirmado .membro-status {
  color: var(--verde-escuro);
}

/* ---------- Lista de presentes ---------- */

.mensagem-vazia {
  text-align: center;
  color: var(--marrom-medio);
  font-style: italic;
  margin: 6px 0 0;
}

.grade-presentes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.presente-card {
  background: var(--branco);
  border: 2px solid rgba(124, 140, 102, 0.3);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 6px 14px var(--sombra);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.presente-icone {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.presente-thumb {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 6px 14px var(--sombra);
}

#grade-presentes-reserva .presente-card {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

#grade-presentes-reserva .presente-card:hover {
  border-color: var(--verde);
  box-shadow: 0 8px 18px var(--sombra);
}

#grade-presentes-reserva .presente-card:active {
  transform: scale(0.98);
}

#grade-presentes-reserva .presente-card:focus-visible {
  outline: none;
  border-color: var(--verde-escuro);
  box-shadow: 0 0 0 3px rgba(124, 140, 102, 0.3);
}

#grade-presentes-reserva .presente-card.reservado {
  border: 2px solid var(--verde-escuro);
  background: rgba(124, 140, 102, 0.1);
  box-shadow: 0 8px 18px var(--sombra);
}

#grade-presentes-reserva .presente-card.selecionado {
  border: 2px dashed var(--dourado);
  background: rgba(201, 145, 63, 0.12);
  box-shadow: 0 8px 18px var(--sombra);
}

.btn-reservar-topo {
  margin-bottom: 18px;
}

#grade-presentes-reserva .presente-card.presente-especial {
  cursor: default;
}

#grade-presentes-reserva .presente-card.presente-especial:hover {
  border-color: rgba(124, 140, 102, 0.3);
  box-shadow: 0 6px 14px var(--sombra);
}

.modal-pix {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(63, 43, 28, 0.45);
}

.modal-pix.oculto {
  display: none;
}

.modal-pix-caixa {
  position: relative;
  max-width: 360px;
  width: 100%;
  text-align: center;
  background: var(--card-bg);
  border: 2px dashed var(--verde);
  border-radius: 20px;
  padding: 36px 26px 28px;
  box-shadow: 0 16px 32px var(--sombra);
}

.modal-pix-caixa h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--marrom-escuro);
  margin: 4px 0 12px;
}

.modal-pix-fechar {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--marrom-medio);
  cursor: pointer;
  padding: 6px;
}

.pix-chave-valor-modal {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--marrom-escuro);
  background: var(--creme-claro);
  border: 1px dashed var(--verde);
  border-radius: 12px;
  padding: 14px 12px;
  margin: 0 0 18px;
  word-break: break-all;
}

.btn-ver-pix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--verde-escuro);
  color: var(--branco);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 6px 14px var(--sombra);
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-ver-pix:hover {
  background: var(--marrom-medio);
}

.btn-ver-pix:active {
  transform: scale(0.97);
}

.presente-selo-reservado {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--verde-escuro);
  color: var(--branco);
  font-size: 0.85rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px var(--sombra);
}

.presente-card.reservado .presente-selo-reservado {
  display: flex;
}

.presente-card.esgotado {
  opacity: 0.55;
}

#grade-presentes-reserva .presente-card.esgotado {
  cursor: not-allowed;
}

#grade-presentes-reserva .presente-card.esgotado:hover {
  border-color: rgba(124, 140, 102, 0.3);
  box-shadow: 0 6px 14px var(--sombra);
}

#grade-presentes-reserva .presente-card.esgotado.reservado {
  opacity: 1;
  cursor: pointer;
}

.presente-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--marrom-escuro);
}

.presente-desc {
  font-size: 0.86rem;
  color: var(--marrom-medio);
  margin: 0 0 10px;
}

.presente-link {
  margin-top: auto;
  color: var(--verde-escuro);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed var(--verde-escuro);
  font-size: 0.86rem;
}

/* ---------- Reserva de presentes (familia.php) ---------- */

.presente-status-texto {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--verde-escuro);
  margin: 8px 0 0;
  min-height: 1em;
}

.presente-card.esgotado:not(.reservado) .presente-status-texto {
  color: var(--marrom-medio);
}

.presente-erro-texto {
  font-size: 0.78rem;
  color: #8a3b28;
  margin: 6px 0 0;
}

/* ---------- Botão ---------- */

.btn-confirmar {
  width: 100%;
  padding: 16px;
  font-size: 1.08rem;
  font-weight: 800;
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: 0.02em;
  color: var(--branco);
  background: var(--verde-escuro);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}

.btn-confirmar:hover:not(:disabled) {
  background: var(--marrom-medio);
}

.btn-confirmar:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-confirmar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Mensagens de estado ---------- */

.mensagem {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  display: none;
}

.mensagem.mostrar {
  display: block;
}

.mensagem.sucesso {
  background: rgba(124, 140, 102, 0.2);
  color: var(--verde-escuro);
  border: 1px solid var(--verde);
}

.mensagem.erro {
  background: rgba(180, 70, 50, 0.12);
  color: #8a3b28;
  border: 1px solid rgba(180, 70, 50, 0.35);
}

footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--marrom-medio);
  opacity: 0.8;
}

.oculto {
  display: none !important;
}

@media (min-width: 640px) {
  .card {
    padding: 36px 44px;
  }

  .card h2 {
    font-size: 2rem;
  }
}