/* ==========================================================================
   QR Code Generator
   ========================================================================== */

.qr-types { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.qr-types input { position: absolute; opacity: 0; pointer-events: none; }
.qr-types label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.qr-types label .icon { width: 15px; height: 15px; }
.qr-types label:hover { color: var(--text); border-color: rgba(var(--ink), 0.24); }
.qr-types input:checked + label { color: var(--on-soft); background: var(--grad-soft); border-color: rgba(139, 92, 246, 0.6); }
.qr-types input:focus-visible + label { outline: 2px solid var(--lilac); outline-offset: 2px; }

.qr-panel { display: flex; flex-direction: column; gap: 1rem; }
.qr-panel[hidden] { display: none; }
.qr-check { align-self: end; padding-bottom: 0.7rem; }
.opt { color: var(--muted); font-weight: 400; }

.qr-style {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.qr-style .action-label { margin: 0; }

.qr-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.qr-color {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem 0.35rem 0.35rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.qr-color input {
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.qr-color input::-webkit-color-swatch-wrapper { padding: 0; }
.qr-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.qr-color input::-moz-color-swatch { border: 0; border-radius: 50%; }
.qr-color span { display: flex; flex-direction: column; line-height: 1.2; }
.qr-color b { color: var(--text); font-size: 0.8rem; font-weight: 600; }
.qr-color code { color: var(--muted); font-family: var(--font-mono); font-size: 0.76rem; }

.qr-range { width: 100%; accent-color: var(--violet); }
.field-label output {
  display: inline-block;
  min-width: 2.4em;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--lilac);
  font-size: 0.8rem;
  text-align: center;
}

.qr-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.qr-logo .link-btn[hidden], .qr-logo-size[hidden] { display: none; }
.qr-logo-size { flex: 1 1 200px; }

.qr-out { align-items: center; }
.qr-preview {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.6);
}
.qr-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: auto; }

.qr-warn {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warn-text);
  font-size: 0.86rem;
  line-height: 1.5;
}
.qr-warn.is-bad { border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.1); color: var(--danger-text); }
.qr-warn[hidden] { display: none; }

.qr-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0.9rem; margin: 0; text-align: center; }
.qr-size { width: 100%; max-width: 260px; }
.qr-out .output-actions { justify-content: center; }
.qr-out .field-hint { margin: 0; text-align: center; }
