/* ============================================================
   QRaft — styles
   Dark, modern SaaS look with glassmorphism + neon gradients.
   ============================================================ */

:root {
  --bg: #0a0a14;
  --bg-soft: #11111f;
  --text: #f5f5fa;
  --muted: #a0a0b8;
  --violet: #7c3aed;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.10);
  --radius: 18px;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #06b6d4 100%);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Radial glow behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(124, 58, 237, 0.18), transparent 50%),
    radial-gradient(700px circle at 85% 30%, rgba(236, 72, 153, 0.14), transparent 50%),
    radial-gradient(700px circle at 50% 100%, rgba(6, 182, 212, 0.12), transparent 50%);
  z-index: -2;
  pointer-events: none;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, .logo-text {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(236, 72, 153, 0.45); }
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.full-width { width: 100%; }

/* ===================== HEADER ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6vw;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 20, 0.55);
  border-bottom: 1px solid var(--glass-border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.logo-mark {
  font-size: 1.4rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text { font-size: 1.3rem; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.nav .btn { padding: 9px 18px; }

/* ===================== HERO ===================== */
.hero {
  display: flex;
  justify-content: center;
  text-align: center;
  padding: 90px 6vw 70px;
}
.hero-inner { max-width: 760px; }
.badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  font-weight: 700;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 24px auto 36px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 44px;
  justify-content: center;
  margin-top: 56px;
  flex-wrap: wrap;
}
.hero-stats strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stats span { color: var(--muted); font-size: 0.9rem; }

/* ===================== TOOL ===================== */
.tool-section { padding: 30px 6vw 80px; max-width: 1100px; margin: 0 auto; }
.tool-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.tool-left h2 { font-size: 1.8rem; margin-bottom: 22px; }

.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.type-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.18s;
}
.type-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.type-tab.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

/* QR / Barcode mode toggle */
.mode-toggle {
  display: inline-flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.mode-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--gradient); color: #fff; }
[hidden] { display: none !important; }

/* Barcode inputs */
#barcodeInputs label.full { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
#barcodeInputs select,
#barcodeInputs input[type="text"] {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
#barcodeInputs select:focus,
#barcodeInputs input[type="text"]:focus { outline: none; border-color: var(--violet); }
#barcodeInputs option { background: var(--bg-soft); }
.bc-hint { font-size: 0.8rem; color: var(--muted); margin: -8px 0 16px; }
#barcodeInputs label.bc-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--muted); margin-bottom: 6px;
}
#barcodeInputs label.bc-check input { width: auto; margin: 0; }

.fields { margin-bottom: 22px; }
.fields label, .customize label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.fields input[type="text"],
.fields input[type="url"],
.fields input[type="email"],
.fields input[type="tel"],
.fields input[type="password"],
.fields textarea,
.customize select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border 0.2s;
}
.fields input:focus, .fields textarea:focus, .customize select:focus {
  outline: none;
  border-color: var(--violet);
}
.fields textarea { resize: vertical; min-height: 80px; }

.customize { border-top: 1px solid var(--glass-border); padding-top: 20px; }
.field-row { display: flex; gap: 16px; }
.field-row label { flex: 1; }
.field-row label.full { flex: 1 1 100%; }
input[type="color"] {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
input[type="range"] {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--violet);
}
.customize select option { background: var(--bg-soft); }

