/* Trình thiết kế thiệp — dành cho cô dâu chú rể */
:root {
  --ivory: #f4ebe1; --paper: #faf5ee; --sand: #e9d9c9; --ink: #2a1a1a; --wine: #6b1525; --wine-deep: #4a0e1a;
  --gold-deep: #8a5a44; --muted: #6a5650; --line: rgba(42, 26, 26, 0.14);
  --display: "Cormorant Garamond", serif; --body: "Be Vietnam Pro", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--body); font-weight: 300; font-size: 15px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
h2, h3, p { margin: 0; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar__brand { font-family: var(--display); font-size: 24px; color: var(--wine); text-decoration: none; white-space: nowrap; }
.bar__brand small { font-family: var(--body); font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-deep); margin-left: 8px; }
.bar__status { margin-left: auto; font-size: 13px; color: var(--muted); }
.bar__status.is-bad { color: #a3311f; font-weight: 500; }
.bar__act { display: flex; gap: 8px; }
.b { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--wine); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; background: none; color: var(--wine); white-space: nowrap; }
.b--solid { background: var(--wine); color: #fff; }
.b--solid:hover { background: var(--wine-deep); }
.b--ghost:hover { background: var(--wine); color: #fff; }
.b--small { min-height: 40px; padding: 0 14px; font-size: 11px; }
.b--plain { border-color: var(--line); color: var(--ink); }

.tabs { display: none; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 0; align-items: start; }
.panel { padding: 24px clamp(16px, 3vw, 40px) 80px; max-width: 760px; width: 100%; margin: 0 auto; }
.preview { position: sticky; top: 64px; height: calc(100vh - 64px); padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sand); border-left: 1px solid var(--line); }
.phone { width: 100%; max-width: 380px; flex: 1; min-height: 0; border-radius: 34px; border: 10px solid #1d1414; background: #1d1414; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(42, 26, 26, 0.6); }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; border-radius: 24px; }
.preview__note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Các nhóm nội dung */
details.g { background: var(--paper); border: 1px solid var(--line); margin-bottom: 12px; }
details.g > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; min-height: 60px; }
details.g > summary::-webkit-details-marker { display: none; }
details.g > summary i { font-family: var(--display); font-size: 18px; color: var(--gold-deep); width: 24px; }
details.g > summary b { font-family: var(--display); font-weight: 500; font-size: 22px; flex: 1; }
details.g > summary::after { content: "+"; font-size: 22px; color: var(--wine); width: 20px; text-align: center; }
details.g[open] > summary::after { content: "–"; }
details.g[open] > summary { border-bottom: 1px solid var(--line); }
.g__body { padding: 20px; }
.hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.f { margin-bottom: 14px; }
.f label, .f .lb { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 5px; color: var(--muted); }
.f input:not([type="color"]):not([type="checkbox"]):not([type="file"]), .f select, .f textarea { width: 100%; min-height: 46px; padding: 9px 12px; background: #fff; border: 1px solid rgba(42, 26, 26, 0.22); border-radius: 4px; font-size: 15px; }
.f textarea { min-height: 110px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--wine); box-shadow: 0 0 0 1px var(--wine); }

/* Chọn mẫu */
.mau { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.mau button { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px 8px 10px; text-align: center; font-size: 13px; }
.mau button span { display: grid; place-items: center; height: 84px; border-radius: 4px; margin-bottom: 8px; font-family: var(--display); font-size: 24px; font-style: italic; }
.mau button[aria-pressed="true"] { border-color: var(--wine); box-shadow: 0 0 0 2px var(--wine); font-weight: 500; }

/* Màu */
.mausac { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mausac label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid rgba(42, 26, 26, 0.22); border-radius: 4px; font-size: 14px; min-height: 52px; cursor: pointer; }
.mausac input[type="color"] { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; flex: none; }
.mausac input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.mausac input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.goiy { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.goiy button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }

/* Danh sách có thể thêm bớt */
.item { border: 1px solid var(--line); background: #fff; padding: 14px 14px 2px; margin-bottom: 12px; border-radius: 4px; }
.item__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 500; }
.x { border: 0; background: none; color: #a3311f; min-height: 40px; padding: 0 8px; font-size: 13px; text-decoration: underline; }

/* Ảnh */
.anh { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.anh figure { margin: 0; position: relative; width: 96px; height: 96px; border-radius: 4px; overflow: hidden; background: var(--sand); }
.anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anh figure button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 16px; line-height: 1; }
.up { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px dashed var(--wine); border-radius: 4px; color: var(--wine); font-size: 14px; cursor: pointer; background: #fff; }
.up input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.up:focus-within { outline: 2px solid var(--wine); outline-offset: 2px; }

/* Sắp xếp các phần */
.sx { list-style: none; margin: 0; padding: 0; }
.sx li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid rgba(42, 26, 26, 0.22); border-radius: 4px; margin-bottom: 8px; min-height: 56px; }
.sx li[draggable="true"] { cursor: grab; }
.sx li.is-drag { opacity: 0.4; }
.sx li.is-over { border-color: var(--wine); box-shadow: 0 -3px 0 var(--wine); }
.sx li.is-off span { color: var(--muted); text-decoration: line-through; }
.sx .grip { color: var(--muted); letter-spacing: -2px; user-select: none; }
.sx span { flex: 1; }
.sx input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--wine); }
.sx button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: none; font-size: 15px; }
.sx button:disabled { opacity: 0.3; cursor: default; }

