/* 모든 청첩장 디자인 공통: 하객 입력 창 (참석 여부, 방명록 쓰기·지우기).
   색·모서리·글꼴은 --g-* 변수로만 정한다. 디자인 CSS 에서 .gd { --g-accent: ...; } 처럼 바꿔 맞춘다. */
.gd {
  --g-bg: #ffffff;
  --g-ink: #2b2723;
  --g-muted: #5e564d;
  --g-line: #d8cdb9;
  --g-accent: #2b2723;
  --g-accent-ink: #ffffff;
  --g-ok: #2f4a3c;
  --g-warn: #b23b2a;
  --g-radius: 0;
  --g-font: inherit;
  width: min(100%, 430px);
  max-width: 100%;
  height: min(100dvh, 880px);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--g-bg);
  color: var(--g-ink);
  font-family: var(--g-font);
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  overflow: hidden;
}
.gd--small { height: min(100dvh, 640px); }
.gd--tiny { height: min(100dvh, 340px); }
.gd[open] { display: flex; flex-direction: column; }
.gd::backdrop { background: rgba(25, 22, 20, 0.55); }
@media (max-width: 430px) {
  .gd, .gd--small { height: 100dvh; }
  .gd--tiny { height: auto; max-height: 100dvh; margin-block: auto; }
}
.gd form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.gd__head { position: relative; flex: none; height: 56px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--g-line); }
.gd__head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.gd__x { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.gd__body { flex: 1; overflow-y: auto; padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 22px; }
.gd__field { display: flex; flex-direction: column; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0; }
.gd__label { font-size: 14px; font-weight: 600; line-height: 1.6; }
.gd__req { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--g-muted); }
.gd__hint { font-size: 12px; color: var(--g-muted); }
.gd input[type='text'], .gd input[type='tel'], .gd input[type='password'], .gd textarea {
  width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--g-line); border-radius: var(--g-radius);
  background: var(--g-bg); color: var(--g-ink); font-family: var(--g-font); font-size: 16px; /* 16px: 아이폰에서 입력할 때 화면이 확대되지 않게 */
}
.gd textarea { height: auto; padding: 10px 12px; line-height: 1.6; resize: none; }
.gd input::placeholder, .gd textarea::placeholder { color: var(--g-muted); opacity: 0.8; }
.gd input:focus-visible, .gd textarea:focus-visible, .gd button:focus-visible, .gd summary:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
.gd__seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.gd__seg button {
  height: 48px; padding: 0 4px; border: 1px solid var(--g-line); border-radius: var(--g-radius);
  background: var(--g-bg); color: var(--g-muted); font-family: var(--g-font); font-size: 14px; cursor: pointer;
}
.gd__seg button[aria-pressed='true'] { background: var(--g-accent); border-color: var(--g-accent); color: var(--g-accent-ink); font-weight: 600; }
.gd__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gd__step { display: flex; align-items: center; gap: 4px; }
.gd__step button { width: 44px; height: 44px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-bg); color: var(--g-ink); font-size: 18px; line-height: 1; cursor: pointer; }
.gd__step output { width: 52px; text-align: center; font-size: 16px; font-weight: 600; }
.gd__check { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.gd__check input { width: 20px; height: 20px; margin: 0; accent-color: var(--g-accent); }
.gd__terms { margin-top: -14px; font-size: 12px; color: var(--g-muted); }
.gd__terms summary { min-height: 32px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; }
.gd__terms p { margin: 4px 0 0; line-height: 1.7; }
.gd__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gd__error { margin: 0; font-size: 14px; color: var(--g-warn); }
.gd__submit {
  height: 52px; border: 0; border-radius: var(--g-radius); background: var(--g-accent); color: var(--g-accent-ink);
  font-family: var(--g-font); font-size: 15px; font-weight: 600; cursor: pointer;
}
.gd__submit:disabled { opacity: 0.55; cursor: default; }
.gd__done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; }
.gd__done[hidden], .gd__error[hidden], .gd__head[hidden], .gd__body[hidden] { display: none; }
.gd__done p { margin: 0; font-size: 16px; color: var(--g-ok); }
.gd__done .gd__submit { width: 200px; }
[data-attend-only][hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .gd[open] { animation: gd-in 0.22s ease-out; }
  @keyframes gd-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
