/* ===== Popup RSVP — thẻ nhỏ gọn, centered, backdrop blur ===== */
/* Overlay TỰ cuộn (không dùng flex-center cứng) → không bao giờ cắt nội dung trên điện thoại */
.rsvp-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(58, 42, 26, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  animation: fadeIn 0.4s ease both;
}
.rsvp-overlay.hidden { display: none; }
.rsvp-popup {
  background: var(--white);
  border-radius: 22px;
  width: 100%; max-width: 400px;
  margin: auto; /* center khi ngắn, overlay cuộn khi dài — không cắt */
  padding: 22px 18px 20px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInUp 0.45s ease both;
}
.rsvp-popup-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--cream); color: var(--brown);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rsvp-popup-title {
  text-align: center; font-size: 1.3rem; color: var(--brown-dark);
  font-weight: 700; margin-bottom: 4px; padding-right: 30px;
}
.rsvp-popup-sub {
  text-align: center; color: var(--text-light); font-size: 0.9rem; margin-bottom: 16px;
}
.rsvp-reopen {
  position: fixed; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 16px; z-index: 90;
  padding: 12px 20px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--champagne), #b8912b);
  color: #fff; font-family: inherit; font-size: 0.95rem; font-weight: 600;
  box-shadow: 0 6px 18px rgba(212,175,55,0.5); cursor: pointer;
  display: none;
}

/* ===== Tên khách mời — nhấn mạnh ===== */
.rsvp-guest-name {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.9rem, 7vw, 2.4rem);
  color: var(--gold);
  text-align: center;
  line-height: 1.25;
  margin: 2px 0 8px;
  word-break: break-word;
  text-shadow: 0 1px 8px rgba(201,162,39,0.18);
}

/* ===== Nút Tham dự / Không tham dự =====
   - Tham dự: SOLID vàng champagne (nổi bật) + hover đậm/phóng to nhẹ
   - Không tham dự: GHOST viền chìm
   Fix root cause cắt nút: ép display:flex + width:100% + box-sizing */
