/* ============================================================
   Undangan Flipbook — Raka & Sinta (demo)
   Palet: krem / putih gading, dusty rose, gold, sage
   Mobile-first. Ganti variabel di :root untuk mengubah tema.
   ============================================================ */

:root {
  --bg: #f6f1ea;
  --page-bg: #fffdf9;
  --ink: #4a3f3a;
  --muted: #8a7d76;
  --rose: #b76e79;
  --rose-deep: #9c5560;
  --gold: #c9a227;
  --gold-soft: #e8dcc3;
  --sage: #8fa998;
  --line: #e9ddcf;
  --shadow: 0 18px 40px rgba(74, 63, 58, 0.18);
  --font-title: "Playfair Display", Georgia, serif;
  --font-body: "Poppins", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* Ornamen latar halus */
.bg-ornament {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(183, 110, 121, 0.10) 0 120px, transparent 121px),
    radial-gradient(circle at 88% 92%, rgba(201, 162, 39, 0.12) 0 140px, transparent 141px),
    radial-gradient(circle at 90% 12%, rgba(143, 169, 152, 0.10) 0 100px, transparent 101px);
}

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 10px 20px;
}

/* ================= BUKU ================= */

.book {
  position: relative;
  width: min(430px, 94vw);
  height: min(720px, calc(100dvh - 120px));
  min-height: 520px;
  perspective: 2200px;
}

.leaf {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.leaf.flipped { transform: rotateY(-180deg); }

.face {
  position: absolute;
  inset: 0;
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 4px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Bayangan jahitan buku di sisi kiri */
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent 14px);
  scrollbar-width: thin;
  scrollbar-color: var(--gold-soft) transparent;
}

.face.back {
  transform: rotateY(180deg);
  border-radius: 14px 4px 4px 14px;
  background-image: linear-gradient(to left, rgba(0, 0, 0, 0.05), transparent 14px);
}

.face::-webkit-scrollbar { width: 5px; }
.face::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 4px; }

/* ================= ISI HALAMAN ================= */

.page {
  padding: 34px 26px 30px;
  text-align: center;
}

.page-center {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page p { font-size: 0.92rem; line-height: 1.75; font-weight: 300; }

.page-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem !important;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500 !important;
}

.page-title {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--rose-deep);
  margin: 0 0 4px;
  line-height: 1.35;
}

.divider { color: var(--gold); margin: 10px 0 16px; font-size: 1.05rem; }
.ornament { color: var(--gold); font-size: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem !important; }

.names-script {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--rose-deep);
  line-height: 1.5;
}

.names-script span { color: var(--gold); font-size: 1.2rem; }

/* ================= SAMPUL ================= */

.cover {
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 162, 39, 0.14) 0 130px, transparent 131px),
    linear-gradient(160deg, #fdf6ec 0%, #f9ecec 55%, #f3e4d8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-inner { padding: 30px 24px; text-align: center; }

.cover-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin: 0 0 10px;
}

.cover-names {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--rose-deep);
  margin: 8px 0;
  line-height: 1.2;
}

.cover-names span { color: var(--gold); font-size: 1.8rem; }

.cover-date {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  line-height: 1.7;
  margin: 10px 0 26px;
}

.cover-guest {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 24px;
}

.guest-label { font-size: 0.8rem; color: var(--muted); line-height: 1.6; margin: 0 0 6px; }

.guest-name {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.cover-hint { font-size: 0.75rem; color: var(--muted); margin-top: 14px; }

.back-cover {
  background: linear-gradient(160deg, #fdf6ec 0%, #f9ecec 60%, #f3e4d8 100%);
}

/* ================= MEMPELAI ================= */

.couple-card { margin: 8px 0; }

.couple-photo {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold-soft);
  box-shadow: 0 6px 16px rgba(74, 63, 58, 0.15);
}

.couple-card h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--rose-deep);
  margin: 10px 0 4px;
}

.couple-card p { margin: 0; font-size: 0.85rem; line-height: 1.6; }

.ampersand {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--gold);
  margin: 6px 0;
}

