/* Halaman tamu: karcis acara di atas, lalu satu lembar buku tamu yang dijepit klip. */

.page {
  max-width: 29rem; margin: 0 auto;
  padding: clamp(2rem, 8vw, 3.5rem) 1rem calc(3rem + env(safe-area-inset-bottom));
  overflow-x: clip; /* melati di sudut boleh menjorok, halaman tidak boleh melebar */
}

/* Kepala: nama acara di karcis, tanggal, sambutan */
.masthead { position: relative; text-align: center; }
.masthead__ticket { position: relative; display: inline-block; min-width: min(88%, 22rem); max-width: 100%; }
.masthead__ticket .ticket { padding: 1rem 1.6rem 1.05rem; }
.masthead__name { font: 500 clamp(1.75rem, 7.4vw, 2.3rem)/1.15 var(--f-display); text-wrap: balance; overflow-wrap: anywhere; }
.masthead__date {
  margin-top: .45rem;
  font: 500 .76rem/1.4 var(--f-body); letter-spacing: .08em; color: var(--brown); /* coklat lembut di atas karcis hanya 4.4:1 */
  font-variant-numeric: lining-nums;
}
.masthead__date:empty { display: none; }
/* melati di luar area teks karcis: menempel di sudut kiri atas dan kanan bawah */
.masthead__sprig--a { left: -1rem; top: -1.25rem; width: 3rem; rotate: -14deg; }
.masthead__sprig--b { left: 1.35rem; top: -1.55rem; width: 1.9rem; rotate: 22deg; }
.masthead__sprig--c { right: -.8rem; bottom: -1rem; width: 2.3rem; rotate: 30deg; }
.masthead__welcome {
  max-width: 25rem; margin: 1.6rem auto 0;
  font-size: .95rem; line-height: 1.65; color: var(--cream);
  text-wrap: pretty; white-space: pre-line;
}

/* Lembar buku tamu */
.book { margin-top: 2.5rem; padding: 2.4rem 1.25rem 1.6rem; }
@media (min-width: 26rem) { .book { padding-inline: 1.75rem; } }
.book__clip { left: 50%; top: -1.6rem; translate: -50% 0; width: 1.25rem; }
.book__title { font: 400 clamp(2rem, 8vw, 2.4rem)/1.1 var(--f-display); text-align: center; }
.book__lead { margin-top: .5rem; font-size: .84rem; color: var(--brown-soft); text-align: center; text-wrap: pretty; }
.book__sprig { right: -.65rem; top: -.9rem; width: 2.4rem; rotate: 12deg; }

.form { margin-top: 1.75rem; display: grid; gap: 1.6rem; }

/* Nama dari undangan: terkunci, garis putus-putus seperti nama tamu di RSVP undangan */
.field input.is-locked { border-bottom-style: dashed; cursor: default; }
.from-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; }
.from-invite__label { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--brown-soft); }
.from-invite__label svg { width: 1rem; height: 1rem; flex: none; }

/* Jumlah orang: tombol kurang/tambah di kiri-kanan angka */
.stepper { display: flex; align-items: center; gap: .75rem; }
.stepper__btn {
  flex: none; display: grid; place-items: center;
  width: 3rem; height: 3rem; padding: 0;
  border: 1px solid var(--brown); border-radius: 2px; background: transparent; color: var(--brown);
  cursor: pointer; transition: background-color .2s var(--ease);
}
.stepper__btn:hover { background: rgba(59, 36, 24, .08); }
.stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper__btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.stepper input {
  width: 4.5rem; min-height: 3rem; padding: 0;
  border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent;
  font: 500 2rem/1 var(--f-display); text-align: center; font-variant-numeric: lining-nums tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__unit { font-size: .9rem; color: var(--brown-soft); }

.field__foot { display: flex; justify-content: space-between; gap: 1rem; }
.field__count { margin-left: auto; font-size: .78rem; color: var(--brown-soft); font-variant-numeric: tabular-nums; }
.field__count[data-over] { color: var(--danger-on-cream); font-weight: 600; }

.form__actions { display: grid; gap: .5rem; margin-top: .25rem; }
.form__status { min-height: 1.4em; font-size: .86rem; text-align: center; font-weight: 500; color: var(--danger-on-cream); }
.form__status:empty { min-height: 0; }

/* Struk "Terima kasih": tanda kehadiran sudah tercatat */
.done { position: relative; margin-top: 2.75rem; }
.done .receipt { padding: 2.9rem 1.4rem 2.6rem; text-align: center; }
.done__seal { position: absolute; z-index: 2; left: 50%; top: -1.55rem; translate: -50% 0; }
.done__kicker { font-size: .82rem; color: var(--brown-soft); }
.done__title { margin-top: .35rem; font: 400 clamp(2.1rem, 9vw, 2.75rem)/1.12 var(--f-display); text-wrap: balance; overflow-wrap: anywhere; }
.done__rows { margin-top: 1.25rem; border-top: 2px dotted rgba(59, 36, 24, .35); }
.done__row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 2px dotted rgba(59, 36, 24, .35);
  font-size: .88rem; text-align: left;
}
.done__row dt { color: var(--brown-soft); }
.done__row dd { font-weight: 500; text-align: right; }
.done__msg {
  margin-top: 1.25rem;
  font: italic 500 1.2rem/1.45 var(--f-display);
  text-wrap: pretty; overflow-wrap: anywhere; white-space: pre-line;
}
.done__actions { margin-top: 1.6rem; display: grid; gap: .6rem; }
.done__note { margin-top: 1.1rem; font-size: .82rem; color: var(--brown-soft); text-wrap: pretty; }
.done__note .linkbtn { color: var(--brown); }
.done__sprig { left: -.7rem; bottom: -1.1rem; width: 2.6rem; rotate: -24deg; z-index: 3; }

/* Struk tercetak sekali saat isian baru saja dikirim, lalu segel ditekan */
.done.is-fresh .receipt-wrap { animation: print .8s var(--ease) backwards; }
.done.is-fresh .done__seal { animation: stamp .45s .55s var(--ease) both; }
@keyframes print { from { clip-path: inset(0 -3rem 100% -3rem); transform: translateY(-.75rem); } to { clip-path: inset(0 -3rem -3rem -3rem); } }
@keyframes stamp { from { opacity: 0; scale: 1.5; } to { opacity: 1; scale: 1; } }

/* Ditutup / gagal dimuat */
.notice { margin-top: 2.5rem; padding: 2.2rem 1.4rem 1.8rem; text-align: center; }
.notice__title { font: 400 clamp(1.8rem, 7vw, 2.2rem)/1.15 var(--f-display); text-wrap: balance; }
.notice__text { margin-top: .6rem; font-size: .9rem; color: var(--brown-soft); text-wrap: pretty; }
.notice .btn { margin-top: 1.4rem; }
