/* Customer payment pages (simple + advanced) and the demo. Shared look; each variant's
   style.css only adds its own layout. Built on shared/styles/tokens.css.

   White-label: the merchant's checkout branding (Settings > Branding) arrives as
   --brand-primary / --brand-secondary / --brand-accent on <html> (applyBranding in
   script.js). Defaults are GriffNode's own gradient, so an unbranded page looks like
   the rest of the product. */

:root {
  --brand-primary: var(--gn-blue);
  --brand-secondary: var(--gn-violet);
  --brand-accent: var(--brand-secondary);
  --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 60%, var(--brand-accent) 100%);

  /* Legacy names still referenced by inline styles in script.js / demo.js */
  --bg-primary: var(--gn-page);
  --bg-secondary: var(--gn-surface);
  --bg-tertiary: var(--gn-surface-2);
  --text-primary: var(--gn-ink);
  --text-secondary: var(--gn-muted);
  --text-tertiary: var(--gn-muted);
  --border-color: var(--gn-hairline-strong);
  --border-light: var(--gn-hairline);
  --hairline: var(--gn-hairline);
  --primary: var(--brand-primary);
  --success: var(--gn-ok);
  --warning: var(--gn-warn);
  --error: var(--gn-bad);
}

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

body {
  font-family: var(--gn-font);
  font-size: 15px;
  line-height: 1.5;
  background: var(--gn-page);
  color: var(--gn-ink);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--gn-focus); outline-offset: 2px; }

.container { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--gn-hairline);
  background: var(--gn-page);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 36px; height: 36px; object-fit: contain; flex: none; }
.brand-text,
.brand-text h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--gn-ink);
}
.brand-text p { font-size: 13px; color: var(--gn-muted); }
.header-tools { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--gn-r-pill);
  border: 1px solid var(--gn-hairline);
  background: transparent;
  color: var(--gn-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color var(--gn-fast), border-color var(--gn-fast);
}
.theme-toggle:hover { color: var(--gn-ink); border-color: var(--gn-hairline-strong); }

/* Cards */
.card,
.payment-card {
  background: var(--gn-surface);
  border: 1px solid var(--gn-hairline);
  border-radius: var(--gn-r-card);
}

.section-title {
  margin-bottom: 12px;
  font: 500 12px/1 var(--gn-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gn-muted);
}

/* QR */
.qr,
.qr-code {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 0 auto 10px;
  padding: 12px;
  overflow: hidden;
  background: #fff;                    /* QR must stay dark-on-white in every theme */
  border: 1px solid var(--gn-hairline);
  border-radius: 16px;
  color: #5b6275;
  font-size: 13px;
  text-align: center;
}
.qr img, .qr canvas, .qr svg,
.qr-code img, .qr-code canvas, .qr-code svg { display: block; width: 100%; height: 100%; }
.qr-hint { font-size: 13px; color: var(--gn-muted); }

/* The one gradient action on a customer screen */
.open-wallet-btn {
  display: none;                       /* script.js shows it once a BIP-21 URI exists */
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  min-height: 48px;
  margin: 14px auto 0;
  padding: 0 22px;
  border: 0;
  border-radius: var(--gn-r-pill);
  background: var(--brand-gradient);
  box-shadow: var(--gn-brand-glow);
  color: #fff;
  font: 500 15px var(--gn-font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .4s var(--gn-ease), box-shadow .4s var(--gn-ease);
}
.open-wallet-btn:hover { transform: translateY(-2px); box-shadow: var(--gn-brand-glow-hover); }

.secured-note {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--gn-muted);
}
.secured-note i { margin-right: 4px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: var(--gn-r-pill);
  border: 1px solid var(--gn-hairline);
  background: transparent;
  color: var(--gn-muted);
  font: 500 13px var(--gn-font);
  cursor: pointer;
  transition: color var(--gn-fast), border-color var(--gn-fast);
}
.share-btn:hover { color: var(--gn-ink); border-color: var(--gn-hairline-strong); }