/* ================= JADWAL ================= */

.event-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  margin: 10px 0;
  background: #fffaf2;
}

.event-card h3 {
  font-family: var(--font-title);
  color: var(--rose-deep);
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.event-day { margin: 0; font-weight: 500; font-size: 0.9rem !important; }
.event-time { margin: 2px 0 0; font-size: 0.88rem !important; }

.venue { margin: 16px 0 12px; font-size: 0.9rem !important; }

.countdown-title {
  font-family: var(--font-title);
  color: var(--rose-deep);
  font-size: 1.1rem;
  margin: 22px 0 10px;
}

.countdown { display: flex; justify-content: center; gap: 10px; }

.cd-box {
  background: var(--rose-deep);
  color: #fff;
  border-radius: 10px;
  min-width: 62px;
  padding: 10px 6px;
}

.cd-box span { display: block; font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.cd-box small { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }

/* ================= GALERI ================= */

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 12px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(74, 63, 58, 0.14);
}

/* ================= FORM RSVP ================= */

.rsvp-form { text-align: left; }

.rsvp-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin: 14px 0 6px;
}

.rsvp-form input[type="text"],
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.radio-row { display: flex; gap: 18px; margin: 4px 0; }

.radio {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  font-weight: 400 !important;
  margin: 0 !important;
  cursor: pointer;
}

.radio input { accent-color: var(--rose); }

.form-note {
  text-align: center;
  font-size: 0.85rem !important;
  min-height: 1.4em;
  margin-top: 12px;
}

.form-note.success { color: #4a7a5c; font-weight: 500; }
.form-note.error { color: #b23b3b; font-weight: 500; }

/* ================= UCAPAN ================= */

.wishes { text-align: left; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }

.wish {
  background: #fffaf2;
  border: 1px solid var(--line);
  border-left: 3px solid var(--rose);
  border-radius: 10px;
  padding: 12px 14px;
}

.wish-name { font-weight: 600; font-size: 0.88rem; margin: 0 0 2px; }
.wish-text { font-size: 0.88rem !important; margin: 0; line-height: 1.6 !important; }
.wish-meta { font-size: 0.72rem; color: var(--muted); margin: 6px 0 0; }

/* ================= AMPLOP ================= */

.bank-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  margin: 12px 0;
  background: #fffaf2;
}

.bank-name { font-weight: 600; letter-spacing: 0.1em; margin: 0 0 2px; font-size: 0.85rem !important; }
.bank-number { font-size: 1.3rem !important; font-weight: 600; letter-spacing: 0.06em; margin: 4px 0; }
.bank-card .muted { margin: 0 0 10px; }

/* ================= TOMBOL ================= */

.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(156, 85, 96, 0.35);
}

.btn-gold:hover { box-shadow: 0 10px 22px rgba(156, 85, 96, 0.45); }

.btn-outline {
  background: transparent;
  color: var(--rose-deep);
  border: 1.5px solid var(--rose);
  padding: 10px 20px;
  margin: 4px 4px 10px;
}

.btn-outline:hover { background: rgba(183, 110, 121, 0.08); }

.btn-small { padding: 8px 18px; font-size: 0.82rem; }
.btn-block { width: 100%; margin-top: 18px; }

/* ================= KONTROL & MUSIK ================= */

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body.opened .controls { opacity: 1; pointer-events: auto; }

.btn-nav {
  background: #fff;
  color: var(--rose-deep);
  border: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 0.82rem;
  box-shadow: 0 4px 10px rgba(74, 63, 58, 0.08);
}

.btn-nav:disabled { opacity: 0.4; cursor: default; }

.page-indicator { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.music-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold-soft);
  background: #fff;
  color: var(--rose-deep);
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(74, 63, 58, 0.2);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn.playing {
  background: var(--rose-deep);
  color: #fff;
  animation: spin 6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Layar pendek: buku sedikit lebih ramping */
@media (max-height: 640px) {
  .book { min-height: 460px; }
  .cover-names { font-size: 2.1rem; }
}
