@font-face {
  font-family: Cormorant;
  src: url('/assets/titulos.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/texto.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --white: #fffefa;
  --stone: #ede8de;
  --ink: #202b31;
  --muted: #454e52;
  --blue: #253743;
  --gold: #775a33;
  --gold-soft: #f3ece0;
  --rule: #c9c1b4;
  --green: #215341;
  --green-soft: #e6f0ec;
  --serif: Cormorant, Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.125rem/1.55 var(--sans); }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
h1 { font-size: clamp(3.4rem, 7.2vw, 6.4rem); }
h2 { font-size: clamp(2.6rem, 4.8vw, 4.1rem); }
a { color: inherit; text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, select { color: inherit; }
button:not(:disabled), select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #9b6222; outline-offset: 4px; }
section[id] { scroll-margin-top: 84px; }
.shell { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: 10px; z-index: 30; padding: 8px 12px; background: var(--white); transform: translateY(-180%); }
.skip:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule);
  background: rgb(255 254 250 / .94);
  backdrop-filter: blur(8px);
}
.header-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.header-link { font-weight: 600; font-size: 1rem; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; border-bottom: 2px solid transparent; transition: border-color .15s ease, color .15s ease; }
.header-link:hover { color: var(--gold); border-bottom-color: var(--gold); }
.monogram { white-space: nowrap; text-decoration: none; font: 500 2.35rem/.95 var(--serif); letter-spacing: -.055em; }
.monogram span { font-size: .62em; color: var(--gold); margin-inline: .19em; }

.button {
  min-height: 52px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 650 1.0625rem/1.25 var(--sans);
  text-decoration: none;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: var(--white); background: var(--blue); }
