:root {
  --brand: #c94000;
  --brand-2: #e65c00;
  --brand-3: #ff8c42;
  --bg: #1a1a1a;
  --bg-card: #2a2a2a;
  --text: #f4f4f4;
  --text-muted: #b8b8b8;
  --border: #444;
  --success: #4caf50;
  --error: #f44336;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); background: linear-gradient(135deg, #1a1a1a 0%, #1a1208 100%); }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.header { text-align: center; padding: 24px 0 16px; }
.header h1 { font-size: 32px; margin: 0 0 8px; background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header p { color: var(--text-muted); margin: 0; font-size: 16px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 24px 0; }
.product { background: var(--bg-card); border: 2px solid var(--border); border-radius: 14px; padding: 20px; cursor: pointer; transition: all .2s; position: relative; }
.product:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.product.selected { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(255,75,130,0.25); }
.product .badge { position: absolute; top: -10px; right: 12px; background: var(--brand); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; letter-spacing: .5px; }
.product .name { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }
.product .desc { color: var(--text-muted); font-size: 14px; margin: 0 0 12px; }
.product .price { font-size: 28px; font-weight: bold; color: var(--brand-3); }
.product .balance { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.product img.preview { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }

.field { margin: 16px 0; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #1a1a1a; color: var(--text); font-size: 16px; }
.field input:focus { outline: none; border-color: var(--brand-2); }

.btn { display: inline-block; padding: 14px 28px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity .2s; text-decoration: none; }
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { background: #444; }

.checkout-area { margin-top: 24px; min-height: 400px; }
#checkout { min-height: 500px; }

.qr-block { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; background: #fff; border-radius: 12px; color: #222; }
.qr-block .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: bold; letter-spacing: 2px; }
.qr-block img { width: 240px; height: 240px; }

.balance-big { font-size: 42px; font-weight: bold; color: var(--brand-3); text-align: center; margin: 16px 0; }
.muted { color: var(--text-muted); font-size: 13px; }
.balance-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.balance-meta-item { white-space: nowrap; }
.balance-meta-sep { white-space: nowrap; }
.center { text-align: center; }
.error { background: rgba(244,67,54,0.15); border: 1px solid var(--error); color: var(--error); padding: 12px 16px; border-radius: 8px; margin: 12px 0; }
.success { background: rgba(76,175,80,0.15); border: 1px solid var(--success); color: var(--success); padding: 12px 16px; border-radius: 8px; margin: 12px 0; }

.footer { text-align: center; color: var(--text-muted); font-size: 12px; padding: 32px 0; }
.footer a { color: var(--brand-3); }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* How-To Steps */
.howto { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0 8px; }
.howto-step { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px; text-align: center; flex: 1; min-width: 150px; max-width: 220px; }
.howto-step .icon { font-size: 36px; margin-bottom: 8px; }
.howto-step .num { display: inline-block; background: var(--brand); color: #fff; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; font-size: 12px; font-weight: bold; margin-bottom: 8px; }
.howto-step .label { font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.howto-step .desc { font-size: 12px; color: var(--text-muted); }

/* QR small + click-to-enlarge */
.qr-block img { width: 160px; height: 160px; cursor: zoom-in; transition: opacity .15s; }
.qr-block img:hover { opacity: 0.85; }

/* QR Lightbox */
.qr-lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
.qr-lightbox.open { display: flex; }
.qr-lightbox img { width: min(90vw, 420px); height: min(90vw, 420px); border-radius: 16px; border: 10px solid #fff; }

/* Toggle consent switches */
.consent-area { margin: 20px 0 4px; display: flex; flex-direction: column; gap: 14px; }
.consent-row { display: flex; align-items: flex-start; gap: 12px; }
.consent-row input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 44px; min-width: 44px; height: 24px; border-radius: 999px; background: #555; border: none; cursor: pointer; transition: background .2s; position: relative; top: 1px; }
.consent-row input[type=checkbox]:checked { background: var(--brand-2); }
.consent-row input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.consent-row input[type=checkbox]:checked::after { left: 23px; }
.consent-row label { font-size: 13px; color: var(--text-muted); cursor: pointer; line-height: 1.45; }
.consent-row label a { color: var(--brand-3); }