@media (max-width: 980px) {
  .bar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .bar__status { order: 3; width: 100%; margin: 0; }
  .bar__act { margin-left: auto; }
  .bar .b { padding: 0 12px; font-size: 11px; letter-spacing: 0.06em; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; position: sticky; top: 0; z-index: 15; background: var(--paper); border-bottom: 1px solid var(--line); }
  .tabs button { min-height: 48px; border: 0; background: none; font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; }
  .tabs button[aria-selected="true"] { color: var(--wine); border-bottom-color: var(--wine); }
  .bar { position: static; }
  .work { grid-template-columns: 1fr; }
  .preview { position: static; height: calc(100svh - 110px); border-left: 0; }
  .work[data-tab="sua"] .preview, .work[data-tab="xem"] .panel { display: none; }
  .row { grid-template-columns: 1fr; }
}

/* ---------- Bổ sung: gửi thiệp, khách mời, phản hồi ---------- */
.bar__tk { font-size: 13px; color: var(--muted); align-self: center; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b--full { width: 100%; min-height: 52px; }
.b:disabled { opacity: 0.55; cursor: default; }
.lb2 { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.loi { color: #a3311f; font-size: 14px; margin-bottom: 10px; }
.loi:empty { display: none; }
.link { margin-bottom: 12px; word-break: break-all; font-size: 14px; }
.link a { color: var(--wine); }
.kem { display: flex; gap: 8px; }
.kem input { flex: 1; min-width: 0; min-height: 46px; padding: 9px 12px; background: #fff; border: 1px solid rgba(42, 26, 26, 0.22); border-radius: 4px; font-size: 15px; }
.bat { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff; border: 1px solid rgba(42, 26, 26, 0.22); border-radius: 4px; margin-bottom: 16px; cursor: pointer; }
.bat input { width: 24px; height: 24px; accent-color: var(--wine); flex: none; margin: 2px 0 0; }
.bat b { display: block; font-weight: 500; }
.bat small { color: var(--muted); font-size: 13px; }
.dong { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.dong > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tong { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.tong div { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px 6px; text-align: center; }
.tong b { display: block; font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.1; color: var(--wine); }
.tong span { font-size: 12px; color: var(--muted); }
.ph { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ph b { font-weight: 500; }
.ph__loi { color: var(--muted); font-style: italic; margin-top: 4px; }

.thu { background: #fff; border: 1px solid var(--wine); border-left-width: 4px; padding: 16px 18px; margin-bottom: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.thu p { flex: 1 1 260px; font-size: 14px; }
.thu b { font-weight: 500; color: var(--wine); }

/* ---------- Trang vào (đăng nhập, mã kích hoạt) ---------- */
.cua__in { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 6vw, 80px) 20px; display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: clamp(28px, 6vw, 80px); align-items: center; }
.cua__loi .nhan { font-size: 11px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 16px; }
.cua__loi h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1.1; margin: 0 0 22px; }
.cua__loi h1 em { color: var(--wine); }
.cua__loi p { color: var(--muted); max-width: 46ch; margin-bottom: 12px; font-size: 16px; }
.the { background: var(--paper); border: 1px solid var(--line); padding: clamp(20px, 3vw, 34px); }
.the h2 { font-family: var(--display); font-weight: 500; font-size: 28px; margin-bottom: 8px; }
.chuyen { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.chuyen button { min-height: 48px; border: 0; background: none; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.chuyen button[aria-selected="true"] { color: var(--wine); border-bottom-color: var(--wine); }
[hidden] { display: none !important; }
@media (max-width: 820px) { .cua__in { grid-template-columns: 1fr; } .tong { grid-template-columns: 1fr 1fr; } .bar__tk { display: none; } }

/* Khách mời: danh xưng, xem thử, thêm nhiều */
.xemkhach { background: #fff; border-left: 3px solid var(--wine); padding: 10px 14px; margin-bottom: 14px; font-family: var(--display); font-size: 19px; }
.dong .ten { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 0; min-height: 44px; overflow-wrap: anywhere; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.dong .ten:hover { color: var(--wine); }
.nhieu { margin-bottom: 18px; }
.nhieu summary { cursor: pointer; color: var(--wine); min-height: 44px; display: flex; align-items: center; font-size: 14px; text-decoration: underline; }
