/* ==========================================================
   Undangan Silaturahmi Angkatan — style.css
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf9;
  --surface: #fff;
  --soft: #f5f5f4;
  --line: #e7e5e4;
  --text: #292524;
  --muted: #78716c;
  --brand: #243f35;
  --brand-h: #1e342c;
  --brand-soft: #e5ece8;
  --accent: #9a6d38;
  --err: #dc2626;
  --on-brand: #fff;

  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181a;
    --surface: #1c2124;
    --soft: #242a2d;
    --line: #333b3f;
    --text: #ece9e6;
    --muted: #a09b95;
    --brand: #6fa890;
    --brand-h: #85bba4;
    --brand-soft: #23352e;
    --accent: #d4a063;
    --on-brand: #10201a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181a;
  --surface: #1c2124;
  --soft: #242a2d;
  --line: #333b3f;
  --text: #ece9e6;
  --muted: #a09b95;
  --brand: #6fa890;
  --brand-h: #85bba4;
  --brand-soft: #23352e;
  --accent: #d4a063;
  --on-brand: #10201a;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
}

p { margin: 0; }

a { color: inherit; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }

.eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted-sm { font-size: 13px; color: var(--muted); }
.muted-xs { font-size: 12px; color: var(--muted); }
.c-brand  { color: var(--brand); }
.c-accent { color: var(--accent); }
.c-muted  { color: var(--muted); }

/* ---------- Buttons & cards ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 600 14px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: .2s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-h); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 99px; }
.btn-block { width: 100%; padding: 14px; }

.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.card-lg { padding: 26px; }

.map-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}
.map-link:hover { color: var(--brand-h); }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(color-mix(in srgb, var(--brand) 14%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 18px var(--serif);
  color: var(--text);
  text-decoration: none;
}

.logo {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  border-radius: 11px;
  background: #0c0a09;
}
.logo svg { width: 100%; height: 100%; padding: 4px; }
.logo-sm { width: 32px; height: 32px; }

.navlinks { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 500; }
.navlinks a { color: var(--muted); text-decoration: none; }
.navlinks a:hover { color: var(--brand); }

.hero-main {
  padding: 48px 0;
  text-align: center;
  animation: up .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 16px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
}
.badge .logo { width: 24px; height: 24px; border-radius: 7px; }

.hero h1 { margin-bottom: 18px; font-size: clamp(38px, 8vw, 64px); letter-spacing: -.01em; }
.hero .sub { max-width: 620px; margin: 0 auto 30px; font-size: 17px; color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: left;
}
.facts .card { padding: 16px; }
.facts b { display: block; font-size: 14px; }
.facts small { font-size: 12px; color: var(--muted); }

.lbl {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hint { padding-bottom: 22px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }

.head { max-width: 620px; margin: 0 auto 40px; text-align: center; }
.head h2 { margin-bottom: 10px; font-size: clamp(28px, 5vw, 38px); }
.head p { color: var(--muted); }

/* Countdown */
.cd-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cd-top h3 { font: 600 17px var(--sans); }

.tz {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
.cd div {
  padding: 16px 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cd strong {
  display: block;
  font: 700 clamp(26px, 5vw, 38px) var(--serif);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.cd div:last-child strong { color: var(--accent); }
.cd span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.done { display: none; padding: 12px 0; text-align: center; font: 600 20px var(--serif); color: var(--brand); }
.done p { margin-top: 4px; font: 400 14px var(--sans); color: var(--muted); }

/* Info cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.cards .card { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.cards h3 { margin-bottom: 8px; font-size: 20px; }
.cards p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.cards p.strong { margin-top: 0; color: var(--text); font-weight: 600; }

.ico {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 19px;
}

.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1; padding: 11px 12px; font-size: 13px; }

.note {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
}
.note b { color: var(--text); }

/* Map embed */
.map-card { margin-top: 20px; padding: 8px; overflow: hidden; }
.map-card iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: 14px;
  background: var(--soft);
}

/* ---------- RSVP ---------- */
#rsvp { background: var(--soft); border-top: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stats .card { padding: 14px; text-align: center; }
.stats b { display: block; font: 700 28px var(--serif); }
.stats span { font-size: 12px; color: var(--muted); }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; align-items: start; }
.h-md { margin-bottom: 4px; font-size: 20px; }
.muted-xs + form { margin-top: 18px; }

form { display: grid; gap: 16px; }

label.f, .f-t { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.req { color: var(--err); }

input[type=text], select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 14px var(--sans);
  outline: none;
  transition: .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.invalid { border-color: var(--err) !important; }
textarea { resize: none; }
.err { display: none; margin-top: 4px; font-size: 12px; color: var(--err); }

/* Segmented radio */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 10px 4px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: .2s;
}
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* List */
.list-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.list-top h3 { font-size: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button {
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font: 600 12px var(--sans);
  cursor: pointer;
}
.filters button.on { background: var(--brand); color: var(--on-brand); }

#list { display: grid; gap: 12px; max-height: 540px; padding-right: 4px; overflow-y: auto; }

.item { padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.item-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.item b { font-size: 14px; }
.item small { display: block; font-size: 12px; color: var(--muted); }
.item p { margin-top: 8px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }

.tag { padding: 2px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 600; }
.tag.Masih { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.tag.Tidak { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }

.empty { display: none; padding: 36px 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Footer & toast ---------- */
footer {
  padding: 32px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
footer .brand { justify-content: center; margin-bottom: 6px; }
footer button {
  margin: 8px 8px 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

#toasts {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90vw;
}
.toast {
  padding: 11px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  animation: up .3s both;
}
.toast.error { background: var(--err); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .cards, .split, .facts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .navlinks a { display: none; }
  .map-card iframe { height: 280px; }
}