/* style.css — Layang: elegant cream/ivory invite theme, mobile-first */
:root {
  --accent: #8a7256;
  --accent-dark: #6d5a42;
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #3d3529;
  --muted: #8b8175;
  --border: #e9e2d6;
  --font-display: "Playfair Display", serif;
  --font-body: "Poppins", sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.display-font { font-family: var(--font-display); }
.script-font { font-family: "Great Vibes", cursive; }
.xl { font-size: 3rem; line-height: 1.2; }
b { font-weight: 600; }
a { color: var(--accent-dark); }
code.token-code { background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 8px; word-break: break-all; }

/* ---------- shared layout ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.narrow { max-width: 680px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50; font-size: 1.1rem;
}
.topbar .accent { color: var(--accent); }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.center-text { text-align: center; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin: 14px 0;
  box-shadow: 0 2px 14px rgba(90, 74, 50, 0.06);
}
.card-list { display: flex; flex-direction: column; }
.invite-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.align-end { display: flex; align-items: flex-end; padding-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 8px; margin: 0; }
.stat-grid .stat-num { font-size: 1.6rem; }
.stat-hero { text-align: center; padding: 28px 20px; background: linear-gradient(160deg, #fff, #f7f1e6); }
.stat-hero .stat-num { font-size: 3.4rem; color: var(--accent-dark); line-height: 1.1; }
.stat-label { letter-spacing: 3px; font-size: 0.72rem; color: var(--muted); }
h1.display-font, h2.display-font { color: var(--accent-dark); margin: 22px 0 8px; }
h1.display-font { font-size: 1.7rem; }
h2.display-font { font-size: 1.3rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.guest-link { word-break: break-all; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; margin: 6px 0; border: 1px solid var(--border); }
.thumb.wide { width: 100%; height: 120px; }
.gallery-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.gal-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px; width: 150px; }
.gal-item .thumb { width: 100%; height: 100px; }
.gal-ctl label { display: block; margin-top: 4px; }
.gal-ctl input[type=range] { width: 100%; }
.gal-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.btn-mini { padding: 2px 8px; font-size: .8rem; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.badge {
  display: inline-block; font-size: 0.72rem; padding: 2px 10px; border-radius: 99px;
  background: #efe9de; color: #6d5a42; border: 1px solid var(--border);
}
.badge-prio { background: #f3e6cf; color: #7a5c1e; border-color: #e5cf9f; }
.badge-biasa { background: #e8eef3; color: #3d5a73; border-color: #cfdde8; }
.badge-muted { background: #f1f1f1; color: #999; }
.badge-danger { background: #f8e6e0; color: #b0563f; border-color: #ecc6ba; }

/* ---------- forms ---------- */
label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--accent-dark); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  font: inherit; background: #fffdf9; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="color"] { padding: 4px; height: 42px; }
input[type="file"] { background: transparent; border: 1px dashed var(--border); }
.form-stack label { margin-top: 12px; }
.form-stack button { margin-top: 16px; }
.form-msg { margin-top: 10px; font-size: 0.88rem; padding: 8px 12px; border-radius: 10px; }
.form-msg.ok { background: #e9f5ec; color: #2e6b3f; }
.form-msg.err { background: #f9e9e9; color: #8c3a3a; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 11px 22px; border-radius: 99px; font: inherit; font-size: 0.9rem; font-weight: 500;
  text-decoration: none; transition: transform 0.15s, background 0.15s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #b0563f; }
.btn-danger:hover { background: #93412d; }
.btn-light { background: #fff; color: var(--accent-dark); }

/* ---------- flash ---------- */
#flash-stack { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; width: min(92vw, 420px); }
.flash {
  padding: 12px 16px; border-radius: 12px; margin-top: 8px; text-align: center; font-size: 0.88rem;
  background: #3d3529; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: flashIn 0.3s ease;
}
.flash-success { background: #2e6b3f; }
.flash-error { background: #8c3a3a; }
@keyframes flashIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- invitation cover ---------- */
.inv-body { background: #f6f1e8; }
.cover {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  text-align: center; transition: opacity 0.9s ease, visibility 0.9s;
}
.cover.hide { opacity: 0; visibility: hidden; }
.cover-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #6d5a42, #3d3529) center/cover;
}
.cover-bg::after {
  content: ""; position: absolute; inset: 0; background: rgba(30, 24, 16, 0.45);
}
.cover-inner { position: relative; z-index: 2; color: #fff; padding: 28px; max-width: 480px; }
.cover-eyebrow { letter-spacing: 4px; text-transform: uppercase; font-size: 0.75rem; opacity: 0.9; }
.cover-names { font-size: 2.6rem; line-height: 1.15; margin: 12px 0 4px; text-shadow: 0 2px 14px rgba(0,0,0,0.35); }
.cover-names .amp { display: block; font-size: 1.4rem; opacity: 0.85; margin: 6px 0; }
.cover-to { margin: 20px 0 22px; }
.cover-guest { font-size: 1.5rem; margin-top: 4px; }
.inv-content { opacity: 0; transition: opacity 0.8s ease; }
body.inv-open .inv-content { opacity: 1; }

/* ---------- invitation sections ---------- */
.inv-content { max-width: 560px; margin: 0 auto; padding: 0 0 40px; }
.sec { padding: 44px 22px; text-align: center; }
.sec:nth-child(even) { background: #fbf8f2; }
.sec-lead { font-size: 0.9rem; color: var(--muted); max-width: 420px; margin: 0 auto; }
.sec-title { font-size: 1.6rem; margin-bottom: 18px; }
.eyebrow { letter-spacing: 3px; text-transform: uppercase; font-size: 0.7rem; color: var(--accent); margin-bottom: 10px; }
.couple-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; margin-top: 20px; }
.couple-grid .amp { align-self: center; font-size: 2rem; color: var(--accent); padding: 0 2px; }
.couple-photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.couple-card h2 { font-size: 1.5rem; color: var(--accent-dark); }
.couple-full { font-size: 0.85rem; color: var(--muted); }
.quote-sec { background: var(--accent); color: #fff !important; border-radius: 0; }
.quote-text { font-family: var(--font-display); font-style: italic; font-size: 1.02rem; line-height: 1.8; }
.quote-source { margin-top: 14px; font-size: 0.85rem; opacity: 0.9; }
.countdown { display: flex; justify-content: center; gap: 10px; }
.cd-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  min-width: 68px; padding: 12px 6px;
}
.cd-box b { display: block; font-size: 1.5rem; color: var(--accent-dark); font-family: var(--font-display); }
.cd-box span { font-size: 0.68rem; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.event-grid { display: grid; gap: 14px; }
.event-card .event-date { font-size: 1.15rem; color: var(--accent-dark); margin: 6px 0; }
.timeline { max-width: 420px; margin: 0 auto; text-align: left; }
.tl-item { position: relative; padding: 0 0 26px 26px; border-left: 2px solid var(--border); }
.tl-item:last-child { border-left-color: transparent; }
.tl-dot { position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tl-date { color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 14px; }
.invited-list { list-style: none; max-width: 320px; margin: 0 auto; }
.invited-list li { padding: 4px 0; font-size: 0.92rem; }
.gift-card { max-width: 360px; margin: 14px auto; }
.gift-number { font-size: 1.3rem; letter-spacing: 2px; font-family: var(--font-display); margin: 4px 0; }
.wish-list { text-align: left; max-width: 460px; margin: 18px auto 0; }
.wish-card p { font-size: 0.9rem; }
.inv-footer { padding: 34px 20px 20px; }
.footer-names { font-size: 1.4rem; color: var(--accent-dark); }

/* music fab */
.music-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 150;
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); user-select: none;
}
.music-fab.paused { opacity: 0.55; }
.music-fab.spinning { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 640px) {
  .event-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .cover-names { font-size: 3.2rem; }
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .couple-grid { grid-template-columns: 1fr; }
  .couple-grid .amp { font-size: 1.6rem; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid.three { grid-template-columns: 1fr; }
  .cd-box { min-width: 58px; }
}

/* upload per-file di editor */
.btn-upload { margin-top: 6px; }
.up-status { margin-top: 6px; font-size: 0.85rem; }
.up-progress { height: 10px; background: #eee; border-radius: 6px; overflow: hidden; margin-bottom: 4px; max-width: 320px; }
.up-bar { height: 100%; width: 0%; background: var(--accent, #b8860b); transition: width 0.3s; }
.up-msg { color: #555; }
.up-ok { color: #1e7e34; font-weight: 600; }
.up-err { color: #c0392b; font-weight: 600; }
.up-est { display: block; margin-top: 4px; font-size: 0.8rem; color: #777; min-height: 1em; }

/* ===== pager + filter tabs (v4) ===== */
.tabs-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tab-pill {
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem;
  border: 1px solid #e2ddd4; background: #faf8f5; color: #6b6257;
  text-decoration: none; transition: all .18s;
}
.tab-pill:hover { background: #f2ede6; }
.tab-pill.active { background: var(--accent, #b8860b); border-color: var(--accent, #b8860b); color: #fff; font-weight: 600; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0 28px; }
.pager-info { min-width: 64px; text-align: center; }
.btn.disabled { opacity: .4; pointer-events: none; }
.cat-block { margin: 26px 0 34px; }
.cat-block > h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge-ok { background: #e3f4e6; color: #1e7e34; border-color: #bfe3c6; }
.guest-names-detail { margin-top: 8px; }
.guest-names-detail summary { cursor: pointer; color: #7a6a55; }
.guest-names-detail ul { margin: 6px 0 0 18px; padding: 0; color: #555; }
.cat-list-details { margin: 10px 0 0; }
.cat-list-details > summary { cursor: pointer; color: #7a6a55; font-weight: 600; padding: 6px 0; }

/* AI image generation panel */
.ai-gen { margin-top: 8px; }
.ai-gen > summary { cursor: pointer; font-size: .85rem; color: #7a6a55; }
.ai-gen-row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.ai-gen-row input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; }
.ai-gen-status { display: block; margin-top: 4px; font-size: .8rem; color: #888; }