.downloads { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.pro-pill {
  font-size: 0.65rem;
  background: var(--gradient);
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  margin-left: 4px;
  font-weight: 700;
}

/* QR preview */
.tool-right { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-stage {
  background: #fff;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}
.qr-stage:hover { transform: translateY(-6px) rotate(-1deg); }
.qr-preview { display: flex; align-items: center; justify-content: center; }
.qr-preview canvas, .qr-preview img { display: block; border-radius: 6px; }
.qr-hint { color: var(--muted); font-size: 0.85rem; margin-top: 18px; }

/* Ad slot */
.ad-slot {
  margin-top: 40px;
  padding: 26px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* When a real ad is injected, drop the placeholder chrome */
.ad-slot.ad-live { border: none; padding: 0; background: none; min-height: 0; }
/* Pro buyers see no ads (matches the Pro "No ads" benefit) */
body.is-pro .ad-slot { display: none; }

/* ===================== FEATURES ===================== */
.features { padding: 70px 6vw; max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 48px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.feature-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, border 0.25s ease;
}
.feature-card:hover { transform: translateY(-6px); border-color: rgba(124, 58, 237, 0.5); }
.feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }

/* ===================== PRICING ===================== */
.pricing { padding: 70px 6vw 90px; max-width: 900px; margin: 0 auto; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.price-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 34px;
  backdrop-filter: blur(10px);
  position: relative;
}
.price-card.featured {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box,
    var(--gradient) border-box;
  border: 1.5px solid transparent;
  transform: scale(1.03);
}
.featured-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
}
.price-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.price { font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700; margin-bottom: 22px; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.price-card ul { list-style: none; margin-bottom: 26px; }
.price-card li { padding: 7px 0; font-size: 0.95rem; }
.price-card li.muted { color: var(--muted); }

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 50px 6vw 30px;
  background: rgba(10, 10, 20, 0.6);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto 30px;
}
.footer-inner p { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.copyright { text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;                    /* margin:auto on .modal centers it (no align-items, avoids top-clip) */
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  padding: 20px;
  overflow-y: auto;                 /* scroll the backdrop when the modal is tall */
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  margin: auto;                     /* center when it fits; scroll (no clip) when it doesn't */
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-icon { font-size: 2.4rem; margin-bottom: 14px; }
.modal h3 { font-size: 1.4rem; margin-bottom: 12px; }
.modal p { color: var(--muted); margin-bottom: 24px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  margin-top: 14px;
  font-size: 0.9rem;
  font-family: inherit;
}
.link-btn:hover { color: var(--text); }

/* ===================== CRYPTO PAY BOX ===================== */
.crypto-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}
.pay-pickers { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-pickers .chain-label { flex: 1; }
.chain-label {
  display: block;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
}
.chain-select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.chain-select:focus { outline: none; border-color: var(--violet); }
.chain-select option { background: var(--bg-soft); }

/* Wallet chooser */
.wallet-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wallet-picker[hidden] { display: none; }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 0.18s;
}
.wallet-option:hover { background: rgba(255, 255, 255, 0.08); }
.wallet-option img { width: 22px; height: 22px; border-radius: 6px; }
.wallet-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--gradient); display: inline-block; }

.crypto-or {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pay-qr {
  display: inline-flex;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  min-height: 60px;
  align-items: center;
  justify-content: center;
}
.pay-qr canvas { display: block; border-radius: 4px; }
.crypto-hint { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.merchant-addr {
  display: block;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
.crypto-manual .link-btn { margin: 8px 0 16px; }

.license-row { display: flex; gap: 8px; }
.license-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.license-row input:focus { outline: none; border-color: var(--violet); }
.license-row .btn { padding: 10px 16px; white-space: nowrap; }
.license-msg { font-size: 0.82rem; margin-top: 10px; min-height: 1em; }
.license-msg.ok { color: #34d399; }
.license-msg.err { color: #f87171; }

/* Logo upload (file input) */
#logoInput {
  width: 100%;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: inherit;
}
#logoInput::file-selector-button {
  margin-right: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
#logoInput::file-selector-button:hover { background: rgba(255, 255, 255, 0.08); }
#removeLogo { margin-top: 10px; }

/* When Pro is active, hide the locked styling cue on buttons */
body.is-pro [data-pro] { opacity: 1; }

/* ===================== SCROLL REVEAL ===================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 820px) {
  .tool-card { grid-template-columns: 1fr; }
  .tool-right { order: -1; }
  .nav a:not(.btn) { display: none; }
  .hero-stats { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===================== CONTENT PAGES (About / Privacy / Contact) ===================== */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 60px 6vw 90px; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--text); }
.page-wrap h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin-bottom: 10px; }
.page-wrap .updated { color: var(--muted); font-size: 0.88rem; margin-bottom: 34px; }
.prose h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; margin: 30px 0 10px; }
.prose p, .prose li { color: var(--muted); margin-bottom: 12px; line-height: 1.75; }
.prose ul { padding-left: 20px; margin-bottom: 12px; }
.prose a { color: #c4b5fd; }

.contact-form { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; max-width: 480px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.25);
  color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--violet); }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button { align-self: flex-start; }

/* ===================== HOW-TO / USE CASES / FAQ ===================== */
.how-to, .uses { padding: 70px 6vw; max-width: 1100px; margin: 0 auto; }
.faq { padding: 70px 6vw 90px; max-width: 800px; margin: 0 auto; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 44px; }
.step {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 28px; backdrop-filter: blur(10px);
}
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; margin-bottom: 14px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.95rem; }

.uses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 44px; }
.use-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 24px; transition: transform 0.25s ease, border 0.25s ease;
}
.use-card:hover { transform: translateY(-5px); border-color: rgba(124, 58, 237, 0.5); }
.use-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.use-card p { color: var(--muted); font-size: 0.92rem; }

.faq-list { margin-top: 38px; display: flex; flex-direction: column; gap: 12px; }
.faq-list details {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 4px 20px;
}
.faq-list summary {
  cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--muted); font-size: 1.4rem; line-height: 1; transition: transform 0.2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { color: var(--muted); padding: 0 0 18px; line-height: 1.7; }

.guide-links { text-align: center; margin-top: 30px; color: var(--muted); font-size: 0.95rem; line-height: 2; }
.guide-links a { color: #c4b5fd; text-decoration: none; }
.guide-links a:hover { text-decoration: underline; }
