/* ── QR Modal ── */
.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(12, 16, 36, 0.72);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.qr-modal.open { display: flex; }

.qr-modal-card {
  background: #fff;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 24px 48px rgba(12, 16, 36, 0.3);
}

.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qr-modal-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a2040;
}

.qr-modal-close {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.qr-modal-close:hover { background: #f0f2fa; color: #1a2040; }
.qr-modal-close svg { width: 16px; height: 16px; }

/* Checkerboard para mostrar transparência */
#qr-canvas {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid #dde1ee;
  display: block;
  background:
    repeating-conic-gradient(#e9ebf0 0% 25%, #fff 0% 50%)
    0 0 / 16px 16px;
  image-rendering: pixelated;
}

.qr-options {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.qr-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.qr-option-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.qr-swatches {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qr-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.qr-swatch:hover { transform: scale(1.12); }
.qr-swatch-white { border-color: #9ca3af !important; box-shadow: inset 0 0 0 1px #e5e7eb; }
.qr-swatch.active {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(0, 0, 0, 0.35);
}

.qr-color-input {
  width: 26px;
  height: 26px;
  border: 2px solid #dde1ee;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  flex-shrink: 0;
}

.qr-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.qr-color-input::-webkit-color-swatch { border: none; border-radius: 50%; }
.qr-color-input::-moz-color-swatch { border: none; border-radius: 50%; }

/* Toggle switch */
.qr-toggle-row { cursor: pointer; user-select: none; }

.qr-toggle { position: relative; flex-shrink: 0; }
.qr-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.qr-toggle-track {
  display: block;
  width: 36px;
  height: 20px;
  background: #dde1ee;
  border-radius: 999px;
  transition: background 0.2s;
  position: relative;
}

.qr-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.qr-toggle input:checked + .qr-toggle-track { background: #e8703a; }
.qr-toggle input:checked + .qr-toggle-track::after { transform: translateX(16px); }

.qr-url-display {
  font-size: 0.6875rem;
  color: #6b7280;
  background: #f8f9fc;
  border: 1px solid #dde1ee;
  border-radius: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.qr-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  background: #1a2040;
  color: #fff;
  border: none;
  border-radius: 0.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.qr-download-btn:hover { opacity: 0.85; }
.qr-download-btn svg { width: 14px; height: 14px; }

/* QR open button — botão discreto */
.btn-qr-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5625rem;
  background: transparent;
  color: #9ca3af;
  border: 1px solid #dde1ee;
  border-radius: 0.15rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}

.btn-qr-open svg { width: 18px; height: 18px; }
.btn-qr-open:hover { color: #1a2040; border-color: #b0b7c8; background: #f0f2fa; }
