/* ============================================================
   VPAY design system - shared tokens and components
   Loaded by every layout. Tailwind utilities (tailwind.js +
   theme.js) carry page layout; this file carries the small set
   of semantic components reused across pages, including the
   class names injected at runtime by shop.js.
   ============================================================ */

:root {
  --brand: #00B876;
  --brand-strong: #00835A;
  --brand-tint: #E2F6EC;
  --brand-soft: #F0FAF5;
  --ink: #0C1A24;
  --ink-2: #33414E;
  --muted: #66727D;
  --line: #E3E9E7;
  --line-soft: #EDF1EF;
  --surface: #FFFFFF;
  --bg: #F2F5F3;
  --danger: #D3383E;
  --danger-tint: #FBEDED;
  --warn: #B45309;
  --warn-tint: #FDF3E3;
  --ok: #0E8A5F;
  --ok-tint: #E5F6EF;
  --info: #1D6FB8;
  --info-tint: #E8F2FB;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 18px;
  --shadow-1: 0 1px 2px rgba(12, 26, 36, .05), 0 1px 3px rgba(12, 26, 36, .06);
  --shadow-2: 0 10px 30px rgba(12, 26, 36, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: var(--brand-strong); text-decoration: none; }
svg { vertical-align: middle; flex: none; }
img { max-width: 100%; }

.muted { color: var(--muted); }
.good { color: var(--ok); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Page headings ---------- */
.page-title { font-size: 21px; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 4px 0; transition: color .15s ease;
}
.back-link:hover { color: var(--brand-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px; padding: 12px 22px;
  font-size: 15px; font-weight: 600; font-family: var(--font);
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease, border-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #06281C; }
.btn-outline { background: var(--surface); color: var(--brand-strong); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { background: #F6DBDC; }
.btn-quiet { background: var(--line-soft); color: var(--ink-2); }
.btn-quiet:hover { background: var(--line); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-block { display: flex; width: 100%; }
.linklike {
  background: none; border: none; color: var(--brand-strong); cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: var(--font); padding: 0;
}
.linklike:hover { text-decoration: underline; }
.inline { display: inline; }

/* ---------- Cards and surfaces ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 14px; }
.section-title { font-size: 15.5px; font-weight: 700; color: var(--ink); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label, .field { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=search], select, textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 15px; width: 100%; background: var(--surface); color: var(--ink);
  font-family: var(--font); font-weight: 400;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366727D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 184, 118, .16);
}
input::placeholder, textarea::placeholder { color: #9AA6AE; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand-strong); flex: none; }
.check-row, .stack label.check-row {
  display: flex; flex-direction: row; gap: 10px; align-items: center;
  font-size: 14px; font-weight: 500; color: var(--ink); padding: 6px 0;
}
.help { font-size: 12.5px; color: var(--muted); font-weight: 400; line-height: 1.45; }
input.small, select.small { padding: 9px 12px; font-size: 13.5px; }
select.small { padding-right: 34px; }

/* ---------- Alerts (also injected by shop.js at runtime) ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 8px;
  border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 14px; font-weight: 500; line-height: 1.5; margin: 4px 0;
}
.alert-danger { background: var(--danger-tint); color: #A3252B; border: 1px solid #F3CFD0; }
.alert-ok { background: var(--ok-tint); color: #0B6B4A; border: 1px solid #C4E9D9; }
.alert-warn { background: var(--warn-tint); color: var(--warn); border: 1px solid #F1DFC0; }

/* ---------- Status chips (functional status markers) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; line-height: 1.5; white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip-on { background: var(--ok-tint); color: #0B6B4A; }
.chip-off { background: var(--line-soft); color: var(--muted); }
.chip-warn { background: var(--warn-tint); color: var(--warn); }
.chip-bad { background: var(--danger-tint); color: var(--danger); }
.chip-info { background: var(--info-tint); color: var(--info); }
.chip-brand { background: var(--brand-tint); color: var(--brand-strong); }

/* ---------- Filter rows (link chips) ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
a.chip { text-decoration: none; padding: 7px 14px; font-size: 13px; transition: background-color .15s ease; }

/* ---------- Tables ---------- */
.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px;
  background: var(--surface); box-shadow: var(--shadow-1); border-radius: var(--radius-m);
  overflow: hidden;
}
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: #F7FAF8; font-weight: 600;
}
.admin-table tbody tr { transition: background-color .1s ease; }
.admin-table tbody tr:hover { background: #F9FCFA; }
.admin-table .num { text-align: right; }
.admin-table a { font-weight: 600; }

/* ---------- Transaction lines ---------- */
.txn-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.txn-line:last-child { border-bottom: none; }
.txn-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Empty states ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 36px 20px; color: var(--muted); font-size: 14px;
}
.empty-state svg { color: #B9C4BD; }

/* ---------- QR and code ---------- */
.qr-wrap { display: flex; justify-content: center; padding: 12px 0; }
.qr-wrap svg { width: 210px; height: 210px; }
pre.code {
  background: #0C1A24; color: #D7E4DC; padding: 14px 16px; border-radius: 12px;
  font-size: 12.5px; overflow-x: auto; margin: 8px 0; line-height: 1.6;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--line-soft); padding: 2px 7px; border-radius: 6px; font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- Runtime-injected quote lines (shop.js) ---------- */
.quote-lines { display: flex; flex-direction: column; gap: 2px; }
.quote-lines .line, .line {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--ink-2); padding: 4px 0;
}
.confirm-summary {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line-soft); padding-top: 12px; font-size: 15px;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--brand-tint); border-top-color: var(--brand-strong);
  animation: vpay-spin .8s linear infinite; margin: 0 auto;
}
@keyframes vpay-spin { to { transform: rotate(360deg); } }
.processing { text-align: center; padding: 34px 0; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- public pages, footer, cookie notice ---- */
.page-body h3 { font-size: 15px; font-weight: 700; margin: 18px 0 4px; }
.page-body p, .page-body li { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.page-body p { margin: 6px 0; }
.page-body ul, .page-body ol { margin: 6px 0 6px 20px; list-style: revert; }
.page-body a { color: var(--brand-strong); font-weight: 600; text-decoration: underline; }
.page-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.page-body th, .page-body td { border: 1px solid var(--line, #e5e7eb); padding: 6px 8px; text-align: left; }
.how-steps { margin-left: 20px; list-style: revert; font-size: 14px; line-height: 1.7; }
.site-footer { margin-top: 28px; padding: 18px 0 24px; text-align: center; font-size: 12px; color: var(--muted, #6b7280); }
.site-footer p { margin: 6px 0; }
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.site-footer a { color: var(--brand-strong); font-weight: 600; }
.site-footer-social a { margin: 0 6px; }
.cookie-notice { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 456px; margin: 0 auto; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; color: #111; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px; }
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; flex: 1; }
.cookie-notice a { color: var(--brand-strong); font-weight: 600; text-decoration: underline; }
.cookie-notice .btn { padding: 8px 16px; }
