:root {
  --bg-1: #0f0c29;
  --bg-2: #302b63;
  --bg-3: #24243e;
  --accent: #7f5af0;
  --accent-2: #2cb67d;
  --card-bg: rgba(255, 255, 255, 0.97);
  --text-dark: #1a1a2e;
  --text-muted: #6b7280;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(15, 12, 41, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow-x: hidden;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
}

.shape-1 {
  width: 320px;
  height: 320px;
  background: var(--accent);
  top: -80px;
  left: -80px;
}

.shape-2 {
  width: 260px;
  height: 260px;
  background: var(--accent-2);
  bottom: -60px;
  right: -60px;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: #f25f4c;
  top: 40%;
  right: 10%;
}

.wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
}

.app-header {
  text-align: center;
  margin-bottom: 28px;
  color: #fff;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.logo-icon {
  font-size: 1.4rem;
}

.logo strong {
  color: var(--accent-2);
}

.tagline {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(6px);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafd;
}

textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.15);
}

.field-row {
  display: flex;
  gap: 16px;
}

.color-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  background: #fafafd;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5c3ee0);
  color: #fff;
  flex: 1;
  box-shadow: 0 8px 18px rgba(127, 90, 240, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 10px 22px rgba(127, 90, 240, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #e2e2ea;
}

.btn-ghost:hover {
  background: #f2f2f7;
}

.btn-outline {
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.qr-canvas-wrap {
  width: 100%;
  min-height: 260px;
  border: 2px dashed #e2e2ea;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fafafd;
  transition: border-color 0.2s;
}

.qr-canvas-wrap.has-qr {
  border-style: solid;
  border-color: var(--accent-2);
  background: #fff;
}

#qrcode img,
#qrcode canvas {
  border-radius: 8px;
}

.placeholder-text {
  color: #b3b3c0;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

.download-actions {
  display: flex;
  gap: 12px;
}

.app-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}
