/* ========================================================
   10. MODAL, TOAST, CHỌN NGÔN NGỮ, TRANG PHỤC & TRANG LỖI
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(47, 42, 38, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 480px) {
  .modal-overlay { padding: 8px; }
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  position: relative;
  width: min(450px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  background: var(--paper);
  color: var(--ink-dark);
  transform: translateY(8px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.open .modal-box { transform: none; }

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dark);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-title {
  margin: 0 0 6px;
  padding-right: 36px;
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-dark);
}

.modal-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* Lựa chọn tham dự (RSVP) */
.rsvp-choices {
  display: grid;
  gap: 8px;
}

.rsvp-choices-2cols { grid-template-columns: 1fr 1fr; }

.rsvp-radio-label {
  min-height: 48px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--ink-dark);
  border-radius: 10px;
  background: var(--polaroid);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.rsvp-radio-label:has(input:checked) {
  background: var(--note-yellow);
  font-weight: 500;
}

.rsvp-radio-label input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--ink-dark);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  width: max-content;
  max-width: min(90%, 420px);
  padding: 10px 18px;
  border: 2px solid var(--ink-dark);
  border-radius: 999px;
  background: var(--note-yellow);
  color: var(--ink-dark);
  box-shadow: var(--hard-shadow);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(40px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================
   11. CHỌN NGÔN NGỮ
   Góc trên phải mép màn hình (desktop: ngoài khung thiệp).
   Nút nhạc riêng ở góc dưới phải.
   ======================================================== */
.floating-lang {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  bottom: auto;
  right: max(16px, env(safe-area-inset-right));
  z-index: 1001;
  user-select: none;
}

.lang-trigger-btn {
  min-width: 68px;
  min-height: 40px;
  padding: 0 10px 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid var(--ink-dark) !important;
  border-radius: 999px;
  background: var(--polaroid);
  color: var(--ink-dark);
  box-shadow: var(--hard-shadow);
  font-family: var(--font-body), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
}

.lang-trigger-chevron { transition: transform 0.2s ease; }
.floating-lang.is-open .lang-trigger-chevron { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  min-width: 100%;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 2px solid var(--ink-dark);
  border-radius: 14px;
  background: var(--polaroid);
  box-shadow: var(--hard-shadow);
}

.lang-dropdown[hidden] { display: none; }

.lang-btn {
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--ink-dark);
  font-family: var(--font-body), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  white-space: nowrap;
  cursor: pointer;
}

.lang-btn:hover { background: var(--note-blue); }

.lang-btn.active { background: var(--note-yellow); }

#lang-toggle-wrap[hidden] { display: none !important; }

/* ========================================================
   12. MẶC GÌ ĐI CƯỚI? — GỢI Ý TRANG PHỤC
   ======================================================== */
.dresscode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.dresscode-subtitle { display: none; }

.dresscode-note {
  max-width: 290px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.dresscode-note:empty { display: none; }

.dresscode-palettes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.dresscode-palettes:empty { display: none; }

.dresscode-item {
  min-width: 0;
  max-width: 120px;
  padding: 6px 6px 8px;
  background: var(--polaroid);
  box-shadow: var(--shadow-sm);
  rotate: -3deg;
}

.dresscode-item:nth-child(4n+2) { rotate: 2deg; }
.dresscode-item:nth-child(4n+3) { rotate: -1deg; }
.dresscode-item:nth-child(4n+4) { rotate: 3deg; }

.dresscode-swatch {
  width: 52px;
  height: 52px;
  margin: 0 auto;
}

.dresscode-name {
  display: block;
  margin-top: 2px;
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ========================================================
   13. TRANG LỖI / THIỆP KHÔNG TỒN TẠI
   ======================================================== */
.not-found-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--paper);
  background-image: var(--dot-bg);
  background-size: var(--dot-size);
}

.not-found-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 28px 32px;
  background: var(--note-yellow);
  color: var(--ink-dark);
  box-shadow: var(--shadow-note);
  text-align: center;
  rotate: -1.5deg;
}

.not-found-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 26px;
  background: var(--tape-pink);
  transform: translateX(-50%) rotate(-3deg);
}

.not-found-icon {
  margin-bottom: 6px;
  font-family: var(--font-hand);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-red);
}

.not-found-title {
  margin: 0 0 8px;
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.not-found-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
