/* ========== Identidade visual: Bruno & Victória ========== */
:root {
  --cream: #FBF8F3;
  --ivory: #F3EDE3;
  --ink: #2B2722;
  --ink-soft: #5E574E;
  --gold: #B8935A;
  --gold-deep: #9A7742;
  --olive: #7D8471;
  --line: #E4D9C6;
  --card: #FFFFFF;
  --danger: #A2453A;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --cream-glass: rgba(251, 248, 243, .92);
}

/* Tema escuro: só quando o visitante escolhe no botão (padrão é claro) */
:root { color-scheme: only light; }
:root[data-theme="dark"] {
  color-scheme: only dark;
  --cream: #1E1B18;
  --ivory: #26221E;
  --ink: #F1EBE1;
  --ink-soft: #BDB3A5;
  --gold: #CFAB72;
  --gold-deep: #E0BF89;
  --line: #3D362E;
  --card: #2B2621;
  --danger: #E08A7E;
  --cream-glass: rgba(30, 27, 24, .9);
}

/* Botão de tema */
.theme-toggle {
  position: absolute; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 6px);
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle .sol { display: none; }
:root[data-theme="dark"] .theme-toggle .sol { display: block; }
:root[data-theme="dark"] .theme-toggle .lua { display: none; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2.2rem, 8vw, 3.2rem); text-align: center; }
h3 { font-size: 1.6rem; margin-bottom: .35rem; }
p { margin: .35rem 0; }
a { color: var(--gold-deep); }
strong { font-weight: 500; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--cream); padding: 8px 14px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }

.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }

.eyebrow {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .35em;
  font-size: .78rem;
  color: var(--ink-soft);
  margin-bottom: .8rem;
}
.spaced { text-transform: uppercase; letter-spacing: .3em; font-size: .95rem; text-align: center; }
.spaced.small { letter-spacing: .14em; text-transform: none; font-size: 1rem; }

.rule { width: 72px; height: 1px; border: 0; background: var(--gold); margin: 1.4rem auto; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--cream-glass);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.monogram { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); text-decoration: none; letter-spacing: .04em; }
.monogram span { color: var(--gold); font-style: italic; margin: 0 .12em; }
.monogram.big { font-size: 2.4rem; }
.topnav { display: none; }

/* ---------- Início ---------- */
.hero { padding: 20px 16px 40px; }
.frame {
  max-width: 620px; margin: 0 auto;
  border: 1px solid var(--gold);
  padding: 44px 22px 40px;
  text-align: center;
  position: relative;
}
.frame::after { /* segunda moldura fina, como papelaria */
  content: ""; position: absolute; inset: 6px;
  border: 1px solid var(--line);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  pointer-events: none;
}
.names { display: flex; flex-direction: column; align-items: center; font-size: clamp(3.4rem, 17vw, 5.6rem); font-weight: 400; }
.names .amp, .amp { color: var(--gold); font-style: italic; font-family: var(--serif); }
.names .amp { font-size: .55em; line-height: 1.1; }
.lede { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.45; margin-top: 1.2rem; }
.date { font-family: var(--serif); font-size: clamp(2.6rem, 13vw, 4rem); margin: 0; letter-spacing: .02em; }
.date i { color: var(--gold); font-style: normal; font-size: .6em; vertical-align: middle; }

.countdown { display: flex; justify-content: center; gap: 10px; margin: 1.8rem 0 1.6rem; }
.countdown div {
  min-width: 78px; padding: 10px 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.countdown b { display: block; font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1; }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-soft); }
.hint { font-size: .85rem; color: var(--ink-soft); margin-top: .6rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 26px;
  background: var(--ink); color: var(--cream);
  border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s, background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .stepper button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--gold); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: .92rem; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row.center { justify-content: center; margin-top: 26px; }
.row.center .btn { flex: 1 1 240px; max-width: 320px; }

/* ---------- Seções ---------- */
.section { padding: 64px 16px; }
.section.alt { background: var(--ivory); }
.wrap { max-width: 960px; margin: 0 auto; }
.wrap.narrow { max-width: 560px; }

.cards { display: grid; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; text-align: center;
}

/* ---------- Formulário ---------- */
.rsvp { margin-top: 26px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, legend { font-weight: 500; font-size: .95rem; padding: 0; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=number], textarea {
  width: 100%;
  font: inherit; font-size: 16px; /* 16px evita o zoom automático do iPhone */
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; min-height: 50px;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: .75; }
@supports (color: color-mix(in srgb, red, blue)) { input::placeholder, textarea::placeholder { opacity: 1; color: color-mix(in srgb, var(--ink-soft) 70%, transparent); } }
.invalid { border-color: var(--danger) !important; }

.choice { display: grid; gap: 10px; }
.choice label {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.choice input { width: 20px; height: 20px; accent-color: var(--gold-deep); margin: 0; flex: none; }
.choice label.checked, .choice label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--gold); background: transparent; color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.stepper input { width: 72px; text-align: center; font-family: var(--serif); font-size: 1.5rem; }
.when-yes { display: grid; gap: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--danger); font-size: .95rem; margin: 0; }

.thanks { text-align: center; padding: 34px 10px; outline: none; }
.thanks h3 { font-size: 2.2rem; }
.amp.big { font-size: 4rem; line-height: 1; margin: 0; }

/* ---------- FAQ ---------- */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); margin-top: 26px; }
summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 12px 2px;
  font-family: var(--serif); font-size: 1.3rem; font-weight: 500;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--gold); font-family: var(--sans); font-size: 1.5rem; font-weight: 300; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--ink-soft); padding: 0 2px 18px; margin: 0; }

