/* numpipe-wallet — wallet.numpipe.com */

@font-face {
  font-family: 'Kantumruy Pro';
  src: url('/fonts/kantumruy-pro-latin.woff2')     format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-weight: 300 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Kantumruy Pro';
  src: url('/fonts/kantumruy-pro-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
  font-weight: 300 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Kantumruy Pro';
  src: url('/fonts/kantumruy-pro-khmer.woff2')     format('woff2');
  unicode-range: U+1780-17FF, U+200C, U+25CC;
  font-weight: 300 800; font-style: normal; font-display: swap;
}

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

:root {
  --green:    #16a34a;
  --red:      #dc2626;
  --yellow:   #d97706;
  --orange:   #ea580c;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --accent:   #6366f1;
  --radius:   14px;
  --shadow:   0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.06);
  --nav-h:    60px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

:lang(km) {
  font-family: 'Kantumruy Pro', sans-serif;
}

/* ── Top header ─────────────────────────────────────── */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
}
.header-logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.5px;
  color: var(--gray-900);
  text-decoration: none;
  line-height: 1;
}
.header-logo span { color: var(--green); }
.header-logo sup  { font-size: .45em; vertical-align: super; font-weight: 400; }
.header-tag {
  font-size: .65rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 99px;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.icon-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background .15s;
}
.icon-btn:hover { background: var(--gray-100); }

