/* ==========================================================================
   THIỆP CƯỚI — style.css  (tông đỏ rượu vang + kem, tối giản)
   ========================================================================== */
:root {
  --wine: #511419;
  --wine-2: #6a1b24;
  --wine-3: #350b0f;
  --cream: #ece4d8;
  --cream-dim: rgba(236, 228, 216, 0.72);
  --cream-line: rgba(236, 228, 216, 0.32);
  --paper: #f4eee5;
  --ivory: #fbf7f1;
  --gold: #b58b2f;
  --gold-2: #d9b76c;
  --ink: #4a2326;
  --ink-soft: #85625c;
  --line: #dccdbb;

  --f-display: "Viaoda Libre", "Times New Roman", serif;
  --f-serif: "EB Garamond", "Times New Roman", serif;
  --f-script: "The Nautigal", "Segoe Script", cursive;
  --f-amp: "Ms Madi", "Segoe Script", cursive;
  --f-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .18 0 0 0 0 .1 .14 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--wine-3); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(122, 29, 39, 0.55), transparent 70%),
    linear-gradient(180deg, #45100f 0%, var(--wine-3) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked, body.has-dialog { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--wine); color: var(--cream); font-size: 1.2rem; z-index: 99; }

/* Hoa trang trí */
.deco { position: absolute; pointer-events: none; overflow: visible; }
.garland { display: block; width: min(290px, 82%); aspect-ratio: 3 / 1; margin: 0 auto 16px; overflow: visible; pointer-events: none; }

/* Lớp hiệu ứng (hoa rơi, chạm bung tim) — nằm trên cùng nhưng không chặn chạm */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 30px;
  border: 0; border-radius: 999px;
  font-family: var(--f-serif); font-size: 1.08rem; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible, .link-btn:focus-visible, .flow__nav:focus-visible, .packet:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.btn--wine { background: var(--wine); color: var(--cream); box-shadow: 0 10px 24px rgba(81, 20, 25, .35); }
.btn--wine:hover { background: var(--wine-2); }
.btn--cream { background: var(--cream); color: var(--wine); text-transform: uppercase; font-size: .98rem; letter-spacing: .06em; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }
.btn--cream:hover { background: #fff7eb; }
.btn--ghost { background: transparent; color: var(--wine); border: 1px solid var(--line); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font-family: var(--f-serif); font-size: 1rem; font-weight: 600;
  color: var(--cream); text-decoration: underline; text-underline-offset: 4px;
}
.link-btn--wine { color: var(--wine); text-decoration: none; }

/* ==========================================================================
   BÌA THIỆP
   ========================================================================== */
.cover {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 15% 0%, #7a1d27 0%, transparent 60%),
    linear-gradient(160deg, #6b1820 0%, var(--wine) 45%, #2e080c 100%);
  transition: opacity .8s ease .25s, visibility 0s linear 1.05s;
}
.cover.is-leaving { opacity: 0; visibility: hidden; }
.cover__hearts { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cover__hearts span {
  position: absolute; bottom: -40px;
  color: var(--c, rgba(170, 45, 60, .55));
  font-size: var(--s, 18px);
  animation: heart-rise var(--d, 14s) linear var(--delay, 0s) infinite;
}
@keyframes heart-rise {
  0% { transform: translate(0, 0) rotate(-10deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: .9; }
  100% { transform: translate(var(--dx, 20px), -110vh) rotate(14deg); opacity: 0; }
}
.cover__card {
  position: relative;
  width: min(330px, 100%);
  padding: 34px 26px 32px;
  border-radius: 10px;
  background: #f7f1ea var(--noise);
  text-align: center;
  color: var(--wine);
  box-shadow: 0 30px 70px rgba(20, 2, 4, .55);
  animation: card-in 1s var(--ease) both;
  transition: transform .7s var(--ease), opacity .6s ease;
}
.cover.is-leaving .cover__card { transform: translateY(-36px) scale(.94); opacity: 0; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.deco--tl { top: -14px; left: -16px; width: 112px; height: 112px; }
.deco--br { bottom: -14px; right: -16px; width: 112px; height: 112px; transform: rotate(180deg); }
.cover__badge {
  width: 58px; height: 58px; margin: 0 auto 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #f7f1ea;
  background: radial-gradient(circle at 35% 30%, #7c1f2a, var(--wine-3));
  box-shadow: 0 10px 22px rgba(81, 20, 25, .4);
  animation: beat 2.4s ease-in-out infinite;
}
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.08); } 24% { transform: scale(1); } 36% { transform: scale(1.06); } }
.cover__names {
  margin: 0;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2rem, 10vw, 2.45rem); line-height: 1.12;
}
.cover__names span { display: block; }
.cover__names .cover__amp { font-family: var(--f-serif); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 12px; color: var(--wine); }
.divider i { width: 64px; height: 1px; background: currentColor; opacity: .55; }
.cover__date { font-size: 1.18rem; color: #7c4a4a; }
.cover__invite { margin: 16px 0 22px; font-size: 1.18rem; color: #7c4a4a; }
.cover__guest { display: block; margin-top: 2px; font-family: var(--f-display); font-weight: 400; font-size: 1.45rem; color: var(--wine); }
.cover__guest:empty { display: none; }

/* ==========================================================================
   THIỆP (nền giấy)
   ========================================================================== */
.invite {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background:
    var(--noise),
    radial-gradient(120% 40% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%),
    var(--paper);
  box-shadow: 0 0 80px rgba(0, 0, 0, .45);
  padding-bottom: 28px;
}

/* ---------- Phong thư ---------- */
.hero { position: relative; padding: 56px 16px 18px; text-align: center; }
.deco--hero-l, .deco--hero-r { top: -18px; width: 150px; height: 150px; }
.deco--hero-l { left: -34px; transform: rotate(-8deg); }
.deco--hero-r { right: -34px; transform: scaleX(-1) rotate(-8deg); }
.kicker { font-size: .82rem; font-weight: 500; letter-spacing: .38em; text-transform: uppercase; color: var(--wine); }
.envelope {
  position: relative;
  width: min(300px, 80vw);
  aspect-ratio: 1 / 1.08;
  margin: 26px auto 0;
}
.envelope__back {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(180deg, #5d151c, #4a1015);
  box-shadow: 0 22px 40px rgba(60, 10, 14, .35);
}
.envelope__back::before { /* nắp thư đã mở, dựng ngược lên */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 52%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 7px),
    linear-gradient(0deg, #4a1015, #6a1b24);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.envelope__photo {
  position: absolute; z-index: 1;
  left: 27%; bottom: 20%;
  width: 64%; aspect-ratio: 4 / 5; margin: 0;
  padding: 6px; background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  transform: translateY(42%) rotate(4deg);
  transition: transform 1.4s var(--ease) .5s;
}
.envelope__photo img { width: 100%; height: 100%; object-fit: cover; background: #ddd; }
body.is-open .envelope__photo { transform: translateY(0) rotate(7deg); }
.envelope__front {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 50%;
  background: #4c1016;
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 6px 6px;
}
.envelope__front::before, .envelope__front::after { content: ""; position: absolute; inset: 0; }
.envelope__front::before { background: linear-gradient(120deg, #6e1d26, #5a161d); clip-path: polygon(0 0, 50% 52%, 0 100%); }
.envelope__front::after { background: linear-gradient(240deg, #661a23, #54141a); clip-path: polygon(100% 0, 50% 52%, 100% 100%); }
.envelope__seal {
  position: absolute; z-index: 3; left: 50%; top: 76%;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  color: #8a6420;
  background: radial-gradient(circle at 38% 32%, #f3d98f, #c9993d 55%, #9c7124);
  box-shadow: 0 0 0 4px rgba(201, 153, 61, .35), 0 6px 14px rgba(0, 0, 0, .35), inset 0 0 0 5px rgba(255, 240, 200, .25);
}
.envelope__flowers { z-index: 4; left: -15%; top: 16%; width: 54%; height: 54%; }
.hero__names {
  position: relative;
  margin: 34px 0 6px;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.6rem, 13vw, 3.3rem); line-height: 1.18;
  color: var(--wine);
}
.hero__names span[data-name] { position: relative; display: block; }
.hero__amp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-amp); font-size: 1.6em;
  color: rgba(81, 20, 25, .12);
}

/* ---------- Thẻ đỏ (lễ cưới, tiệc cưới) ---------- */
.card {
  position: relative;
  margin: 26px 16px;
  padding: 34px 20px 30px;
  border-radius: 14px;
  text-align: center;
  color: var(--cream);
  background:
    var(--noise),
    radial-gradient(110% 50% at 50% 0%, rgba(255, 255, 255, .07), transparent 70%),
    var(--wine);
  box-shadow: 0 18px 40px rgba(60, 10, 14, .3);
}
.card__title { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.families {
  display: grid; grid-template-columns: 1fr 1px 1fr; gap: 12px;
  margin: 22px 0 24px;
}
.families__line { background: var(--cream-line); }
.family__label { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); }
.family__title { margin-top: 4px; font-size: .95rem; color: var(--cream-dim); }
.family__names { margin-top: 2px; font-weight: 700; font-size: 1rem; line-height: 1.45; }
.family__addr { margin-top: 6px; font-size: .82rem; line-height: 1.35; color: var(--cream-dim); }
.announce { font-size: .98rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; line-height: 1.5; }
.card__names { margin: 24px 0 26px; font-family: var(--f-display); font-size: clamp(2.4rem, 12vw, 2.9rem); line-height: 1.15; }
.card__names span { display: block; }
.card__names .card__amp { margin: 6px 0; font-family: var(--f-amp); font-size: 2.2rem; line-height: 1.1; }
.place-line, .place { font-size: 1.08rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.45; }
.place { font-weight: 600; }

/* Khối ngày giờ: giờ | thứ — ngày | tháng năm — âm lịch */
.when {
  display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center;
  column-gap: 22px; row-gap: 4px;
  margin-top: 18px;
}
.when__time, .when__wd { font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--cream-dim); }
.when__day { justify-self: end; font-family: var(--f-display); font-size: 3.1rem; line-height: 1; }
.when__my { display: flex; flex-direction: column; padding: 4px 0 4px 18px; border-left: 1px solid var(--cream-line); text-align: left; font-weight: 700; line-height: 1.45; text-transform: uppercase; }
.when__lunar { grid-column: 1 / -1; margin-top: 14px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-dim); text-wrap: balance; }

/* ---------- Tiêu đề phần trên nền giấy ---------- */
.section-title { margin: 0 0 6px; font-size: 1.32rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--wine); text-align: center; }

/* ---------- Album 3D ---------- */
.album { padding: 26px 0 10px; }
.flow {
  position: relative;
  height: clamp(300px, 92vw, 420px);
  margin-top: 18px;
  perspective: 1100px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.flow__stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.flow__card {
  position: absolute; left: 50%; top: 50%;
  width: 56%; max-width: 250px; aspect-ratio: 3 / 4.1;
  margin: 0; padding: 0; border: 0;
  border-radius: 14px; overflow: hidden;
  background: #d8cfc3;
  box-shadow: 0 16px 34px rgba(60, 10, 14, .3);
  cursor: pointer;
  transition: transform .7s var(--ease), opacity .7s ease, filter .7s ease;
  will-change: transform;
}
.flow__card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.flow__card.is-far { opacity: 0; pointer-events: none; }
.flow__card:not(.is-current) { filter: brightness(.82); }
.flow.is-dragging .flow__card { transition: none; }
.flow__nav {
  position: absolute; top: 50%; z-index: 5;
  width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  font-size: 1.6rem; line-height: 1; color: var(--wine);
  background: rgba(251, 247, 241, .82);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  cursor: pointer;
}
.flow__nav--prev { left: 10px; }
.flow__nav--next { right: 10px; }
.flow__count { margin-top: 12px; text-align: center; font-size: .9rem; letter-spacing: .1em; color: var(--ink-soft); }

/* ---------- Tiệc cưới: đếm ngược + lịch ---------- */
.card .deco--corner { left: -24px; top: -26px; width: 84px; height: 84px; }
.card .deco--corner-br { right: -22px; bottom: -24px; width: 84px; height: 84px; transform: rotate(180deg); }
.lead { margin-top: 18px; font-size: 1.2rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.countdown__title { margin: 26px 0 10px; font-family: var(--f-script); font-size: 2.3rem; line-height: 1.1; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown div { padding: 10px 0 8px; border: 1px solid var(--cream-line); border-radius: 12px; background: rgba(0, 0, 0, .08); }
.countdown b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-dim); }
.countdown__done { margin-top: 4px; font-size: 1.05rem; font-style: italic; color: var(--cream-dim); }
.calendar {
  margin: 26px 0 16px;
  padding: 16px 12px 14px;
  border-radius: 12px;
  color: var(--wine);
  background: var(--cream) var(--noise);
  box-shadow: inset 0 0 0 1px rgba(81, 20, 25, .08);
}
.calendar__title { font-family: var(--f-script); font-size: 2.3rem; line-height: 1.2; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; margin-top: 8px; font-size: .95rem; }
.calendar__wd { padding: 6px 0 8px; font-size: .74rem; letter-spacing: .06em; color: var(--ink-soft); border-bottom: 1.5px solid var(--wine); margin-bottom: 6px; }
.calendar__day { position: relative; display: grid; place-items: center; height: 32px; }
.calendar__day.is-wedding { color: #fff; font-weight: 700; }
.calendar__day.is-wedding svg { position: absolute; left: calc(50% - 19px); top: calc(50% - 18px); width: 38px; height: 38px; color: var(--wine); animation: beat 2.4s ease-in-out infinite; }
.calendar__day.is-wedding b { position: relative; }

/* ---------- Địa điểm ---------- */
.venue { padding: 30px 16px 6px; text-align: center; }
.venue__name { font-size: 1.05rem; font-weight: 600; color: var(--wine); }
.venue__addr { margin-top: 2px; font-size: .95rem; color: var(--ink-soft); }
.map-frame { position: relative; margin: 16px 0 10px; }
.deco--map { z-index: 1; right: -24px; top: -30px; width: 96px; height: 96px; transform: scaleX(-1) rotate(-14deg); }
.map {
  aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden;
  background: #e6ddd0;
  box-shadow: 0 10px 28px rgba(60, 10, 14, .18);
}
.map iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Hộp quà mừng ---------- */
.gift { padding: 36px 16px 10px; text-align: center; }
.gift__packets { position: relative; height: 290px; margin-top: 10px; }
.packet {
  position: absolute; top: 28px;
  width: 128px; aspect-ratio: 0.6;
  padding: 0; border: 0; border-radius: 8px;
  background: linear-gradient(160deg, #94202f, #6d1420 55%, #551019);
  box-shadow: 0 18px 30px rgba(60, 10, 14, .35), inset 0 0 0 1px rgba(255, 220, 160, .18);
  cursor: pointer;
  animation: sway 4.5s ease-in-out infinite;
}
.packet:nth-child(1) { left: calc(50% - 132px); --r: -13deg; }
.packet:nth-child(2) { left: calc(50% + 2px); top: 52px; --r: 11deg; animation-delay: -2.2s; }
.packet:only-child { left: calc(50% - 64px); --r: -6deg; }
@keyframes sway { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(calc(var(--r) + 3deg)) translateY(-6px); } }
.packet:hover { filter: brightness(1.08); }
.packet__flap, .packet__flap::before { position: absolute; left: 0; right: 0; top: 0; height: 30%; clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.packet__flap { background: #d9b76c; border-radius: 8px 8px 0 0; }
.packet__flap::before { content: ""; height: calc(100% - 2px); background: linear-gradient(180deg, #7a1724, #5e111b); }
.packet .deco { left: 6%; top: 30%; width: 88%; height: 50%; }
.packet__label {
  position: absolute; left: 0; right: 0; bottom: 10px;
  font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2);
}
.packet__spark { position: absolute; color: var(--gold); font-size: 22px; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.gift__hint { margin-top: 4px; font-weight: 600; font-style: italic; color: var(--ink); }

/* ---------- Lời cảm ơn ---------- */
.thanks { position: relative; padding: 40px 22px 10px; text-align: center; }
.thanks__text { font-size: 1.1rem; font-style: italic; line-height: 1.6; color: var(--ink); }
.thanks__names { margin-top: 10px; font-family: var(--f-script); font-size: 2.5rem; line-height: 1.2; color: var(--wine); }
.footer { margin-top: 26px; text-align: center; font-family: var(--f-ui); font-size: .78rem; color: var(--ink-soft); opacity: .8; }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   NÚT NHẠC NỔI
   ========================================================================== */
.music-fab {
  position: fixed; z-index: 40;
  right: max(14px, calc(50% - 240px + 14px)); bottom: calc(16px + env(safe-area-inset-bottom));
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 2px solid var(--cream); border-radius: 50%;
  color: var(--cream); background: var(--wine);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.music-fab.is-playing::before { /* vòng sóng lan ra khi đang phát nhạc */
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--wine);
  animation: ripple 2s ease-out infinite;
}
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }
.music-fab:not(.is-playing) svg { opacity: .55; }
.music-fab.is-waiting::after {
  content: attr(data-hint);
  position: absolute; right: 56px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  font-family: var(--f-ui); font-size: .8rem;
  color: var(--wine); background: var(--ivory);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translate(-4px, -50%); } }

/* ==========================================================================
   HỘP THOẠI (xác nhận tham dự, hộp quà)
   ========================================================================== */
dialog { color: inherit; }
.sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 30px 20px 22px;
  border: 0; border-radius: 18px;
  background: var(--ivory) var(--noise);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-in .45s var(--ease); }
.sheet::backdrop { background: rgba(30, 6, 9, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet__close {
  position: absolute; top: 10px; right: 10px;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(81, 20, 25, .07); color: var(--wine); font-size: 1rem; cursor: pointer;
}
.sheet__title { margin: 0; text-align: center; font-size: 1.45rem; font-weight: 700; color: var(--wine); }
.sheet__sub { margin: 6px 0 18px; text-align: center; font-size: .98rem; color: var(--ink-soft); }
.sheet__foot { margin-top: 16px; text-align: center; font-size: .92rem; font-style: italic; color: var(--ink-soft); }
.cal-links { display: grid; gap: 10px; margin-top: 16px; }

.field { display: block; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field__label { display: block; margin: 0 0 7px; padding: 0; font-weight: 600; color: var(--wine); }
.field__label em { font-weight: 400; color: var(--ink-soft); }
.field input[type=text], .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.4;
  resize: vertical;
}
.field input[type=text]:focus, .field textarea:focus { outline: 2px solid var(--wine); outline-offset: 0; border-color: transparent; }
.choices { display: grid; gap: 8px; }
.choices--row { grid-template-columns: 1fr 1fr; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font-family: var(--f-ui); font-size: .95rem;
  transition: border-color .2s, background .2s;
}
.choice span::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c3ae98; transition: box-shadow .2s, border-color .2s; }
.choice input:checked + span { border-color: var(--wine); background: rgba(81, 20, 25, .05); color: var(--wine); font-weight: 600; }
.choice input:checked + span::before { border-color: var(--wine); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--wine); }
.choice input:focus-visible + span { outline: 2px solid var(--wine); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(81, 20, 25, .07); color: var(--wine); font-size: 1.3rem; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 40px; text-align: center; font-family: var(--f-ui); font-size: 1.15rem; font-weight: 600; color: var(--wine); }
.form-error { min-height: 1.3em; margin: -4px 0 10px; font-family: var(--f-ui); font-size: .88rem; color: #b3261e; }
.rsvp-done { text-align: center; padding: 8px 0 2px; }
.rsvp-done__icon { width: 64px; height: 64px; margin: 6px auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--wine); color: var(--cream); font-size: 1.7rem; animation: beat 2.4s ease-in-out infinite; }
.rsvp-done__text { margin-bottom: 18px; font-size: 1.15rem; line-height: 1.5; color: var(--wine); }
.rsvp-done__fallback { margin-bottom: 10px; }

/* Hộp quà: thẻ ngân hàng */
.tabs { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.tabs:empty { display: none; }
.tab { min-height: 40px; padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-family: var(--f-ui); font-size: .9rem; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.bank { margin-top: 14px; text-align: center; }
.bank__who { font-weight: 700; font-size: 1.08rem; color: var(--wine); }
.bank__who:empty { display: none; }
.bank__qr { width: min(230px, 70vw); margin: 12px auto; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(60, 10, 14, .14); }
.bank__qr canvas, .bank__qr img { display: block; width: 100%; height: auto; }
.bank__empty { margin: 14px auto; padding: 28px 12px; max-width: 260px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--ink-soft); font-style: italic; }
.bank__name { font-family: var(--f-ui); font-size: .9rem; color: var(--ink-soft); }
.bank__acc { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; font-family: var(--f-ui); font-size: 1.35rem; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.bank__acc:has(span:empty) { display: none; }
.copy-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(81, 20, 25, .07); color: var(--wine); cursor: pointer; }
.bank__owner { margin: 2px 0 16px; font-family: var(--f-ui); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.bank__status { min-height: 1.4em; margin-top: 8px; font-family: var(--f-ui); font-size: .86rem; color: var(--wine); }

/* ---------- Xem ảnh to ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(14, 3, 5, .96); color: #fff;
  overscroll-behavior: contain;
}
.lightbox[open] { display: grid; place-items: center; animation: fade-in .3s ease; }
.lightbox::backdrop { background: transparent; }
@keyframes fade-in { from { opacity: 0; } }
.lightbox__img { max-width: 100%; max-height: 84dvh; object-fit: contain; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lightbox__count { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-family: var(--f-ui); font-size: .9rem; opacity: .8; }
.lightbox__close, .lightbox__nav { position: absolute; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.lightbox__close { top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; font-size: 1.1rem; }
.lightbox__nav { top: 50%; width: 46px; height: 46px; margin-top: -23px; font-size: 1.8rem; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .cover__hearts { display: none; }
}
