/* NACA Member App — token & komponen.
   Palet diturunkan dari design system Stitch "Warm Minimalist Modest Wear". */

:root {
  --bg: #fbf9f8;
  --surface: #ffffff;
  --surface-2: #f5f3f3;
  --surface-3: #efeded;
  --text: #1b1c1c;
  --text-2: #4f453c;
  --text-3: #80756b;
  --line: #e3ded7;
  --brand: #75593b;
  --brand-dark: #5b4226;
  --brand-soft: #f8d2ac;
  --brand-tint: #f3ece2;
  --ok: #1f6f43;
  --warn: #8a5a00;
  --err: #ba1a1a;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 12px 32px -4px rgba(117, 89, 59, .06), 0 4px 12px -2px rgba(21, 22, 22, .03);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif", Georgia, serif;
  --tab-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tab-h) + 24px);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(251, 249, 248, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(227, 222, 215, .7);
  min-height: 56px;
}
.topbar .brand {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--brand-dark);
  font-size: 15px;
}
.topbar .judul {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.topbar .kanan { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.ikon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  position: relative;
}
.ikon-btn:active { transform: scale(.94); }
.ikon-btn svg { width: 20px; height: 20px; }
.ikon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 0 2px var(--bg);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-tint);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--brand-dark);
}

/* ---------- isi ---------- */
.isi { padding: 16px 20px 4px; display: flex; flex-direction: column; gap: 20px; }

.sapaan h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}
.sapaan .meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--text-3); }

.pil {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--brand-dark);
  text-transform: uppercase;
}
.pil.abu { background: var(--surface-3); color: var(--text-2); }
.pil.ok { background: #e7f3ea; color: var(--ok); border-color: #cfe6d6; }
.pil.draf { background: var(--surface-3); color: var(--text-2); }
.pil.err { background: #fdecec; color: var(--err); border-color: #f6d5d5; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .tirai {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(21, 22, 22, .86) 0%, rgba(21, 22, 22, .28) 45%, transparent 75%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
  gap: 4px;
}
.hero .label {
  font-size: 10px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand-soft);
}
.hero h2 {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 500; color: #fbf9f6;
  margin: 0 0 8px; line-height: 1.15;
}
.hero .baris { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero p { margin: 0; font-size: 12.5px; color: #e3e2e2; max-width: 190px; }

/* ---------- kategori ---------- */
.kategori { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kategori a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 2px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.kategori a svg { width: 20px; height: 20px; color: var(--text-3); }
.kategori a.aktif { background: var(--brand); border-color: var(--brand); color: #fbf9f6; }
.kategori a.aktif svg { color: #fbf9f6; }

/* ---------- judul section ---------- */
.judul-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.judul-section h2 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.judul-section p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.judul-section a { font-size: 12.5px; font-weight: 600; color: var(--brand); white-space: nowrap; }

/* ---------- kartu produk ---------- */
.gulir {
  display: flex; gap: 12px; overflow-x: auto;
  margin: 0 -20px; padding: 2px 20px 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gulir::-webkit-scrollbar { display: none; }

.kartu {
  flex: 0 0 176px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.kartu .foto { position: relative; aspect-ratio: 3 / 4; background: var(--surface-3); }
.kartu .foto img { width: 100%; height: 100%; object-fit: cover; }
.kartu .isi-kartu { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kartu .kategori-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
}
.kartu .nama { font-size: 13px; font-weight: 600; line-height: 1.3; margin: 0; }
.kartu .harga { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.kartu .harga .coret { font-size: 11px; font-weight: 500; color: var(--text-3); text-decoration: line-through; margin-left: 4px; }
.badge-diskon {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--brand); color: #fbf9f6;
  font-size: 10px; font-weight: 700;
}

.grid-produk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- kartu member ---------- */
.kartu-member {
  background: var(--text);
  color: #fbf9f6;
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.kartu-member .atas { display: flex; align-items: center; gap: 12px; }
.kartu-member .inisial {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 18px;
}
.kartu-member .nama { font-family: var(--font-serif); font-size: 18px; }
.kartu-member .sub { font-size: 12px; color: #cfc7bd; }
.kartu-member .nomor {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: .08em; color: var(--brand-soft);
}
.kartu-member .angka {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 12px; gap: 8px;
}
.kartu-member .angka b { display: block; font-size: 16px; }
.kartu-member .angka span { font-size: 11px; color: #b9b1a7; }

/* ---------- daftar menu ---------- */
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; color: var(--text); font-size: 14px;
}
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.menu .chev { margin-left: auto; color: var(--line); }
.menu .bahaya { color: var(--err); }
.menu .bahaya svg { color: var(--err); }

/* ---------- notifikasi ---------- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif {
  display: flex; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  position: relative;
}
.notif.baru { border-color: rgba(117, 89, 59, .45); background: #fdfbf8; }
.notif .ikon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-dark);
}
.notif .ikon svg { width: 18px; height: 18px; }
.notif .isi-notif { flex: 1; min-width: 0; }
.notif h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.notif p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.notif .waktu { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.notif .titik {
  position: absolute; top: 12px; right: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--err);
}

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.tabs button.aktif { background: var(--brand); border-color: var(--brand); color: #fbf9f6; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(117, 89, 59, .13);
}
.field .bantuan { font-size: 11.5px; color: var(--text-3); }

.cari {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px;
}
.cari svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.cari input { flex: 1; border: 0; background: none; padding: 11px 0; font-family: inherit; font-size: 14px; }
.cari input:focus { outline: none; }

/* ---------- tombol ---------- */
.tombol {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand); color: #fbf9f6;
  font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
}
.tombol:active { transform: scale(.99); }
.tombol:disabled { opacity: .55; }
.tombol.garis { background: var(--surface); color: var(--text); border-color: var(--line); }
.tombol.garis:hover { border-color: var(--brand); color: var(--brand); }
.tombol.gelap { background: var(--text); }
.tombol.bahaya { background: var(--surface); color: var(--err); border-color: #f0d0d0; }
.tombol.penuh { width: 100%; }
.tombol.kecil { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; justify-content: space-around; align-items: center;
  height: var(--tab-h);
  max-width: 460px; margin: 0 auto;
  background: rgba(251, 249, 248, .97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--text-3); padding: 6px 12px; position: relative;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.aktif { color: var(--brand-dark); }
.tabbar a .badge {
  position: absolute; top: 2px; right: 8px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--err); color: #fff;
  font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------- util ---------- */
.kosong {
  text-align: center; padding: 36px 16px; color: var(--text-3);
  font-size: 13px; border: 1px dashed var(--line); border-radius: var(--radius);
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, #f7f5f3 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: kilau 1.3s infinite linear;
  border-radius: 8px;
}
@keyframes kilau { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px);
  transform: translate(-50%, 20px);
  background: var(--text); color: #fbf9f6;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 90; max-width: 88vw; text-align: center;
}
.toast.tampil { opacity: 1; transform: translate(-50%, 0); }

.sembunyi { display: none !important; }
.spasi-bawah { height: 8px; }
