:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #101827;
  --muted: #667085;
  --line: #d9e1ec;
  --brand: #1455d9;
  --brand-dark: #0d3fa4;
  --shadow: 0 20px 50px rgba(16, 24, 39, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #dfeaff, transparent 28%), var(--bg);
}
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 18px 12px;
}
.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
}
h1 { margin: 12px 0 8px; font-size: clamp(30px, 5vw, 48px); line-height: 1.05; }
p { color: var(--muted); }
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  background: var(--card);
  border: 1px solid rgba(217,225,236,.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
}
h2 { margin: 0 0 18px; }
label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px #dce8ff; }
textarea { min-height: 118px; resize: vertical; }
small { color: var(--muted); display: block; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 800;
  cursor: pointer;
  color: #0f172a;
  background: #eef3fb;
}
button:hover { transform: translateY(-1px); }
.primary {
  margin-top: 20px;
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #03a9f4);
  box-shadow: 0 10px 24px rgba(20,85,217,.26);
}
.status { min-height: 22px; font-weight: 700; }
.status.ok { color: #097b49; }
.status.err { color: #b42318; }
.preview-panel { display: flex; flex-direction: column; }
.qr-card {
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #f9fbff, #eef3fb);
  border: 1px dashed #bac7dc;
  padding: 22px;
}
#qrCanvas {
  width: min(100%, 420px);
  height: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(16,24,39,.12);
}
#payloadPreview { margin-top: 18px; font-size: 13px; color: #475467; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 14px; }
footer { text-align: center; padding: 20px; color: var(--muted); }
.hidden { display: none; }
@media (max-width: 820px) {
  .wrap { grid-template-columns: 1fr; }
  .grid2, .actions { grid-template-columns: 1fr; }
  .panel { padding: 18px; border-radius: 18px; }
}
