:root {
  --bg: #0f0f1a;
  --panel: #1a1a2e;
  --panel-2: #22223a;
  --border: #2e2e4a;
  --text: #ececf2;
  --muted: #9a9ab5;
  --primary: #7c3aed;
  --primary-2: #6d28d9;
  --primary-soft: #2a2150;
  --accent: #22d3ee;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #241b4d 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(15,15,26,.7);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo { width: 30px; height: 30px; }
.brand-name { font-size: 1.15rem; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.badge {
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-free { background: var(--panel-2); color: var(--muted); }
.badge-pro { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(320px, 420px);
  gap: 22px;
  max-width: 1180px;
  margin: 26px auto;
  padding: 0 22px;
  align-items: start;
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .preview { order: -1; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field-label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sep { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

.input, .select, textarea {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: .95rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.select { appearance: none; cursor: pointer; }

.mini { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 130px; }
.mini .select, .mini input[type=range] { width: 100%; }

.color-input { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.color-input input[type=color] {
  width: 46px; height: 38px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-2); cursor: pointer; padding: 3px;
}
.check { display: flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--muted); cursor: pointer; margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.tab {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 13px; border-radius: 999px; font-size: .85rem; cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--primary); }
.tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: var(--radius-sm); padding: 12px 18px; font-size: .92rem;
  font-weight: 600; cursor: pointer; transition: transform .08s, filter .15s, background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 13px; font-size: .82rem; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

/* ---------- Preview ---------- */
.preview { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 18px; }
.preview-stage {
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(45deg, #20203a 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(-45deg, #20203a 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(45deg, transparent 75%, #20203a 75%) -10px 0/20px 20px,
    linear-gradient(-45deg, transparent 75%, #20203a 75%) -10px 0/20px 20px,
    var(--panel-2);
  border-radius: var(--radius); padding: 26px; min-height: 290px;
}
.qr-mount { background: #fff; border-radius: 10px; padding: 10px; line-height: 0; box-shadow: var(--shadow); }
.qr-mount canvas, .qr-mount svg { display: block; max-width: 260px; height: auto; }

.export-buttons { display: flex; gap: 10px; }
.export-buttons .btn { flex: 1; }
.hint { font-size: .78rem; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.hint.err { color: var(--danger); }

/* ---------- Pro pills / gating ---------- */
.pro-pill {
  font-size: .62rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; padding: 2px 6px; border-radius: 5px; vertical-align: middle; letter-spacing: .04em;
}
.is-locked { opacity: .5; pointer-events: none; }
.body-pro .pro-pill { display: none; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,5,12,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; max-width: 420px; width: 100%; position: relative; box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 16px; font-size: 1.4rem; }
.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.features { list-style: none; padding: 0; margin: 0 0 20px; }
.features li { padding: 7px 0; font-size: .95rem; border-bottom: 1px solid var(--border); }
.features li:last-child { border: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--primary); color: var(--text);
  padding: 13px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  z-index: 60; font-size: .9rem; max-width: 90vw;
}

/* ---------- Footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 20px; }

/* ---------- Phone preview ---------- */
.phone {
  width: 300px; max-width: 100%; height: 580px; margin: 0 auto;
  background: #000; border-radius: 34px; padding: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.phone iframe { width: 100%; height: 100%; border: none; border-radius: 24px; background: #fff; }
.export { margin-top: 18px; }

/* ---------- Hero ---------- */
.hero { max-width: 760px; margin: 40px auto 6px; padding: 0 22px; text-align: center; }
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px;
  background: linear-gradient(120deg, #fff 30%, #c4b5fd 70%, #67e8f9);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.05rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ---------- Marketing sections ---------- */
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.content-section { max-width: 1000px; margin: 56px auto; padding: 0 22px; }
.content-section h2 { text-align: center; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; margin: 0 0 30px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card-icon { font-size: 1.7rem; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

.usecases { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.usecases span {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: .92rem; color: var(--text);
}

.faq details {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; color: var(--muted); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; font-size: .95rem; }

.final-cta {
  max-width: 700px; margin: 60px auto; padding: 44px 22px; text-align: center;
  background: linear-gradient(135deg, var(--primary-soft), var(--panel));
  border: 1px solid var(--primary); border-radius: var(--radius);
}
.final-cta h2 { margin: 0 0 10px; font-size: 1.6rem; }
.final-cta p { margin: 0 0 22px; color: var(--muted); }

.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.cross-sell { font-size: .92rem; color: var(--text); margin: 0 0 6px; }

.hidden { display: none !important; }