.button-primary:hover { background: #395260; }
.button-outline { border-color: #687780; background: var(--white); color: var(--blue); }
.button-outline:hover { background: #e9edef; }
.button-light { background: var(--white); color: var(--blue); }
.button-light:hover { background: #e7ded0; }

.welcome { display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: clamp(30px, 6vw, 78px); padding-block: clamp(38px, 6.5vw, 84px); }
.eyebrow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.eyebrow { font-size: .875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gold); }
.countdown-pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; background: var(--gold-soft); border: 1px solid #d5c4a9; color: var(--gold); font-size: .875rem; font-weight: 700; }
.subtitle { margin: 8px 0 24px; font: 500 2rem/1.1 var(--serif); color: var(--gold); }
.welcome-details { border-inline-start: 2px solid #a68b62; padding-inline-start: 16px; }
.welcome-details p + p { margin-top: 3px; }
.event-date { font-weight: 700; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.portrait { position: relative; z-index: 0; isolation: isolate; margin: 0 9px 9px 0; border: 1px solid #b4a58d; padding: 8px; background: var(--white); box-shadow: 9px 9px 0 -1px #e4d8c5, 9px 9px 0 #bfaa8d; }
.portrait img { display: block; width: 100%; height: auto; }

.attendance { background: var(--stone); border-block: 1px solid var(--rule); }
.attendance-inner { padding-block: 48px; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 32px; }
.attendance-inner > div p { margin-top: 10px; color: var(--muted); max-width: 44ch; }
#attendance-form { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(18px, 3vw, 26px); box-shadow: 0 4px 14px rgb(37 55 67 / .05); }
.input-label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.text-input {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 1px solid #737b7e;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--white);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.text-input:focus { border-color: var(--blue); }
.select-wrap { position: relative; }
.select-wrap select.text-input {
  -webkit-appearance: none;
  appearance: none;
  height: 52px;
  line-height: 1.25;
  padding-right: 40px;
}
.select-wrap select.text-input::picker-icon { display: none; }
.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 12px;
  height: 8px;
  transform: translateY(-50%);
  color: var(--blue);
  pointer-events: none;
}
.reply-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.reply-actions .button.is-selected { box-shadow: inset 0 0 0 2px var(--gold); }
.reply-actions .button-outline.is-selected { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.message { margin-top: 12px; font-weight: 650; color: var(--green); }
.message:empty { margin: 0; }
.message[data-error="true"] { color: #8b342d; }

.section { padding-block: clamp(46px, 7vw, 82px); }
.memories { background: var(--paper); border-bottom: 1px solid var(--rule); }
.memories-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.carousel-controls { display: inline-flex; align-items: center; gap: 8px; }
.carousel-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #687780;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease;
}
.carousel-btn:hover { background: #e9edef; }
.carousel-btn-text { font-size: .95rem; padding-inline: 14px; }
.memories-carousel { position: relative; }
.carousel-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 8px 12px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.memory-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  height: clamp(230px, 34vw, 390px);
}
.memory-frame {
  margin: 0;
  border: 1px solid #b4a58d;
  padding: 8px;
  background: var(--white);
  box-shadow: 7px 7px 0 -1px #e4d8c5, 7px 7px 0 #bfaa8d;
}
.memory-trigger {
  display: block;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.memory-trigger img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}
.memory-trigger:hover img { transform: scale(1.02); }
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c7bba7;
  transition: width .2s ease, background-color .2s ease;
}
.carousel-dot.is-active { width: 28px; background: var(--blue); }
.photo-dialog-actions { display: inline-flex; align-items: center; gap: 8px; }

.gifts { background: var(--white); }
.section-intro { max-width: 68ch; margin-top: 12px; color: var(--muted); }
.gift-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px 16px;
  margin-block: 24px 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid #737b7e;
  border-radius: 8px;
  background: var(--white);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
}
.toggle-chip input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; cursor: pointer; }
.gift-summary { color: var(--muted); font-size: .95rem; font-weight: 600; margin-bottom: 24px; }
.empty-state {
  padding: 28px;
  border: 1px dashed var(--rule);
  border-radius: 12px;
  background: var(--paper);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.gift-group + .gift-group { margin-top: 38px; }
.gift-group h3 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700; margin-bottom: 16px; }
.gift-group h3::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.gift-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 2px 6px rgb(37 55 67 / .06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gift-card:not([data-reserved="true"]):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgb(37 55 67 / .10);
}
.gift-card[data-reserved="true"] { background: #fbf9f5; }
.gift-card[data-reserved="true"] .gift-photo { opacity: .68; filter: grayscale(.2); }
.gift-photo { display: block; flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 1.45; object-fit: contain; padding: 10px; background: #f5efe8; border-bottom: 1px solid #e7dfd3; }
.gift-content { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.gift-content h4 { font-size: 1.1rem; line-height: 1.35; font-weight: 700; }
.gift-content .button { align-self: start; margin-top: auto; min-height: 46px; padding: 8px 16px; font-size: 1rem; }
.gift-badge {
  align-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 700;
}
.gift-badge-reserved { background: var(--stone); color: var(--muted); margin-top: auto; }
.gift-badge-mine { background: var(--green-soft); color: var(--green); }
.inline-confirmation { color: var(--green); font-weight: 650; font-size: .95rem; }

.celebration { background: var(--blue); color: var(--white); }
.event-details { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 23px; padding-block: 48px; }
.event-details h2 { margin-bottom: 12px; }
.place { font-size: 1.25rem; font-weight: 700; }
.event-details address { font-style: normal; margin-bottom: 10px; }
.celebration-time { font-weight: 650; margin-bottom: 4px; color: #e8dfd0; }
.event-links { display: grid; gap: 10px; }
.event-links a { font-weight: 650; }
.button-on-dark { color: var(--white); border-color: #c8c1b5; background: transparent; }
.button-on-dark:hover { background: #395260; }
.footer { background: var(--stone); border-top: 1px solid var(--rule); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding-block: 22px; }
.footer-note { color: var(--muted); font-size: .95rem; }

dialog { width: min(500px, calc(100% - 24px)); padding: clamp(18px, 5vw, 26px); color: var(--ink); background: var(--white); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 20px 50px rgb(16 26 32 / .28); }
dialog::backdrop { background: rgb(24 34 39 / .68); }
dialog h2 { font-size: clamp(2.1rem, 5vw, 2.75rem); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  font-size: 1.4rem;
  line-height: 1;
}
.dialog-close:hover { background: var(--stone); }
.gift-dialog-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block: 14px 18px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.gift-dialog-preview img { width: 72px; height: 72px; object-fit: contain; background: #f5efe8; border-radius: 6px; padding: 4px; flex: 0 0 auto; }
#gift-dialog-name { font-weight: 700; line-height: 1.35; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.invite-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; }
.invite-toolbar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--white); border-bottom: 1px solid var(--rule); }
.invite-toolbar h2 { font-size: clamp(1.8rem, 4vw, 2.35rem); }
.invite-toolbar .button { min-height: 46px; gap: 6px; }
.invite-toolbar .button span { font-size: 1.4em; line-height: 0; }
.invite-dialog img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 95px); object-fit: contain; background: var(--paper); }
body:has(.invite-dialog[open]) { overflow: hidden; }
@media (max-width: 640px) {
  .invite-dialog img { max-height: none; }
}

.admin { min-height: 80vh; }
.admin h1 { font-size: clamp(2.8rem, 5vw, 4.4rem); }
.admin h2 { font-size: clamp(2.05rem, 4vw, 3rem); }
.admin > p:not(:empty) { margin-block: 15px; }
.admin:has(#dashboard[hidden]) h1,
.admin:has(#dashboard[hidden]) > #session-message,
.admin:has(#dashboard[hidden]) .admin-session { max-width: 490px; margin-inline: auto; }
.admin:has(#dashboard[hidden]) h1,
.admin:has(#dashboard[hidden]) > #session-message { text-align: center; }
.admin-form { display: grid; justify-items: start; gap: 14px; width: 100%; max-width: 490px; margin: 20px auto 0; }
.admin-form > div { width: 100%; }
.admin-session { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding-block: 14px; }
.admin-session p { overflow-wrap: anywhere; font-weight: 600; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
}
.admin-tabs a:hover { background: var(--stone); border-color: var(--blue); }
.admin-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.admin-filters { display: grid; grid-template-columns: minmax(210px, 260px) minmax(200px, 1fr) auto auto; align-items: end; gap: 12px; }
.admin-panel, .admin-form { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 3px 12px rgb(37 55 67 / .05); }
.admin-panel + .admin-panel { margin-top: 22px; }
.admin-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin: 20px 0; }
.admin-metrics > div { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.admin-metrics dt { font-size: .95rem; font-weight: 650; color: var(--muted); }
.admin-metrics dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; }
.rsvp-state { font-weight: 650; }
.rsvp-state[data-state="sim"] { color: var(--green); }
.rsvp-state[data-state="nao"] { color: #8b342d; }

.access-create-form {
  margin-top: 18px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.access-create-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 240px) auto;
  align-items: end;
  gap: 12px;
}
.access-hint { margin-top: 10px; font-size: .95rem; color: var(--muted); }
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--stone);
  font-size: .875rem;
  font-weight: 650;
}
.role-pill-super { background: var(--gold-soft); color: var(--gold); }
.role-pill-self { background: var(--green-soft); color: var(--green); }
.access-state { font-weight: 650; }
.access-state[data-state="active"] { color: var(--green); }
.access-state[data-state="revoked"] { color: #8b342d; }
.access-state[data-state="pending"] { color: var(--gold); }

.temporary-password { border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); padding: 14px; margin-block: 12px; }
.temporary-password .button { margin-top: 10px; }
#temporary-value { font-family: ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.access-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button-small { min-height: 42px; padding-inline: 12px; font-size: .95rem; }
#access-dialog p { margin-top: 9px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin-top: 20px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid var(--rule); padding: 11px 18px 11px 0; vertical-align: middle; }
th { font-size: .95rem; color: var(--muted); }

@media (max-width: 880px) {
  .shell { width: calc(100% - 48px); }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gift-toolbar { grid-template-columns: 1fr 1fr; }
  .toggle-chip { grid-column: 1 / -1; justify-self: start; }
  .admin-filters { grid-template-columns: 1fr 1fr; }
  .access-create-grid { grid-template-columns: 1fr 1fr; }
  .access-create-grid .button { grid-column: 1 / -1; justify-self: start; }
  .welcome { gap: 25px; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 58px; }
  .header-nav { gap: 14px; }
  .hide-xs { display: none; }
  .welcome { grid-template-columns: 1fr; gap: 18px; padding-block: 24px; }
  .subtitle { font-size: 1.65rem; margin-bottom: 14px; }
  .welcome-details { padding-inline-start: 11px; }
  .event-date { max-width: 28ch; }
  .welcome-actions { display: grid; margin-top: 16px; gap: 8px; }
  .attendance-inner, .event-details { grid-template-columns: 1fr; gap: 16px; padding-block: 32px; }
  .carousel-track { gap: 12px; padding: 2px 6px 12px; }
  .memory-frame { padding: 5px; box-shadow: 4px 4px 0 -1px #e4d8c5, 4px 4px 0 #bfaa8d; }
  .gift-toolbar { grid-template-columns: 1fr; }
  .admin-filters { grid-template-columns: 1fr; }
  .access-create-grid { grid-template-columns: 1fr; }
  .access-create-grid .button { justify-self: stretch; }
  .event-links { justify-self: start; }
  .gift-grid { grid-template-columns: 1fr; gap: 12px; }
  .gift-card { display: grid; grid-template-columns: clamp(100px, 34%, 140px) 1fr; }
  .gift-photo { min-height: 100%; aspect-ratio: 1; padding: 8px; border-bottom: 0; border-right: 1px solid #e7dfd3; }
  .gift-content { padding: 12px; }
  .gift-content .button { min-height: 48px; padding-inline: 12px; }
}
@media (max-width: 480px) {
  .reply-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .memory-trigger img, .gift-card, .button { transition: none; }
}
