:root{
  --bg:#f8fafc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --line2:#eef2f7;
  --primary:#4f46e5;
  --primary2:#4338ca;
  --shadow: 0 20px 45px rgba(15, 23, 42, .08);
  --shadow2: 0 10px 20px rgba(79, 70, 229, .18);
  --radius: 22px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app{
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px 40px;
}

.header{
  text-align:center;
  margin-bottom: 26px;
}

.logo-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:56px;
  height:56px;
  background: var(--primary);
  color:#fff;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(79, 70, 229, .22);
  margin-bottom: 10px;
}

.header h1{
  font-size: clamp(26px, 2.5vw, 36px);
  margin: 0;
  letter-spacing: -.02em;
}

.header p{
  margin: 8px auto 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.4;
}

.main{
  display:grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items:start;
}

@media (min-width: 980px){
  .main{ grid-template-columns: 1.1fr .9fr; gap: 28px; }
}

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

@media (min-width: 720px){
  .panel{ padding: 26px; }
}

.panel-title{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 16px;
}

.panel-title h2{
  margin:0;
  font-size: 18px;
  color: #1f2937;
}

.dot{ width:10px; height:10px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 6px rgba(79, 70, 229, .12); }

.form{ display:flex; flex-direction:column; gap: 14px; }

.field label{
  display:block;
  font-size: 13px;
  font-weight: 600;
  color:#334155;
  margin: 0 0 6px;
}

.field input[type="text"],
.field select{
  width:100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline:none;
  background:#fff;
  font-size: 14px;
}

.field input[type="text"]:focus,
.field select:focus{
  border-color: rgba(79, 70, 229, .9);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.field input[disabled]{
  background:#f1f5f9;
  color:#94a3b8;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px){
  .grid2{ grid-template-columns: 1fr 1fr; }
}

.checkbox{ display:flex; align-items:flex-end; }

.check{
  display:flex;
  align-items:center;
  gap: 10px;
  cursor:pointer;
  user-select:none;
  color:#475569;
  font-size: 14px;
}

.check input{ width: 16px; height: 16px; accent-color: var(--primary); }

.hint{ color:#94a3b8; font-size: 12px; margin-top: 6px; }

.sep{ border:0; border-top: 1px solid var(--line2); margin: 6px 0; }

.logo-row{ display:flex; gap: 12px; align-items:center; }

.logo-picker{
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 2px dashed #cbd5e1;
  background: #fff;
  position:relative;
  overflow:hidden;
  flex: 0 0 auto;
  cursor: pointer;
}

.logo-picker:hover{ border-color: rgba(79,70,229,.6); background: rgba(79,70,229,.04); }

.logo-picker input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.logo-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#94a3b8;
  font-weight:700;
}

.logo-empty .plus{ font-size: 20px; line-height:1; }

#logoPreview{
  width:100%;
  height:100%;
  object-fit: cover;
  display:none;
  pointer-events: none;
}

.logo-meta{ display:flex; flex-direction:column; gap: 6px; }

.preview-col{ display:flex; flex-direction:column; gap: 14px; }

.preview-wrap{ display:flex; justify-content:center; }

.card{
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 28px;
  padding: 34px 26px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .12);
  text-align:center;
}

.card-title{
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.qr-shell{
  display:flex;
  justify-content:center;
}

.qr-mount{
  padding: 14px;
  border-radius: 20px;
  border: 2px solid #f1f5f9;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .06);
  background: #fff;
}

.card-body{ margin-top: 18px; }

.details{
  background: #f8fafc;
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 14px 14px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.detail-label{
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:#94a3b8;
  font-weight: 800;
}

.detail-value{
  font-size: 18px;
  font-weight: 700;
  color:#1f2937;
  word-break: break-word;
}

.detail-block + .detail-block{
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.scan-rule{
  display:flex;
  align-items:center;
  gap: 10px;
  color:#64748b;
  margin-top: 16px;
  font-size: 12px;
  justify-content:center;
}

.scan-rule span{
  height:1px;
  background:#e2e8f0;
  flex:1;
}

.scan-rule b{ font-weight: 700; white-space: nowrap; }

.credit{
  margin: 16px 0 0;
  font-size: 10px;
  color:#94a3b8;
  font-weight: 600;
}

.credit span{ color: rgba(79, 70, 229, .75); }

.actions{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px){
  .actions{ grid-template-columns: repeat(3, 1fr); }
}

.btn{
  appearance:none;
  border: 1px solid var(--line);
  background: #fff;
  color:#334155;
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 700;
  cursor:pointer;
  transition: .15s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

.btn:hover{ border-color: rgba(79, 70, 229, .65); color: var(--primary); transform: translateY(-1px); }

.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

.btn-primary{
  background: var(--primary);
  border-color: transparent;
  color:#fff;
  box-shadow: var(--shadow2);
}

.btn-primary:hover{ background: var(--primary2); color:#fff; border-color: transparent; }

.btn-ghost{
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
  border-radius: 12px;
}

.tip{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 18px;
  padding: 14px;
}

.tip-icon{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(79,70,229,.14);
  color: var(--primary);
  font-weight: 800;
  flex: 0 0 auto;
}

.tip-text{
  color:#3730a3;
  font-size: 13px;
  line-height: 1.35;
}

.footer{
  text-align:center;
  color:#94a3b8;
  font-size: 13px;
  margin-top: 26px;
}

/* Print */
@media print {
  .no-print{ display:none !important; }
  body{ background:#fff !important; }
  .app{ max-width:none; padding:0; }
  .main{ display:block; }
  .preview-wrap{ justify-content:flex-start; }
  .card{
    box-shadow:none !important;
    border:none !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
}