/* =========================================================
   BASE — dipakai semua versi undangan (undangan_1..5.html)
   Tema cukup mengisi token di :root dan gaya per-bagian.
   ========================================================= */
:root {
  --bg: #FBF7F0; --surface: #fff; --surface-2: #F6F0E6;
  --text: #241B17; --muted: #6A5C53; --line: rgba(36, 27, 23, .12);
  --accent: #A8322D; --on-accent: #fff; --accent-2: #C9A265;
  --ok: #2F6B4F; --danger: #A8322D;
  --nav-bg: rgba(251, 247, 240, .9); --nav-fg: #8B7C72; --nav-active: #1A1411; --nav-mark: #A8322D; --nav-line: rgba(36, 27, 23, .1);
  --f-display: "Cormorant Garamond", Georgia, serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 22px; --col: 480px; --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 1px 2px rgba(26, 20, 17, .06), 0 14px 34px -14px rgba(26, 20, 17, .22);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-door: cubic-bezier(.77, 0, .18, 1);
  --img-utama: url("../img/gorga-utama.webp");
  --img-list: url("../img/gorga-list.webp");
  --img-band: url("../img/gorga-band.webp");
  --img-band-v: url("../img/gorga-band-v.webp");
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--f-body); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gorga ---------- */
.gm { display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.gm--utama { --m: var(--img-utama); aspect-ratio: 700 / 1197; }
.gm--list { --m: var(--img-list); aspect-ratio: 900 / 136; }
/* pita gorga sambung-menyambung (horizontal / vertikal) */
.band { display: block; height: var(--bh, 22px); background: currentColor;
  -webkit-mask-image: var(--img-band); mask-image: var(--img-band);
  -webkit-mask-size: auto 100%; mask-size: auto 100%;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-position: center; mask-position: center; }
.band-v { display: block; width: var(--bw, 22px); background: currentColor;
  -webkit-mask-image: var(--img-band-v); mask-image: var(--img-band-v);
  -webkit-mask-size: 100% auto; mask-size: 100% auto;
  -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y;
  -webkit-mask-position: center; mask-position: center; }
.emblem { display: block; width: 100%; height: auto; aspect-ratio: 640 / 1099; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent; font: 600 15px/1 var(--f-body); text-decoration: none; transition: transform .18s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: currentColor; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Gerbang (perilaku umum) ---------- */
#gate { position: fixed; inset: 0; z-index: 100; overflow: hidden; }
body.is-open #gate { display: none; }

/* ---------- Kolom & desktop ---------- */
.main { position: relative; padding-bottom: calc(var(--nav-h) + var(--safe-b)); overflow: clip; }
.stage { display: none; }
@media (min-width: 960px) {
  .main { margin-left: auto; width: var(--col); box-shadow: -30px 0 60px rgba(0, 0, 0, .3); }
  .stage { display: grid; position: fixed; top: 0; bottom: 0; left: 0; right: var(--col); overflow: hidden; }
  .tabbar { left: auto !important; width: var(--col); }
  .toast { left: calc(100% - var(--col) / 2) !important; }
}

/* ---------- Nav bawah ala IG ---------- */
.tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--nav-bg); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--nav-line); transform: translateY(110%); transition: transform .6s var(--ease) .4s; }
body.is-open .tabbar, body.is-opening .tabbar { transform: none; }
.tab { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; text-decoration: none; color: var(--nav-fg); -webkit-tap-highlight-color: transparent; transition: color .2s; }
.tab .ic { width: 24px; height: 24px; stroke-width: 1.7; transition: transform .25s var(--ease); }
.tab span { font: 600 11px/1 var(--f-body); letter-spacing: .02em; }
.tab.is-active { color: var(--nav-active); }
.tab.is-active .ic { stroke-width: 2.2; transform: translateY(-1px); }
.tab::after { content: ""; position: absolute; top: 0; left: 50%; width: 0; height: 2px; border-radius: 2px; background: var(--nav-mark); translate: -50% 0; transition: width .3s var(--ease); }
.tab.is-active::after { width: 28px; }
.tab:active .ic { transform: scale(.88); }

/* ---------- Form RSVP ---------- */
.form { display: grid; gap: 18px; }
.field { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.field label, .field legend { font: 600 14px/1.3 var(--f-body); color: var(--text); padding: 0; }
.field legend { margin-bottom: 8px; }
.field input[type=text], .field textarea, .stepper input { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 13px 14px; font: 500 16px/1.4 var(--f-body); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .stepper input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .8; }
.field.has-err input { border-color: var(--danger); }
.field__err { color: var(--danger); font-size: 13px; }
.field__err:empty { display: none; }
.field__hint { text-align: right; font-size: 12px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg__opt { position: relative; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.seg__opt span { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); font: 600 14px/1.25 var(--f-body); color: var(--muted); transition: all .2s var(--ease); }
.seg__opt span .ic { width: 18px; height: 18px; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.seg__opt--yes input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg__opt--no input:checked + span { background: var(--text); border-color: var(--text); color: var(--surface); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper input { width: 72px; text-align: center; padding: 11px 6px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper__btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; }
.stepper__unit { color: var(--muted); font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__status { font-size: 14px; text-align: center; color: var(--muted); }
.form__status:empty { display: none; }
.form__status.is-err { color: var(--danger); }
.form.is-done { text-align: center; justify-items: center; }
.done__ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.done__ic .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.done__title { font: italic 500 30px/1.15 var(--f-display); color: var(--text); }
.done__text { color: var(--muted); max-width: 30ch; }

/* ---------- Statistik & ucapan ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 6px; border-radius: 18px; background: var(--surface); }
.stat b { display: block; font: 500 32px/1 var(--f-display); font-variant-numeric: lining-nums tabular-nums; color: var(--text); }
.stat span { display: block; margin-top: 6px; font: 600 11px/1.2 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wishes__list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.wish { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); animation: rise .5s var(--ease) both; }
.wish__av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: italic 600 17px/1 var(--f-display); color: #fff; background: var(--accent); }
.wish:nth-child(3n+2) .wish__av { background: var(--text); }
.wish:nth-child(3n) .wish__av { background: var(--accent-2); }
.wish__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.wish__name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.wish__badge { padding: 3px 8px; border-radius: 999px; font: 600 11px/1.3 var(--f-body); }
.wish__badge--ya { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.wish__badge--tidak { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.wish__msg { margin-top: 6px; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.wish__time { margin-top: 6px; font-size: 12px; color: var(--muted); }
.wishes__empty { text-align: center; color: var(--muted); padding: 18px 0; }

/* ---------- QRIS ---------- */
.qris__img { width: min(100%, 260px); aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: #fff; }
.qris__img img { width: 100%; height: 100%; object-fit: contain; }
.qris__ph { padding: 24px; color: #6A5C53; font-size: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.qris__ph svg { width: 120px; height: 120px; }

/* ---------- Peta, toast, lightbox, musik ---------- */
.map { border-radius: var(--r); overflow: hidden; background: #ddd; aspect-ratio: 4 / 3; }
.map iframe { width: 100%; height: 100%; border: 0; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); translate: -50% 20px; opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: #1A1411; color: #F6EFE4; font-size: 14px; font-weight: 600; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); transition: opacity .25s, translate .3s var(--ease); max-width: calc(100vw - 32px); }
.toast.is-show { opacity: 1; translate: -50% 0; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 8, 7, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 14px; object-fit: contain; }
.lightbox__close { position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.music { position: fixed; z-index: 55; right: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); }
.music.is-playing .ic { animation: spin 4s linear infinite; }

/* ---------- Gerak ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-900px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