/* ── Bottom nav ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  text-decoration: none;
  color: var(--gray-400);
  font-size: .65rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  transition: color .15s;
  position: relative;
}
.nav-tab.active { color: var(--green); }
.nav-tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: none;
}
.nav-badge-dot.show { display: block; }

/* ── Main content area ──────────────────────────────── */
.page-body {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem calc(var(--nav-h) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.page-body.no-nav {
  padding-bottom: 1.5rem;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem;
}
.card + .card { margin-top: 0; }
.card-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .75rem;
}

/* ── Login page ─────────────────────────────────────── */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  gap: 0;
}
.login-logo {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--gray-900);
  margin-bottom: .25rem;
  line-height: 1;
}
.login-logo span { color: var(--green); }
.login-logo sup  { font-size: .35em; vertical-align: super; font-weight: 400; }
.login-tagline {
  font-size: .82rem;
  color: var(--gray-500);
  margin-bottom: 2.5rem;
  text-align: center;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
}
.login-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: .3rem;
}
.login-sub {
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}
.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-700);
}
.form-input {
  padding: .65rem .875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--gray-50);
  transition: border-color .15s;
  outline: none;
  width: 100%;
}
.form-input:focus { border-color: var(--green); background: #fff; }
.form-hint {
  font-size: .72rem;
  color: var(--gray-500);
  line-height: 1.45;
}
.btn-primary {
  width: 100%;
  padding: .75rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-primary:hover   { opacity: .9; }
.btn-primary:active  { transform: scale(.98); }
.btn-primary:disabled { background: var(--gray-400); cursor: not-allowed; transform: none; opacity: 1; }
.btn-secondary {
  width: 100%;
  padding: .65rem;
  background: #fff;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s;
}
.btn-secondary:hover { border-color: var(--gray-400); }

/* ── Social login buttons ─────────────────────────────── */
.social-btns {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  margin-bottom: .875rem;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  width: 100%;
  padding: .7rem;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-900);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  position: relative;
}
.btn-social:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-social:active { transform: scale(.98); }
.btn-social:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; transform: none; }
.btn-facebook { color: #1877F2; }
.btn-web3 { color: var(--gray-500); }
.soon-badge {
  font-size: .65rem;
  font-weight: 700;
  background: var(--gray-200);
  color: var(--gray-500);
  border-radius: 4px;
  padding: .1rem .35rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-left: auto;
}

/* ── "or" divider ─────────────────────────────────────── */
.divider-or {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0 .875rem;
  color: var(--gray-400);
  font-size: .78rem;
}
.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.error-msg {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: .6rem .875rem;
  font-size: .8rem;
  margin-bottom: .75rem;
  display: none;
}
.error-msg.show { display: block; }
.success-msg {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: .6rem .875rem;
  font-size: .8rem;
  margin-bottom: .75rem;
  display: none;
}
.success-msg.show { display: block; }
.otp-step { display: none; }
.otp-step.show { display: block; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
  color: var(--gray-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--gray-900); }

/* ── OTP input ──────────────────────────────────────── */
.otp-row {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: .5rem 0 1rem;
}
.otp-digit {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  outline: none;
  transition: border-color .15s;
  font-family: monospace;
}
.otp-digit:focus { border-color: var(--green); background: #fff; }

/* ── Product cards ──────────────────────────────────── */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.product-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.product-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gray-400);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.product-info { flex: 1; min-width: 0; }
.product-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .15rem;
}
.product-meta {
  font-size: .73rem;
  color: var(--gray-500);
}
.product-meta span + span::before { content: ' · '; }
.product-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  flex-shrink: 0;
}
.status-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-badge.authentic  { background: #dcfce7; color: #166534; }
.status-badge.recalled   { background: #fef2f2; color: #991b1b; }
.status-badge.inactive   { background: var(--gray-100); color: var(--gray-500); }
.status-badge.claimed    { background: #fef9c3; color: #713f12; }

/* ── Empty states ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-title { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; color: var(--gray-900); }
.empty-desc  { font-size: .82rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 1.25rem; }
.empty-cta {
  display: inline-block;
  padding: .55rem 1.25rem;
  background: var(--gray-900);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ── Notification items ─────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #f0fdf4; }
.notif-item.unread:hover { background: #dcfce7; }
.notif-item.recall { background: #fef2f2; }
.notif-item.recall:hover { background: #fee2e2; }
.notif-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .85rem; font-weight: 700; color: var(--gray-900); margin-bottom: .15rem; }
.notif-preview { font-size: .78rem; color: var(--gray-500); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: .7rem; color: var(--gray-400); flex-shrink: 0; padding-top: .15rem; }
.unread-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .45rem;
}

/* ── Settings ───────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
}
.settings-value {
  font-size: .82rem;
  color: var(--gray-500);
  text-align: right;
}
.settings-edit {
  font-size: .78rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.danger-btn {
  width: 100%;
  padding: .7rem;
  background: #fff;
  color: #991b1b;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.danger-btn:hover { background: #fef2f2; }

/* ── Product detail ─────────────────────────────────── */
.product-hero {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: .75rem;
  display: block;
}
.detail-banner {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.detail-banner.authentic { background: #f0fdf4; border: 1.5px solid #bbf7d0; }
.detail-banner.recalled  { background: #fef2f2; border: 1.5px solid #fecaca; }
.detail-banner.inactive  { background: var(--gray-100); border: 1.5px solid var(--gray-200); }
.detail-banner-icon { font-size: 2rem; flex-shrink: 0; }
.detail-banner-text h2 { font-size: .95rem; font-weight: 700; margin-bottom: .15rem; }
.detail-banner-text p  { font-size: .78rem; color: var(--gray-500); line-height: 1.4; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.detail-item .dk { font-size: .7rem; color: var(--gray-500); font-weight: 500; margin-bottom: .1rem; }
.detail-item .dv { font-size: .88rem; font-weight: 600; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; align-items: flex-start; gap: .75rem; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 9px; top: 20px; width: 2px; height: calc(100% + 2px); background: var(--gray-200); }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; border: 2px solid var(--gray-200); background: #fff; }
.tl-dot.done { background: var(--green); border-color: var(--green); }
.tl-body { padding-bottom: .875rem; flex: 1; }
.tl-stage { font-size: .82rem; font-weight: 600; text-transform: capitalize; }
.tl-meta  { font-size: .74rem; color: var(--gray-500); margin-top: .1rem; }

/* recall notice */
.recall-notice {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.recall-notice-title { font-size: .88rem; font-weight: 700; color: #991b1b; margin-bottom: .4rem; display: flex; align-items: center; gap: .4rem; }
.recall-notice-body  { font-size: .8rem; color: #7f1d1d; line-height: 1.5; }
.recall-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.recall-action-btn {
  font-size: .75rem;
  font-weight: 600;
  padding: .4rem .875rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.recall-action-btn.primary { background: #991b1b; color: #fff; }
.recall-action-btn.secondary { background: #fff; color: #991b1b; border: 1px solid #fecaca; }

/* verify link */
.verify-bar {
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius);
  padding: .875rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}
.verify-bar span { font-size: .88rem; font-weight: 600; }
.verify-bar-arrow { font-size: 1rem; }

/* ── Claim page ─────────────────────────────────────── */
.claim-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}
.claim-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.claim-title { font-size: 1.1rem; font-weight: 800; color: var(--gray-900); margin-bottom: .4rem; }
.claim-sub { font-size: .82rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 1.5rem; }

/* ── Toast ──────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + .75rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--gray-900);
  color: #fff;
  padding: .55rem 1.1rem;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Loading skeleton ───────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card {
  height: 72px;
  border-radius: var(--radius);
  margin-bottom: .6rem;
}

/* ── Back button ────────────────────────────────────── */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  padding: .4rem 0;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.page-back:hover { color: var(--gray-900); }
.page-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Divider ────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: .5rem 0;
}

/* ── Lang switcher ──────────────────────────────────── */
.lang-select {
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .3rem .5rem;
  background: var(--gray-50);
  color: var(--gray-700);
  cursor: pointer;
  min-height: 36px;
  outline: none;
}
