* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  color: #1a1a2e;
}

.container {
  width: 100%;
  max-width: 560px;
}

h1 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  color: #1a1a2e;
}

.subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 12px #00000014;
}

/* Tab navigation */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 0.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 1px 4px #0000001a;
}

.tab-btn:hover:not(.active) {
  color: #1a1a2e;
}

/* Tab panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

input, select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px #6366f126;
  background: #fff;
}

input::placeholder {
  color: #9ca3af;
}

.inline-row {
  display: flex;
  gap: 0.75rem;
}

.inline-row .form-group {
  flex: 1;
}

/* Color picker */
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.color-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px #6366f126;
}

.color-input-wrap input[type="color"] {
  width: 2rem;
  height: 1.75rem;
  border: none;
  border-radius: 4px;
  padding: 0;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.color-input-wrap input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: "SF Mono", "Fira Code", monospace;
  color: #1a1a2e;
  outline: none;
  min-width: 0;
  padding: 0;
}

.color-input-wrap input[type="text"]::placeholder {
  color: #9ca3af;
}

/* Checkbox */
.checkbox-group {
  margin-bottom: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #6366f1;
  cursor: pointer;
}

/* Generate button */
.btn-generate {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}

.btn-generate:hover {
  background: #4f46e5;
}

.btn-generate:active {
  transform: scale(0.98);
}

/* QR output area */
.qr-output {
  margin-top: 1.5rem;
  text-align: center;
  display: none;
}

.qr-output.visible {
  display: block;
}

.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0;
}

#qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#qr-container canvas,
#qr-container img {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.qr-label {
  font-size: 0.8rem;
  color: #6b7280;
  word-break: break-all;
  padding: 0 0.5rem;
  margin-bottom: 1rem;
}

.download-btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1.5px solid #6366f1;
  border-radius: 8px;
  background: transparent;
  color: #6366f1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.download-btn:hover {
  background: #6366f1;
  color: #fff;
}

/* Error message */
.error-msg {
  color: #dc2626;
  font-size: 0.82rem;
  margin-top: 0.4rem;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* Copyright banner */
.copyright {
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
  padding: 1.5rem 1rem 0.5rem;
}
