/* ==========================================================
   Undangan Digital — Clean elegant theme (mobile-first)
   ========================================================== */
:root {
  --primary:        #4B6B99;
  --primary-hover:  #5d7697;
  --primary-light:  #d6e1f1;
  --secondary:      #BC97C9;
  --secondary-light:#f2dcfa;
  --bg:             #fafafa;
  --bg-image:       none;
  --text:           #2c2c2c;
  --muted:          #6b6b6b;
  --card-bg:        #ffffff;
  --card-shadow:    0 6px 28px rgba(0, 0, 0, .10);

  --font-body:    'Baskervville', 'Cormorant Garamond', Georgia, serif;
  --font-title:   'Philosopher', 'Playfair Display', serif;
  --font-script:  'Great Vibes', cursive;
  --font-arab:    'Amiri', 'Scheherazade New', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
[hidden] { display: none !important; }

/* ============== Background (user-uploaded) ============== */
.bg-layer {
  position: fixed; inset: 0; z-index: -2;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg);
}
/* Subtle dark wash so cards stay readable over busy backgrounds */
.bg-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(255, 255, 255, .35);
}
body.has-bg .bg-overlay { background: rgba(20, 20, 20, .25); }

.invitation-root { min-height: 100vh; position: relative; }

/* ==========================================================
   COVER  (fixed overlay; slides up on open)
========================================================== */
.cover-section {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-image, none) center/cover no-repeat;
  background-color: var(--bg);
  transition: transform .8s cubic-bezier(.7, 0, .3, 1), opacity .6s ease .15s;
}
.cover-section::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(255, 255, 255, .35);
}
body.has-bg .cover-section::before { background: rgba(20, 20, 20, .35); }
body.has-bg .cover-section { color: #fff; }
body.has-bg .cover-section .cover-eyebrow,
body.has-bg .cover-section .cover-date,
body.has-bg .cover-section .cover-guest-label,
body.has-bg .cover-section .cover-guest-name { color: #fff; }
body.has-bg .cover-section .cover-title { color: #fff; }

.cover-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 360px;
  animation: fadeUp 1.1s ease both;
}
.cover-eyebrow {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}
.cover-title {
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 13vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 16px;
  color: var(--primary);
}
.cover-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  color: var(--primary);
  margin: 14px auto;
  max-width: 200px;
}
body.has-bg .cover-section .cover-divider { color: #fff; }
.cover-divider .line {
  flex: 1; height: 1px; background: currentColor; opacity: .5;
}
.cover-date {
  font-family: var(--font-title);
  font-size: 1rem;
  margin: 12px 0 28px;
  color: var(--text);
}
.cover-guest { margin-bottom: 28px; }
.cover-guest-label {
  font-family: var(--font-title);
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.cover-guest-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.cover-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-title);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 13px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  transition: transform .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cover-btn:hover, .cover-btn:focus-visible {
  transform: translateY(-2px); background: var(--primary-hover); outline: none;
}
.cover-btn:active { transform: translateY(0); }

.cover-section.cover-open {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================
   CONTENT
========================================================== */
.invitation-content { animation: fadeIn .6s ease both; }

.section-block {
  padding: 40px 16px;
}
.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 32px 22px;
  box-shadow: var(--card-shadow);
  max-width: 600px;
  margin: 0 auto;
}

.text-center { text-align: center; }

.eyebrow {
  font-family: var(--font-title);
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.section-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.25;
}
.prose {
  margin: 0 auto 18px;
  max-width: 36ch;
  text-align: center;
  color: var(--text);
  font-size: .98rem;
  line-height: 1.7;
}

/* ============== Couple title (main card) ============== */
.couple-title {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 10vw, 3.8rem);
  line-height: 1;
  color: var(--primary);
  margin: 6px 0;
}
.couple-date {
  font-family: var(--font-title);
  font-size: .98rem;
  letter-spacing: .04em;
  margin: 14px 0 4px;
  color: var(--text);
}

/* ============== Countdown ============== */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 340px;
  margin: 22px auto 0;
}
.cd-cell {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 12px 4px;
  text-align: center;
  font-family: var(--font-title);
}
.cd-cell .cd-num {
  display: block; font-size: 1.4rem; font-weight: 700; line-height: 1;
}
.cd-cell .cd-label {
  display: block; font-size: .62rem;
  text-transform: uppercase; letter-spacing: .12em;
  margin-top: 4px; opacity: .9;
}

.guest-pill {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 22px;
  background: var(--primary-light);
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: .9rem;
  color: var(--text);
}
.guest-pill small {
  display: block;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .2em;
  color: var(--muted); margin-bottom: 2px;
}

/* ============== Quote Arab ============== */
.quote-arab {
  font-family: var(--font-arab);
  font-size: clamp(1.35rem, 5.5vw, 1.8rem);
  line-height: 2;
  margin: 0 0 14px;
  color: var(--text);
}
.quote-arti {
  font-style: italic;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

/* ============== Mempelai ============== */
.mempelai-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
}
.mempelai {
  text-align: center;
  width: 100%;
}
.mempelai-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 5px solid var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  background: var(--primary-light);
}
.mempelai-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  border-width: 3px;
  opacity: .85;
}
.mempelai-name {
  font-family: var(--font-script);
  font-size: 2rem;
  line-height: 1.05;
  color: var(--primary);
  margin: 0 0 6px;
}
.mempelai-desc {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 8px;
  font-style: italic;
}
.mempelai-meta {
  font-family: var(--font-title);
  font-size: .92rem;
  margin: 1px 0;
  color: var(--text);
}
.mempelai-amp {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--primary);
  line-height: 1;
}
.ig-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  font-family: var(--font-title);
  font-size: .82rem;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ============== Events ============== */