/* ---------- Rodapé ---------- */
.footer { text-align: center; padding: 48px 16px 32px; border-top: 1px solid var(--line); }

/* ---------- Barra inferior (celular) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--cream-glass);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-soft); text-decoration: none; font-size: .7rem; letter-spacing: .03em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--gold-deep); }

/* ---------- Animação suave ao rolar ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ========== Telas maiores ========== */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topbar { justify-content: space-between; padding: 0 32px; height: 64px; }
  .topnav { display: flex; gap: 28px; margin-left: auto; margin-right: 52px; }
  .topnav a { color: var(--ink); text-decoration: none; font-size: .88rem; letter-spacing: .12em; text-transform: uppercase; }
  .topnav a:hover { color: var(--gold-deep); }
  .hero { padding: 40px 24px 72px; }
  .frame { padding: 64px 48px 56px; }
  .lede { font-size: 1.45rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 96px 24px; }
}

/* ========== Presentes ========== */
.intro { max-width: 560px; margin: 0 auto; }
.demo-banner {
  max-width: 560px; margin: 18px auto 0; padding: 10px 14px; text-align: center;
  background: #FCE9E6; color: #8A2E23; border: 1px solid #E9B7AF; border-radius: 10px; font-weight: 500; font-size: .92rem;
}
.chips {
  display: flex; gap: 8px; margin: 26px -16px 18px; padding: 2px 16px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: .92rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.gifts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gift {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 0 0 14px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s, border-color .2s;
}
.gift:active { transform: scale(.98); }
.gift:hover { border-color: var(--gold); }
.gift:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gift-img {
  width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--ivory);
  background: linear-gradient(160deg, var(--ivory), color-mix(in srgb, var(--gold) 14%, var(--ivory)));
}
.gift-img img { width: 100%; height: 100%; object-fit: cover; }
.gift-img svg { width: 42%; fill: none; stroke: var(--gold-deep); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gift-nome, .gift-desc, .gift-valor, .gift-cta { padding: 0 12px; }
.gift-nome { font-family: var(--serif); font-size: 1.22rem; font-weight: 500; line-height: 1.15; }
.gift-desc { font-size: .8rem; color: var(--ink-soft); line-height: 1.35; margin-top: 4px; flex: 1; }
.gift-valor { font-weight: 500; font-size: 1.05rem; margin-top: 10px; }
.gift-cta { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); margin-top: 4px; }
.gifts li.li-livre { grid-column: 1 / -1; }
.gift.livre { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 4px; border-style: dashed; border-color: var(--gold); }
.gift.livre .gift-img { width: 64px; aspect-ratio: 1; margin: 0 0 0 10px; border-radius: 12px; }
.gift.livre .gift-nome { flex: 1; }
.gift.livre .gift-desc { flex-basis: 100%; padding-left: 86px; margin-top: -18px; }
.gift.livre .gift-valor, .gift.livre .gift-cta { display: none; }

/* ---------- Janela de pagamento (bottom sheet no celular) ---------- */
html.sheet-open { overflow: hidden; }
.sheet {
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0; background: var(--cream); color: var(--ink);
  overscroll-behavior: contain;
}
.sheet[open] { animation: subir .28s cubic-bezier(.2,.8,.2,1); }
.sheet::backdrop { background: rgba(30, 24, 18, .45); }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-inner { position: relative; padding: 12px 20px calc(24px + var(--safe-b)); }
.grabber { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-close {
  position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-soft); font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.eyebrow.left { text-align: left; margin-bottom: .3rem; }
.sheet h3 { font-size: 1.9rem; padding-right: 40px; }
.sheet-valor { font-family: var(--serif); font-size: 1.6rem; color: var(--gold-deep); margin: 2px 0 16px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: var(--ivory); border-radius: 999px; margin-bottom: 18px; }
.tabs button {
  min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.steps { margin: 0 0 16px; padding-left: 1.3rem; color: var(--ink-soft); font-size: .95rem; }
.steps li { margin: 4px 0; }
#copiar.ok { background: var(--olive); border-color: var(--olive); }
.recebedor {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  margin: 14px 0; padding: 12px; border: 1px solid var(--gold); border-radius: 12px; background: var(--card);
  font-size: .85rem; color: var(--ink-soft);
}
.recebedor strong { font-size: 1.05rem; color: var(--ink); letter-spacing: .02em; }
.qr-box { border: 0 !important; margin: 0 !important; }
.qr-box summary { font-family: var(--sans); font-size: .95rem; min-height: 48px; padding: 6px 0; }
.qr-box img { display: block; margin: 4px auto 12px; width: 220px; height: 220px; border-radius: 8px; background: #fff; }
.tip { font-size: .88rem; color: var(--ink-soft); background: var(--ivory); padding: 10px 12px; border-radius: 10px; margin-top: 10px; }
#painel-cartao p { margin-bottom: 14px; }
.avisar { margin-top: 18px; }

@media (min-width: 760px) {
  .gifts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .chips { justify-content: center; margin: 30px 0 24px; padding: 2px; }
  .sheet { max-width: 460px; margin: auto; border-radius: 22px; }
  .grabber { display: none; }
}
@media (min-width: 1000px) { .gifts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pix-manual { margin-top: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px !important; word-break: break-all; min-height: 0; }
.ordem { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -4px 0 14px; font-size: .9rem; color: var(--ink-soft); }
.ordem select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; min-height: 40px; padding: 0 14px;
}
dialog:not([open]) { display: none; }
.sheet.sem-modal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
