/* ========================================================
   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(38, 70, 83, 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(--cream);
  color: var(--teal-ink);
  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(--teal-ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-title {
  margin: 0 0 6px;
  padding-right: 36px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--teal-ink);
}

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

/* 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: 1px solid rgba(38, 70, 83, 0.3);
  background: var(--cream-soft);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.rsvp-radio-label:has(input:checked) {
  border-color: var(--teal-ink);
  background: var(--peach);
  font-weight: 600;
}

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

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  width: max-content;
  max-width: min(90%, 420px);
  padding: 10px 18px;
  background: var(--teal-ink);
  color: var(--cream);
  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(20px, env(safe-area-inset-top));
  bottom: auto;
  right: max(16px, env(safe-area-inset-right));
  z-index: 1001;
  user-select: none;
}

/* Màn hẹp (điện thoại): bìa chiếm hết bề ngang nên nút ngôn ngữ nằm dưới nút 囍 để không đè lên.
   Màn rộng: giữ nguyên góc trên phải như khi đã mở thiệp. */
@media (max-width: 720px) {
  body:not(.invite-open):not(.invite-opening) .floating-lang {
    top: 92px;
    right: var(--gutter);
  }
}

.lang-trigger-btn {
  min-width: 64px;
  min-height: 44px;
  padding: 0 10px 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--teal-ink) !important;
  background: var(--cream);
  color: var(--teal-ink);
  font-family: var(--font-body), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  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% + 6px);
  bottom: auto;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--teal-ink);
  background: var(--cream);
}

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

.lang-btn {
  min-height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-ink);
  font-family: var(--font-body), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  white-space: nowrap;
  cursor: pointer;
}

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

.lang-btn.active {
  background: var(--teal-ink);
  color: var(--cream);
}

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

/* ========================================================
   12. 06 · GỢI Ý TRANG PHỤC
   ======================================================== */
.dresscode-card { text-align: left; }

#dresscode .section-label { margin: 0 0 14px; }

.dresscode-subtitle {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--headline-size);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--teal-ink);
}

.dresscode-note {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}

.dresscode-palettes {
  display: flex;
  width: 100%;
}

.dresscode-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dresscode-swatch {
  width: 100%;
  height: 72px;
  box-shadow: inset 0 0 0 1px rgba(38, 70, 83, 0.12);
}

.dresscode-name {
  padding-right: 6px;
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--teal-ink);
  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: var(--sage);
}

.not-found-card {
  width: 100%;
  max-width: 420px;
  padding: 36px var(--gutter);
  background: var(--cream);
  color: var(--teal-ink);
  text-align: left;
}

.not-found-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--peach);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 24px;
  font-weight: 700;
}

.not-found-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

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