*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-700); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--blue-700); line-height: 1.2; }
p { margin: 0 0 1rem; }
small { font-weight: 400; color: var(--ink-soft); }
strong { font-weight: 600; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.bg-pattern {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg) url('/img/pattern-tile.jpg') center top / 420px auto repeat;
}
.bg-pattern::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(238,243,249,0.55) 0%, rgba(238,243,249,0.78) 40%, rgba(238,243,249,0.86) 100%);
}

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; z-index: 50; }

.page { max-width: 540px; margin: 0 auto; padding: 16px 16px 110px; }

/* ---------- Hero ---------- */
.hero { margin: 4px 0 22px; }
.hero-frame {
  border-radius: 28px;
  overflow: hidden;
  background: var(--white);
  padding: 8px;
  box-shadow: var(--shadow);
}
.hero-frame img { border-radius: 22px; width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow);
  margin: 0 0 22px;
  position: relative;
}
.card.arch {
  border-radius: 270px 270px var(--radius) var(--radius) / 130px 130px var(--radius) var(--radius);
  padding-top: 56px;
}
.card.narrow { margin-top: 10px; }
.card.empty { text-align: center; padding: 34px 22px; }

.script-title {
  font-family: var(--font-script);
  font-size: 3rem;
  line-height: 1;
  color: var(--blue-500);
  text-align: center;
  margin: 0 0 8px;
}
.page-title { text-align: center; font-size: 1.55rem; margin-bottom: 18px; }
.section-title { text-align: center; font-size: 1.45rem; margin-bottom: 12px; font-weight: 700; }
.section-title .script {
  display: block;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--blue-500);
  margin-bottom: 2px;
}
.section-intro { text-align: center; color: var(--ink-soft); }
.section-intro.small { font-size: 0.95rem; }
.lead { text-align: center; font-size: 1.05rem; }
.back { display: inline-block; font-size: 0.92rem; text-decoration: none; color: var(--ink-soft); margin-bottom: 6px; }
.back:hover { color: var(--blue-700); }

/* ---------- Separator with heart ---------- */
.sep { display: flex; align-items: center; gap: 12px; color: var(--blue-200); margin: 18px 0; }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 2px dotted var(--blue-200); }
.sep .heart { color: var(--blue-500); flex: none; }

/* ---------- Event info ---------- */
.event-info { list-style: none; margin: 4px 0 18px; padding: 0; }
.event-info li {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 6px;
  font-size: 1.12rem;
  border-bottom: 2px dotted var(--blue-100);
}
.event-info li:last-child { border-bottom: 0; }
.event-info .icon { color: var(--blue-700); flex: none; display: inline-flex; }
.event-info.compact li { font-size: 1rem; padding: 8px 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 11px 20px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .icon { display: inline-flex; }
.btn-primary { background: var(--blue-700); color: var(--white); box-shadow: 0 6px 16px rgba(63,95,154,.28); }
.btn-primary:hover { background: var(--blue-800); }
.btn-outline { background: var(--white); color: var(--blue-700); border-color: var(--blue-200); }
.btn-outline:hover { border-color: var(--blue-400); background: var(--blue-50); }
.btn-soft { background: var(--blue-100); color: var(--blue-800); }
.btn-soft:hover { background: #cfdff1; }
.btn-lg { width: 100%; font-size: 1.08rem; min-height: 54px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0 4px; }
.btn-row .btn { flex: 1 1 auto; }
.main-actions { margin-top: 14px; flex-direction: column; }
.btn[disabled], .btn.is-busy { opacity: .7; pointer-events: none; }

/* ---------- Diapers ---------- */
.diapers { text-align: center; }
.sizes { list-style: none; display: flex; justify-content: center; gap: 10px; padding: 0; margin: 8px 0 12px; }
.sizes li {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-800);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
}

/* ---------- Gifts ---------- */
.gifts { margin: 30px 0 22px; }
.gift-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
.gift-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  scroll-margin-top: 16px;
}
.gift-media { position: relative; aspect-ratio: 1 / 1; background: var(--blue-50); }
.gift-media img { width: 100%; height: 100%; object-fit: cover; }
.gift-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--blue-300); }
.pill {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: .01em;
  background: var(--white); color: var(--blue-700); box-shadow: var(--shadow-sm);
}
.pill-reservado { background: var(--amber-100); color: var(--amber-700); }
.pill-presenteado { background: var(--green-100); color: var(--green-700); }
.gift-free .pill { background: var(--blue-100); color: var(--blue-800); }
.gift-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.gift-name { font-size: 1.2rem; }
.gift-desc { color: var(--ink-soft); font-size: 0.95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gift-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.95rem; }
.gift-price { font-weight: 600; color: var(--blue-700); }
.gift-qty { color: var(--ink-soft); }
.gift-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.gift-done { margin: 4px 0 0; color: var(--ink-soft); font-style: italic; }
.gift-store { font-size: 0.9rem; align-self: flex-start; }
.status-presenteado .gift-media img, .status-reservado .gift-media img { filter: saturate(.6) opacity(.75); }