.rsvp-popup .choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsvp-popup .choice { position: relative; }
.rsvp-popup .choice .choice-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 8px;
  border-radius: 12px;
  transition: all 0.18s ease;
  text-align: center;
  cursor: pointer;
}
.rsvp-popup .choice-box .choice-icon {
  display: inline-flex;
  font-size: 1.15rem;
  line-height: 1;
  margin: 0;
  flex: 0 0 auto;
}
.rsvp-popup .choice-box .choice-text {
  display: inline-block;
  font-size: clamp(0.8rem, 3.2vw, 0.93rem);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* --- SOLID: Tham dự (mặc định nổi bật vì checked sẵn) --- */
.rsvp-popup .choice-box--solid {
  background: linear-gradient(135deg, var(--champagne), #b8912b);
  border: 1.5px solid var(--champagne);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(212,175,55,0.35);
}
.rsvp-popup .choice-box--solid .choice-text { color: var(--white); }
/* Hover: đậm hơn + phóng to nhẹ */
.rsvp-popup .choice:hover .choice-box--solid {
  background: linear-gradient(135deg, #c9a12f, #a5801f);
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(212,175,55,0.45);
}
/* Khi KHÔNG được chọn → mờ xuống thành outline vàng */
.rsvp-popup .choice input:not(:checked) + .choice-box--solid {
  background: transparent;
  color: var(--gold);
  box-shadow: none;
}
.rsvp-popup .choice input:not(:checked) + .choice-box--solid .choice-text { color: var(--gold); }
.rsvp-popup .choice input:checked + .choice-box--solid {
  background: linear-gradient(135deg, var(--champagne), #b8912b);
}
.rsvp-popup .choice input:checked + .choice-box--solid .choice-text { color: var(--white); }

/* --- GHOST: Không tham dự (chìm, viền mảnh) --- */
.rsvp-popup .choice-box--ghost {
  background: transparent;
  border: 1.5px solid #ddd2bd;
  color: var(--text-light);
}
.rsvp-popup .choice-box--ghost .choice-text { color: var(--text-light); font-weight: 500; }
.rsvp-popup .choice:hover .choice-box--ghost {
  border-color: #c9b98f;
  background: rgba(138,122,104,0.06);
}
/* Khi chọn "Không tham dự" → viền nâu rõ hơn một chút */
.rsvp-popup .choice input:checked + .choice-box--ghost {
  border-color: var(--brown);
  background: rgba(91,70,54,0.07);
}
.rsvp-popup .choice input:checked + .choice-box--ghost .choice-text { color: var(--brown); font-weight: 600; }

.rsvp-popup textarea { min-height: 64px; }
.rsvp-popup .field-label { margin-bottom: 6px; font-size: 0.9rem; }
.rsvp-popup .btn { padding: 13px 24px; font-size: 1rem; }
@media (max-width: 360px) {
  .rsvp-popup { padding: 18px 12px 16px; }
  .rsvp-popup .choice .choice-box { padding: 11px 5px; gap: 5px; }
  .rsvp-popup .choice-box .choice-icon { font-size: 0.95rem; }
}

/* ===== Popup phóng to QR mừng cưới ===== */
.qrzoom-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(58, 42, 26, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  animation: fadeIn 0.3s ease both;
}
.qrzoom-overlay.hidden { display: none; }
.qrzoom-card {
  background: var(--white);
  border-radius: 22px;
  width: 100%; max-width: 340px;
  margin: auto;
  padding: 22px 20px 20px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: fadeInUp 0.35s ease both;
}
.qrzoom-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--cream); color: var(--brown);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qrzoom-card img {
  width: 100%; max-width: 280px;
  aspect-ratio: 1/1; object-fit: contain;
  border-radius: 16px; border: 1px solid rgba(201,162,39,0.25);
  background: #fff; margin-bottom: 12px;
}
.qrzoom-name {
  font-weight: 700; color: var(--brown-dark);
  font-size: 1.05rem; margin-bottom: 14px;
}
.qr-zoomable { cursor: zoom-in; }

/* ===== Thiệp giấy kiểu cũ (kem, hoa văn góc) ===== */
.paper-card {
  position: relative;
  background: linear-gradient(135deg, #FFF8E7 0%, #F5E6D3 100%);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.paper-card + .paper-card { margin-top: 16px; }
.paper-noise {
  position: absolute; inset: 0; opacity: 0.18; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.3'/%3E%3C/svg%3E");
}
.floral-corner { position: absolute; width: 72px; height: 72px; opacity: 0.4; pointer-events: none; }
.paper-inner { position: relative; z-index: 2; padding: 26px 18px; text-align: center; }

.script { font-family: 'Great Vibes', cursive; }
.title-red {
  color: #B22222; font-weight: 700; letter-spacing: 0.2em;
  font-size: 1.15rem; margin-bottom: 12px;
}
.title-red-lg { font-size: 1.35rem; }

.couple-mini { display: flex; align-items: flex-start; justify-content: center; gap: 14px; }
.couple-mini .avatar {
  width: 74px; height: 74px; border-radius: 50%; object-fit: cover;
  border: 3px solid #d8b4fe; display: block; margin: 0 auto 8px;
}
.couple-mini .name {
  font-family: 'Great Vibes', cursive; font-size: 1.5rem; color: #6B46C1;
  line-height: 1.2; margin-bottom: 4px;
}
.couple-mini .parents { font-size: 0.78rem; color: #718096; line-height: 1.4; }
.couple-mini .address { font-size: 0.68rem; color: #a0aec0; margin-top: 2px; }
.heart-beat { animation: pulse 1.6s ease infinite; align-self: center; margin-top: 26px; }

.guest-name-line {
  font-family: 'Great Vibes', cursive; font-size: 1.9rem; color: var(--gold);
  line-height: 1.25; margin: 6px 0 14px; word-break: break-word;
}

.event-line { margin: 10px 0; }
.event-line .lbl { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.event-line .val { font-size: 1.05rem; color: var(--brown-dark); font-weight: 600; margin-top: 2px; }
.event-line .sub { font-size: 0.82rem; color: var(--text-light); }

/* Header compact */
.invite-top {
  text-align: center; padding: 22px 16px 6px;
}
.invite-top .monogram {
  font-family: 'Great Vibes', cursive; font-size: 2rem; color: var(--gold); line-height: 1;
}
.invite-top .top-date { font-size: 0.8rem; letter-spacing: 0.25em; color: var(--text-light); margin-top: 6px; text-transform: uppercase; }

.main-wrap { max-width: 480px; margin: 0 auto; padding: 0 14px; }

@media (min-width: 768px) {
  .couple-mini .avatar { width: 90px; height: 90px; }
  .couple-mini .name { font-size: 1.8rem; }
  .paper-inner { padding: 34px 26px; }
}
