:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6b655d;
  --line: #e6e0d6;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ec;
  --danger: #b4231f;
  --ok: #1f7a4d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(29, 27, 25, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513; --card: #211e1b; --ink: #f1ece4; --muted: #a39b90; --line: #332e29;
    --accent: #3fb79c; --accent-ink: #0d1b17; --accent-soft: #1d3029; --shadow: 0 10px 30px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 56px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; letter-spacing: -.02em; }
.brand .name { font-weight: 650; letter-spacing: .02em; font-size: 1.05rem; }
.env { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.env.live { background: #fde8e7; color: var(--danger); }

h1 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 1.05rem; margin: 0 0 14px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); min-height: 1.2em; }

.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.grid > * { min-width: 0; }   /* let <pre> and long ids shrink instead of widening the column */
@media (min-width: 820px) { .grid { grid-template-columns: 1.1fr .9fr; align-items: start; } .grid > .summary { order: 2; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .legend { font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=number], input[type=email], select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.amount { position: relative; }
.amount input { padding-left: 44px; font-size: 1.25rem; font-weight: 600; letter-spacing: .01em; }
.amount .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip:hover, .chip[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; }

.btn { font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 14px 18px; cursor: pointer; width: 100%; transition: transform .05s ease, filter .15s ease; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn[disabled] { opacity: .55; cursor: progress; }

.summary .lines { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary .total { font-size: 1.35rem; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.badge.ok { background: #e3f3ea; color: var(--ok); } .badge.pending { background: #fff3d6; color: #8a5a00; } .badge.fail { background: #fde8e7; color: var(--danger); }
.status-hero { text-align: center; padding: 12px 0 20px; }
.status-hero .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 1.8rem; }
.status-hero .icon.ok { background: #e3f3ea; color: var(--ok); } .status-hero .icon.fail { background: #fde8e7; color: var(--danger); } .status-hero .icon.pending { background: #fff3d6; color: #8a5a00; }
details { margin-top: 14px; } summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .78rem; overflow: auto; max-height: 360px; }
.testcards table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.testcards td { padding: 6px 4px; border-top: 1px solid var(--line); }
.testcards code { font-size: .85rem; cursor: copy; }
.secure { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; margin-top: 14px; }
footer { margin-top: 36px; color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* COPYandPAY widget — the class names are static (vendor docs), so we theme them here. */
.wpwl-container { margin-top: 6px; }
.wpwl-form { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: none; margin: 0; }
.wpwl-group { margin-bottom: 14px; }
.wpwl-label { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0 0 6px; width: 100%; float: none; }
.wpwl-wrapper { width: 100%; float: none; }
.wpwl-control, .wpwl-control.wpwl-control-iframe { height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 0 12px; font: inherit; width: 100%; }
.wpwl-control-iframe { padding: 0; }
.wpwl-has-error .wpwl-control { border-color: var(--danger); }
.wpwl-hint { color: var(--danger); font-size: .8rem; }
.wpwl-group-expiry, .wpwl-group-cvv { width: 48%; display: inline-block; vertical-align: top; }
.wpwl-group-expiry { margin-right: 4%; }
.wpwl-brand-card { display: none; }
.wpwl-group-brand { display: none; }
.wpwl-button-pay { display: none; }  /* replaced by our own button, which calls wpwl.executePayment */
/* Wallet / card / BENEFIT slots on the pay page */
.wallets { display: flex; flex-direction: column; gap: 10px; }
.wallets .wpwl-container, #benefit .wpwl-container { margin: 0; }
.wallets:empty { display: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider[hidden], #pay[hidden] { display: none; }   /* our display rules would otherwise beat the hidden attribute */
.wpwl-form-virtualAccount .wpwl-button-brand { font: inherit; font-weight: 650; width: 100%; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.wpwl-form-virtualAccount .wpwl-button-brand:hover { background: var(--accent-soft, transparent); }
.wpwl-form-virtualAccount .wpwl-group-button { margin: 0; }
/* BenefitPay: the FOO SDK styles .inapp-btn itself (201×48 branded image); we only centre it */
#benefitpay { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#benefitpay .inapp-btn:disabled { opacity: .55; cursor: progress; }
#benefitpay-status { min-height: 1.2em; text-align: center; }