/* Copyable fields */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--gn-muted); }
.field-info { margin-top: 6px; font: 12px var(--gn-mono); color: var(--gn-muted); }
.input-wrap { display: flex; gap: 6px; }
.input-wrap input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--gn-r-ctl);
  background: var(--gn-surface-2);
  color: var(--gn-ink);
  font: 14px var(--gn-mono);
  text-overflow: ellipsis;
}
.input-wrap input:focus { outline: none; border-color: var(--gn-hairline-strong); }
.copy-btn {
  flex: none;
  width: 46px;
  min-height: 46px;
  border-radius: var(--gn-r-ctl);
  border: 1px solid var(--gn-hairline);
  background: var(--gn-surface);
  color: var(--gn-ink);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--gn-fast), background-color var(--gn-fast);
}
.copy-btn:hover { border-color: var(--gn-hairline-strong); background: var(--gn-surface-2); }
.copy-btn .fa-check { color: var(--gn-ok); }

/* Confirmations progress (both variants' class names) */
.progress-header,
.confirmations-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-label,
.confirmations-label { font-size: 13px; color: var(--gn-muted); }
.progress-value,
.confirmations-value { font: 500 14px var(--gn-mono); color: var(--gn-ink); font-variant-numeric: tabular-nums; }
.progress-bar,
.confirmations-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: var(--gn-r-pill);
  background: var(--gn-surface-2);
}
.progress-fill,
.confirmations-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-gradient);
  transition: width .6s var(--gn-ease), background-color .3s;
}
/* Fully confirmed = money arrived: the reserved green, not the brand */
.progress-fill[style*="100%"],
.confirmations-fill[style*="100%"] { background: var(--gn-ok); }
.note { margin-top: 8px; font-size: 12px; color: var(--gn-muted); }

/* Cancel */
.cancel-section { margin-top: 16px; text-align: center; }
.cancel-btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--gn-r-pill);
  border: 1px solid var(--gn-hairline);
  background: transparent;
  color: var(--gn-muted);
  font: 500 13px var(--gn-font);
  cursor: pointer;
  transition: color var(--gn-fast), border-color var(--gn-fast);
}
.cancel-btn:hover { color: var(--gn-bad); border-color: var(--gn-bad); }
.cancel-btn:disabled { opacity: .6; cursor: default; }

/* Email notification capture */
.email-capture,
.email-done { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gn-hairline); }
.email-capture p:first-child { margin-bottom: 10px; font-size: 13px; color: var(--gn-muted); }
.email-row { display: flex; gap: 8px; }
.email-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--gn-r-ctl);
  border: 1px solid var(--gn-hairline-strong);
  background: var(--gn-surface);
  color: var(--gn-ink);
  font: 14px var(--gn-font);
}
.email-row input:focus { outline: none; border-color: var(--brand-primary); }
.email-row button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--gn-r-pill);
  background: var(--gn-ink);
  color: var(--gn-page);
  font: 500 14px var(--gn-font);
  white-space: nowrap;
  cursor: pointer;
}
.email-row button:disabled { opacity: .6; cursor: default; }
.email-capture-error { margin-top: 6px; font-size: 12px; color: var(--gn-bad); }
.email-done { font-size: 13px; color: var(--gn-muted); }
.email-done i { margin-right: 6px; color: var(--gn-ok); }

/* Footer */
.footer {
  padding: 18px 24px;
  border-top: 1px solid var(--gn-hairline);
  text-align: center;
  font-size: 13px;
  color: var(--gn-muted);
}
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--gn-ink); }
.footer strong { color: var(--gn-ink); font-weight: 600; }

@media (max-width: 480px) {
  .logo { width: 32px; height: 32px; }
  .brand-text p { display: none; }
  .qr, .qr-code { width: 176px; height: 176px; }
}
