:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --border: #e5e7eb;
  --radius: 14px;
}

body.dark {
  --bg: #020617;
  --card: #020617;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1e293b;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 420px;
  margin: auto;
  padding: 20px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 20px;
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: box-shadow .2s ease;
}

@media (hover: hover) {
  .card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
  }
}

label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  display: block;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

input[type="range"] {
  width: 100%;
  margin-top: 6px;
}

.color-presets {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.color-presets button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--c);
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.preview {
  margin-top: 24px;
  text-align: center;
  animation: fadeUp .4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.qr-box {
  position: relative;
  display: inline-block;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
}

#logoPreview {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  display: none;
}

.download-btn {
  display: none;
  margin-top: 16px;
  padding: 10px 14px;
  background: #16a34a;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
}

/* 🌙 Dark Mode Switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: #cbd5f5;
  border-radius: 20px;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

.switch input:checked + .slider {
  background: #6366f1;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}