.events {
  display: flex; flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.event {
  text-align: center;
  padding: 22px 18px;
  border-radius: 14px;
  background: var(--primary-light);
}
.event-type {
  font-family: var(--font-title);
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 6px;
  font-weight: 700;
}
.event-date {
  font-family: var(--font-title);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--text);
}
.event-time {
  font-family: var(--font-title);
  font-size: .92rem;
  color: var(--text);
  margin: 0 0 10px;
}
.event-venue {
  font-family: var(--font-title);
  font-weight: 700;
  margin: 10px 0 4px;
  color: var(--text);
}
.event-addr {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 14px;
  line-height: 1.5;
}
.event-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}

/* ============== Buttons ============== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary);
  color: #fff;
  border: 0;
  font-family: var(--font-title);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(75, 107, 153, .25);
  transition: transform .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--primary-hover); transform: translateY(-1px); outline: none;
}
.btn-block { width: 100%; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-family: var(--font-title);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ============== Livestream ============== */
.livestream {
  margin: 24px auto 0;
  padding: 22px 18px;
  text-align: center;
  background: var(--primary-light);
  border-radius: 14px;
}
.livestream-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.livestream-title { font-family: var(--font-title); font-size: 1.12rem; font-weight: 700; margin: 0 0 6px; }
.livestream-text { font-size: .9rem; color: var(--muted); margin: 0 0 14px; }

/* ============== Timeline ============== */
.timeline {
  position: relative;
  margin-top: 20px;
  padding-left: 28px;
}
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--primary);
  opacity: .25;
}
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-marker {
  position: absolute; left: -28px; top: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline-photo {
  width: 100%; height: 180px; object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
}
.timeline-title {
  font-family: var(--font-script);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--primary);
  margin: 0 0 4px;
}
.timeline-date {
  font-family: var(--font-title);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.timeline-desc { color: var(--text); margin: 0; font-size: .94rem; }

/* ============== Gallery ============== */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.gallery-item {
  display: block; overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  background: var(--primary-light);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ============== Forms ============== */
.form { display: grid; gap: 12px; max-width: 420px; margin: 20px auto 0; }
.field-label {
  display: block;
  font-family: var(--font-title);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.input, textarea.input {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-family: var(--font-body);
  font-size: 16px;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: var(--text);
  outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus, textarea.input:focus { border-color: var(--primary); background: #fff; }
textarea.input { resize: vertical; min-height: 88px; }

.radio-group { display: flex; gap: 6px; flex-wrap: wrap; }
.radio-pill {
  position: relative;
  flex: 1 1 auto;
  min-width: 80px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px;
  border: 1px solid #e5e5e5;
  background: #f5f5f5;
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }

.form-msg { text-align: center; font-size: .88rem; margin: 10px 0 0; min-height: 1.2em; font-family: var(--font-title); }
.form-msg.success { color: #166534; }
.form-msg.error { color: #b91c1c; }

/* ============== Bank / QRIS ============== */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e5e5, transparent);
  margin: 28px 0;
}
.bank-list { display: grid; gap: 8px; max-width: 420px; margin: 16px auto 0; }
.bank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: 12px;
}
.bank-icon {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.bank-info {
  flex: 1; min-width: 0;
  font-family: var(--font-title);
  font-size: .88rem;
  word-break: break-word;
}
.qris { text-align: center; margin: 20px auto 0; }
.qris-label {
  font-family: var(--font-title);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.qris img {
  max-height: 260px; margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.confirm-line { text-align: center; margin: 20px 0 0; font-size: .92rem; }
.confirm-line a { color: var(--primary); font-weight: 700; }

/* ============== Ucapan ============== */
.ucapan-list {
  display: grid; gap: 8px;
  max-width: 460px;
  margin: 22px auto 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.ucapan-list::-webkit-scrollbar { width: 5px; }
.ucapan-list::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
.ucapan-item {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 12px 14px;
}
.ucapan-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.avatar {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-weight: 700; font-size: .82rem;
}
.ucapan-name { font-family: var(--font-title); font-weight: 700; font-size: .92rem; }
.ucapan-time { margin-left: auto; font-size: .68rem; color: var(--muted); }
.ucapan-text { margin: 0; color: var(--text); font-size: .9rem; word-break: break-word; line-height: 1.5; }
.ucapan-new { animation: fadeUp .4s ease both; }

/* ============== Closing ============== */
.closing-prose { font-size: .96rem; color: var(--text); margin: 0 auto 16px; max-width: 36ch; }
.closing-salam {
  font-family: var(--font-title);
  font-size: .96rem;
  margin: 18px 0 6px;
  color: var(--muted);
}
.closing-couple {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 9vw, 3rem);
  line-height: 1;
  color: var(--primary);
  margin: 0;
}

.invitation-footer {
  text-align: center;
  padding: 24px 16px 36px;
  font-family: var(--font-title);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--muted);
}
.invitation-footer .heart { color: var(--primary); }

/* ============== Music toggle ============== */
.music-toggle {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.music-toggle.playing { animation: spin 5s linear infinite; }

/* ============== Animations ============== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin   { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================
   Tablet (≥640px)
========================================================== */
@media (min-width: 640px) {
  .section-block { padding: 60px 24px; }
  .card { padding: 44px 36px; max-width: 640px; }
  .events { display: grid; grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .timeline-item { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: center; }
  .timeline-photo { margin: 0; height: 160px; }
}