.gift-summary {
  display: flex; gap: 14px; align-items: center;
  background: var(--blue-50); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
}
.gift-summary img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; }
.gift-summary div { display: flex; flex-direction: column; gap: 2px; }
.price-big { font-family: var(--font-display); font-size: 1.4rem; color: var(--blue-700); font-weight: 700; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field legend, .field .label { font-weight: 600; font-size: 0.97rem; }
.field input[type="text"], .field input[type="tel"], .field input[type="number"], .field input[type="url"],
.field input[type="password"], .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border: 2px solid var(--blue-100); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue-400); box-shadow: var(--focus); }
.field textarea { resize: vertical; min-height: 80px; }
.field.choice { border: 0; padding: 0; margin: 0; }
.radio, .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; padding: 8px 0; cursor: pointer; }
.radio input, .check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue-700); flex: none; }
.field-people input { max-width: 140px; }
.field-error { color: var(--red-700); font-size: 0.9rem; }
.form-error { background: var(--red-100); color: var(--red-700); padding: 10px 14px; border-radius: var(--radius-sm); }
.hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }
.amount-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.amount-presets button {
  font: inherit; font-weight: 600; color: var(--blue-700); background: var(--blue-50);
  border: 2px solid var(--blue-100); border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.amount-presets button:hover, .amount-presets button.on { border-color: var(--blue-400); background: var(--blue-100); }

/* ---------- Flash ---------- */
.flash-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--blue-100); color: var(--blue-800); }
.flash-success { background: var(--green-100); color: var(--green-700); }
.flash-error { background: var(--red-100); color: var(--red-700); }

/* ---------- Status page ---------- */
.status-page .status-block { text-align: center; }
.status-block[hidden] { display: none; }
.status-pending .page-title::after {
  content: ""; display: block; width: 28px; height: 28px; margin: 14px auto 0;
  border: 3px solid var(--blue-100); border-top-color: var(--blue-500); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bottom bar (mobile) ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -8px 24px rgba(63,95,154,.12);
  transform: translateY(110%); transition: transform .25s ease;
}
.bottombar.show { transform: none; }
.bottombar .btn { flex: 1; min-height: 46px; }
.bottombar .btn-primary { flex: 1.6; }

/* ---------- Footer ---------- */
.site-footer { max-width: 540px; margin: 0 auto; padding: 0 22px 120px; text-align: center; }
.footer-script { font-family: var(--font-script); font-size: 2rem; color: var(--blue-500); line-height: 1.15; margin: 0 0 6px; }
.footer-small { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  .page { max-width: 640px; }
  .site-footer { max-width: 640px; }
  .hero-frame { max-width: 460px; margin: 0 auto; }
  .gift-grid { grid-template-columns: 1fr 1fr; }
  .main-actions { flex-direction: row; }
  .card { padding: 32px 30px; }
  .card.arch { padding-top: 60px; }
  .bottombar { display: none; }
  .page { padding-bottom: 40px; }
  .site-footer { padding-bottom: 60px; }
}
@media (min-width: 900px) {
  .page { max-width: 760px; }
  .site-footer { max-width: 760px; }
  .gift-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bottombar { transition: none; }
}
