/* Jom Ceria — gaya dikongsi oleh semua laman (jomceria.app & laman produk). Token sama dengan tema app "Lembut". */
:root {
  --bg: #EFF0FB; --bg-deep: #E3E4F7; --surface: #fff; --ink: #221B5C; --muted: #6E6C92; --line: #E7E6F5;
  --primary: #6C55E8; --primary-dark: #5641D0; --primary-soft: #EEEAFE; --oyen: #FF9A3C;
  --ok: #2DB57A; --ok-soft: #E3F7EE; --bad: #E2473D; --bad-soft: #FFE9E7; --warn: #E8A21A; --warn-soft: #FFF4DA;
  --t-lilac: #A091F5; --t-mint: #74D5A5; --t-coral: #F99690; --t-sun: #FFD262; --t-sky: #82C9F3; --t-peach: #FFB287;
  --sh-1: 0 1px 2px rgba(34, 27, 92, .05), 0 6px 18px rgba(34, 27, 92, .07);
  --sh-2: 0 2px 6px rgba(34, 27, 92, .06), 0 18px 40px rgba(34, 27, 92, .12);
  --f-display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 24px; color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 600 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); font-weight: 800; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }

/* butang */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 999px; font: 800 1.02rem/1 var(--f-display); background: var(--primary); color: #fff; box-shadow: 0 10px 22px -10px rgba(108, 85, 232, .75); transition: transform .1s, filter .1s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.dark { background: var(--ink); box-shadow: 0 12px 26px -12px rgba(34, 27, 92, .8); }
.btn.white { background: #fff; color: var(--ink); box-shadow: var(--sh-1), inset 0 0 0 1.5px var(--line); }
.btn.ghost { background: transparent; color: var(--primary); box-shadow: none; }
.btn.ok { background: var(--ok); box-shadow: 0 10px 22px -10px rgba(45, 181, 122, .8); }
.btn.bad { background: var(--bad); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

/* kad, borang */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1); padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: .92rem; }
.field small { font-weight: 700; color: var(--muted); }
input, select, textarea { font: 700 1rem var(--f-body); color: var(--ink); background: #F7F7FE; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 900; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #1E8F5F; } .pill.bad { background: var(--bad-soft); color: #C2372E; } .pill.warn { background: var(--warn-soft); color: #A56A00; } .pill.grey { background: #EEEEF5; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 800; z-index: 99; box-shadow: var(--sh-2); max-width: calc(100% - 32px); text-align: center; }
.spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg) } }

/* lembaran (modal) */
.sheet-bg { position: fixed; inset: 0; background: rgba(34, 27, 92, .45); z-index: 60; display: grid; place-items: end center; animation: fade .2s; }
.sheet { background: var(--bg); width: min(520px, 100%); max-height: 94dvh; overflow: auto; border-radius: 28px 28px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: up .3s cubic-bezier(.22, 1, .36, 1); }
@media (min-width: 640px) { .sheet-bg { place-items: center; } .sheet { border-radius: 28px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.x { width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); font-size: 1.1rem; font-weight: 900; flex: none; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }

/* jadual (admin / affiliate) */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 900; padding: 10px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

/* ---------- kepala & kaki laman (dikongsi) ---------- */
.promo { background: var(--ink); color: #fff; text-align: center; font-weight: 800; font-size: .9rem; padding: 9px 16px; }
.top { position: sticky; top: 0; z-index: 30; background: rgba(239, 240, 251, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.logo img, .logo svg { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.logo img { box-shadow: var(--sh-1); }
.logo b { font: 800 1.25rem/1 var(--f-display); white-space: nowrap; } .logo b span { color: var(--oyen); } .logo b em { font-style: normal; color: var(--primary); }
.logo small { display: block; font-size: .72rem; color: var(--muted); font-weight: 800; margin-top: 2px; white-space: nowrap; }
.links { display: flex; gap: 22px; margin-left: auto; align-items: center; } .links a { color: var(--ink); font-weight: 800; font-size: .95rem; }
.top-cta { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) { .links { display: none; } .top-cta { margin-left: auto; } }
@media (max-width: 380px) { .logo small { display: none; } .top-cta .btn.sm { padding: 0 11px; } }
.site-foot { margin-top: 80px; padding: 34px 0 46px; border-top: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: .9rem; }
.site-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot .biz { flex-basis: 100%; font-size: .8rem; }

/* ---------- lembaran bayaran (checkout.js) ---------- */
.co-stack { display: grid; gap: 14px; }
.acct { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: var(--sh-1); }
.acct img, .acct .av { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.acct .av, .av { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font: 800 1rem var(--f-display); }
.acct div { flex: 1; min-width: 0; } .acct b { display: block; font-size: .95rem; } .acct small { color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; }
.sum { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: var(--sh-1); display: grid; gap: 6px; font-weight: 700; }
.sum div { display: flex; justify-content: space-between; gap: 10px; } .sum .tot { border-top: 1.5px dashed var(--line); padding-top: 8px; margin-top: 2px; font: 800 1.25rem var(--f-display); }
.sum .disc { color: var(--ok); }
.chans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chan { border-radius: 14px; padding: 12px 6px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 900; font-size: .88rem; }
.chan.on { box-shadow: inset 0 0 0 2.5px var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.err { background: var(--bad-soft); color: #B4362D; border-radius: 14px; padding: 10px 14px; font-weight: 800; font-size: .9rem; }
.note { font-size: .82rem; color: var(--muted); font-weight: 700; }
.gbtn { background: #fff; color: var(--ink); box-shadow: var(--sh-1), inset 0 0 0 1.5px var(--line); }
.sheet-head small { display: block; font-weight: 800; font-size: .8rem; }

/* ---------- PIN ---------- */
.pin { display: inline-flex; gap: 8px; justify-content: center; }
.pin span { width: 52px; height: 62px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-dark); font: 800 2rem/62px var(--f-display); text-align: center; }
.pin.sm span { width: 38px; height: 46px; border-radius: 12px; font-size: 1.5rem; line-height: 46px; }

/* ---------- senarai baris (sejarah pembelian, jualan affiliate) ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.olist { display: grid; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.orow:last-child { border-bottom: 0; } .orow:first-child { padding-top: 0; }
.orow .l, .orow .r { display: grid; gap: 2px; min-width: 0; } .orow .r { text-align: right; font-variant-numeric: tabular-nums; }
.orow .s { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
@media (max-width: 560px) { .orow { grid-template-columns: minmax(0, 1fr) auto; } .orow .s { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 380px) { .btn { padding: 0 16px; } .btn.block { white-space: normal; text-align: center; line-height: 1.15; } }
