:root{
  --gold:#c63959;
  --bg:#000;
  --text:#fff;
  --text-soft:#e9e9e9;
  --card:#121212;
  --alt:#0b0b0b;
}

*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth}
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden;
}

/* NAV */
.navbar{
  position:fixed; inset:0 0 auto 0;
  display:flex; justify-content:space-between; align-items:center;
  padding:1rem 1.25rem;
  background:rgba(0,0,0,.6);
  backdrop-filter:saturate(120%) blur(6px);
  z-index:1000;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.logo{
  font-family:"Playfair Display", serif;
  letter-spacing:2px; font-weight:700;
  color:#fff; text-decoration:none; font-size:1.2rem;
}
.menu-toggle{
  font-size:1.8rem; background:none; border:none; color:#fff; cursor:pointer;
}
.nav-links{
  display:none; position:absolute; right:0; top:60px;
  width:80%; background:rgba(0,0,0,.92); padding:1rem; border-left:1px solid rgba(255,255,255,.08);
  flex-direction:column; gap:.75rem;
  border-top-left-radius: 30px;
  border-bottom-left-radius: 30px;
}
.nav-links a{color:#fff;text-decoration:none;padding:.5rem;border-radius:.4rem}
.nav-links a:hover{background:rgba(255,255,255,.06)}
.btn-presenca{background:var(--gold); color:#ffffff; font-weight:700}

/* HERO */
.hero{
  min-height:100svh;
  background:url('fundo.jpg') center/cover no-repeat;
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  display:grid; place-items:center; position:relative;
}
.overlay{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.hero-content{position:relative; text-align:left; padding:1rem; margin-left:1.5rem; margin-top: 25rem;}
.subtitle{font-family:"Playfair Display",serif; color:var(--gold); font-size:1.1rem; margin-bottom:.4rem}
.hero h1{font-family:"Playfair Display",serif; font-size:3.5rem; letter-spacing:2px; font-weight:700}
.date{margin:.6rem 0; opacity:.95; font-size:1.4rem; font-weight:600; letter-spacing:1px}
.verse{max-width:32ch; margin:0 auto; color:var(--text-soft); line-height:1.4}
.cta{display:inline-block; margin-top:1rem; padding:.7rem 1rem; background:var(--gold); color:#ffffff; font-weight:700; border-radius:.4rem; text-decoration:none}

/* SECTIONS */
.section{
  padding:72px 0 56px;
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section.alt{
  background: rgba(15, 15, 15, 0.6);
  border-top: 1px solid rgba(198, 57, 89, 0.1);
}
.container{width:min(100%,1000px); margin:0 auto; padding:0 1.2rem}
h2{font-family:"Playfair Display",serif; font-size:1.6rem; margin-bottom:1rem}

/* RSVP */
.rsvp{margin-top:1rem}
.grid{display:grid; gap:.9rem}
label{display:grid; gap:.45rem; font-size:.95rem}
input, textarea{
  width:100%; padding:.8rem; border-radius:.5rem; border:1px solid rgba(255,255,255,.2);
  background:#0a0a0a; color:#fff;
}
.full{grid-column:1 / -1}
.btn-primary{
  margin-top: 1.25rem; background:var(--gold); color:#ffffff; font-weight:700; padding:.8rem 1rem; border:none; border-radius:.5rem; cursor:pointer
}
.btn-primary:disabled{
  background:#555; color:#999; cursor:not-allowed; opacity:0.6
}
.btn-secondary{
  margin-top: 0.5rem; background:var(--gold); color:#ffffff; font-weight:500; padding:.5rem 5rem; border:none; border-radius:.5rem; cursor:pointer
}
.form-error{margin-top:.6rem; margin-bottom:0; color:#ff6b6b; font-size:0.9rem}
.form-ok{margin-top:.6rem; color:#92f29b}
#rsvpTurnstile{margin-top:1rem;}

/* PRESENTES */
.gift-grid{
  margin-top:1rem;
  display:grid; grid-template-columns:1fr; gap:.9rem
}
.gift-card{
  background:var(--card); border:1px solid rgba(255,255,255,.08);
  padding:1rem; border-radius:.9rem; text-decoration:none; color:#fff; display:grid; gap:.35rem; height: 10rem;
}
.gift-card span{opacity:.9; font-weight:600; color:var(--gold)}

/* EVENTO */
.event-info{display:grid; gap:1rem; align-items:start; margin-top:1rem}
.event-text p{margin:.25rem; margin-bottom: 1.5rem}
.event-map iframe{width:100%; height:320px; border:0; border-radius:.8rem;}
.when .where { padding-top: 0.6rem;}

/* HISTÓRIA */
.timeline{position:relative; margin-top:1rem}
.t-item{position:relative; padding-left:1rem; margin-bottom:2rem}
.t-item:last-child{margin-bottom:0}
.t-dot{position:absolute; left:-6px; top:.45rem; width:.75rem; height:.75rem; border-radius:50%; background:var(--gold)}
#historia p{text-indent:1.5rem}
#historia h4{font-size:0.7rem; font-weight:400; opacity:0.8; margin-bottom:1rem}

/* FOOTER */
.footer{display:flex; justify-content:center; align-items:center; gap:1rem; padding:2rem 1rem; background:#050505; border-top:1px solid rgba(255,255,255,.08)}
.back-top{color:#fff; text-decoration:none; border:1px solid rgba(255,255,255,.2); padding:.3rem .6rem; border-radius:.4rem}

/* DESKTOP */
@media (min-width: 768px){
  .menu-toggle{display:none}
  .nav-links{display:flex !important; position:static; background:transparent; width:auto; flex-direction:row; gap:1rem; padding:0; border:none}
  .hero h1{font-size:4.5rem; color:#666}
  .hero-content{margin-left:1rem; margin-right:auto; max-width:none; color:#666}
  .date{font-size:1.6rem; color:#666}
  .verse{max-width:48ch}
  .grid{grid-template-columns:repeat(2,1fr)}
  .gift-grid{grid-template-columns:repeat(2,1fr)}
  .event-info{grid-template-columns:1.1fr 1fr}
  .hero{
    background-position: center 20%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .contador span{
    color:#666;
  }
  .contador small{
    color:#666;
  }
}

/* Otimizações para telas de alta resolução */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero {
    background-image: url('fundo.jpg');
    background-size: cover;
    background-position: center center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Melhorias para dispositivos móveis */
@media (max-width: 767px) {
  .hero {
    background-image: url('fundo2.jpg');
    background-attachment: scroll;
    background-size: cover;
    background-position: center center;
  }
}
@media (min-width: 1024px){
  .gift-grid{grid-template-columns:repeat(3,1fr)}
  .contador div{
    min-width:70px;
    padding:0.6rem 0.4rem;
    border-radius:0.75rem;
  }
  .contador span{
    font-size:1.4rem;
    color:#666;
  }
  .contador small{
    font-size:0.75rem;
    letter-spacing:1px;
    margin-top:0.25rem;
    color:#666;
  }
  .contador{
    gap:1rem;
  }
  .hero{
    background-position: center 20%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
}
/* ---------------------------
   CONTADOR (HERO)
---------------------------- */
.contador{
  display:flex;
  justify-content:flex-start;
  flex-wrap:nowrap;
  gap:0.5rem;
  margin:1rem 0 0.8rem;
}

.contador div{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:50px;
  background:rgba(255,255,255,0.15);
  backdrop-filter:blur(5px);
  border:1px solid rgba(246,214,223,0.35);
  border-radius:0.5rem;
  padding:0.4rem 0.3rem;
  box-shadow:0 4px 12px rgba(123,29,47,0.25);
}

.contador span{
  font-size:1.1rem;
  font-weight:700;
  color:var(--rose-300);
  font-family:"Playfair Display",serif;
}

.contador small{
  font-size:0.65rem;
  color:#666666;
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-top:0.2rem;
  opacity:0.85;
}

li {
    padding: 1rem;
    list-style-type: none;
    text-align: justify;
}

.modal {
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  padding: 2rem;
  border-radius: 0.9rem;
  text-align: center;
  width: min(90%, 360px);
  max-width: 360px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-content > h2 {
  flex-shrink: 0;
}

.guest-info {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.modal-content span {
  color: var(--text);
}

.hidden{
  display:none !important;
}

.fechar {
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  color: var(--text);
  line-height: 1;
  transition: color 0.2s;
}

.fechar:hover {
  color: var(--gold);
}

.gift-form{
  display:flex;
  flex-direction:column;
  gap:1rem;
  margin-top:1rem;
}

.gift-form label{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  font-size:.9rem;
  color:var(--text-soft);
}

.input-with-counter{
  display:flex;
  align-items:center;
  gap:.5rem;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:.5rem;
  padding:.35rem .45rem;
  transition:border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-with-counter:focus-within{
  border-color:var(--gold);
  box-shadow:0 0 0 2px rgba(198,57,89,0.25);
  background:rgba(198,57,89,0.08);
}

.input-with-counter input,
.input-with-counter textarea{
  background:transparent;
  border:none;
  color:var(--text);
  font-size:.95rem;
  font-family: inherit;
  width:100%;
  padding:.35rem 0;
  outline:none;
}

.input-with-counter textarea{
  min-height:80px;
  resize:vertical;
}

.char-counter{
  font-size:.75rem;
  color:var(--text-soft);
  white-space:nowrap;
}

.btn-submit-gift{
  width:100%;
  margin-top:.5rem;
}

.qr-section{
  margin-top:1.5rem;
  display:flex;
  flex-direction:column;
  gap:.75rem;
  align-items:center;
}

.copy-hint{
  font-size:.85rem;
  color:var(--text-soft);
}

#imagemQR {
  width: 100%;
  max-width: 250px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.payload-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
}

#payload {
  font-size: 0.7rem;
  word-break: break-all;
  text-align: left;
  margin: 0;
  padding: 0.5rem;
  color: var(--text-soft);
  font-family: monospace;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}

.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--gold);
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s, color 0.2s;
  width: 100%;
}

.btn-copy:hover {
  background: #b52d4d;
  transform: scale(1.05);
}

.btn-copy:active {
  transform: scale(0.98);
}

.copy-icon {
  font-size: 0.9rem;
}

.copy-text {
  font-size: 0.75rem;
}

.gift-value-display {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  letter-spacing: 0.5px;
}

.gift-name-display{
  font-family:"Playfair Display", serif;
  font-size:1.1rem;
  letter-spacing:0.5px;
  color:var(--text-soft);
  text-transform:uppercase;
}

#qrcode {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 3px solid #ffffff;
  background: #ffffff;
}

/* Modal Convidado */
.guest-info {
  margin-top: 1rem;
  color: #ffffff;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  color: #ffffff;
  font-size: 0.95rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  margin: 0;
  color: #ffffff;
}

.guest-details {
  text-align: left;
  padding: 1rem 0;
  color: #ffffff;
}

.guest-details-content {
  color: #ffffff;
}

.guest-details p,
.guest-details-content p {
  margin: 0.75rem 0;
  color: #ffffff;
  line-height: 1.6;
}

.guest-phone,
.guest-count {
  color: #ffffff;
}

.guest-details strong,
.guest-details-content strong {
  color: #ffffff;
  font-weight: 600;
}

.guest-error {
  color: #ffffff;
  font-size: 0.95rem;
  padding: 1rem;
  line-height: 1.6;
}

/* Modal Footer */
.modal-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.btn-send-confirmation {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--gold);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-send-confirmation:hover:not(:disabled) {
  background: #b52d4d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(198, 57, 89, 0.4);
}

.btn-send-confirmation:active:not(:disabled) {
  transform: translateY(0);
}

.btn-send-confirmation:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.send-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.2rem;
  line-height: 1.4;
}

/* FAQ Accordion */
.faq-container {
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.faq-item.active {
  border-color: var(--gold);
  background: rgba(198, 57, 89, 0.05);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.faq-question:hover {
  color: var(--gold);
}

.faq-question span:first-child {
  flex: 1;
  padding-right: 1rem;
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--gold);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
  color: var(--text-soft);
  line-height: 1.8;
  margin: 0;
  padding-top: 0.5rem;
}

/* Tabela de Convidados */
.guests-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}

.guests-table thead {
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.guests-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
}

.guests-table th:first-child {
  padding-left: 0;
}

.guests-table th:last-child {
  text-align: center;
  width: 120px;
}

.guests-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.guests-table tbody tr:last-child {
  border-bottom: none;
}

.guest-name {
  padding: 0.75rem 0.5rem;
  padding-left: 0;
  color: #ffffff;
  vertical-align: middle;
}

.guest-confirm {
  text-align: center;
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 36px;
  cursor: pointer;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #f44336;
  border-radius: 34px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 28px;
  width: 28px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.toggle-input:checked + .toggle-slider {
  background-color: #4caf50;
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(64px);
}

.toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.toggle-label-no {
  opacity: 1;
}

.toggle-label-yes {
  opacity: 0;
}

.toggle-input:checked + .toggle-slider .toggle-label-no {
  opacity: 0;
}

.toggle-input:checked + .toggle-slider .toggle-label-yes {
  opacity: 1;
}

.toggle-switch:hover .toggle-slider {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 8px rgba(255, 255, 255, 0.2);
}

