/* Estilos propios de la herramienta de QR. Van en un fichero aparte porque la
   política de seguridad (CSP) no permite estilos "en línea". Reutiliza las
   variables de marca de panel.css (--accent, --border, --muted…). */

.card-tool { max-width: 560px; }

.qr-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.qr-field { display: flex; flex-direction: column; }

/* Los <select> reutilizan el aspecto de .form-input */
select.form-input { appearance: none; -webkit-appearance: none; cursor: pointer; }

.qr-color { display: flex; align-items: center; gap: 10px; }
.qr-color input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 46px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-input); cursor: pointer;
}
.qr-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.qr-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }
.qr-color .form-hint { margin-top: 0; }

/* Fondo blanco fijo a propósito (no var(--bg-card)): un QR necesita fondo claro
   para escanear bien, en los dos temas. Ver DESIGN.md, excepciones documentadas. */
.qr-preview {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #ffffff; border-radius: 12px;
  padding: 18px; margin: 4px 0 20px; min-height: 220px;
}
.qr-preview img { width: 240px; max-width: 100%; height: auto; display: block; }
/* Gris fijo (no var(--muted)): la caja de previsualización es blanca a propósito
   en los dos temas (un QR necesita fondo claro para escanear bien), así que el
   texto también necesita un contraste fijo, no el de --muted, que varía por tema. */
.qr-preview.empty { color: #6b6b70; font-size: 0.9rem; }

.qr-actions { display: flex; gap: 12px; margin-bottom: 18px; }
.qr-actions .btn { flex: 1; }

.btn-disabled { opacity: 0.45; pointer-events: none; }

.qr-note {
  font-size: 0.85rem; color: var(--muted); line-height: 1.5;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.qr-note strong { color: var(--text); }

@media (max-width: 480px) {
  .qr-options { grid-template-columns: 1fr; }
}

/* Sección desplegable "Para automatizar (API)" */
.qr-doc { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 14px; }
.qr-doc > summary {
  cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--text);
  list-style: none; user-select: none; display: flex; align-items: center; gap: 8px;
}
.qr-doc > summary::-webkit-details-marker { display: none; }
.qr-doc > summary::before { content: "\203A"; color: var(--accent); font-weight: 800; transition: transform 0.15s; }
.qr-doc[open] > summary::before { transform: rotate(90deg); }
.qr-doc-body { margin-top: 12px; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.qr-doc-body a { color: var(--accent); }
.qr-doc-h { color: var(--text); font-weight: 700; margin-top: 14px; margin-bottom: 6px; }
.qr-code {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin: 4px 0 10px; font-family: ui-monospace, monospace;
  font-size: 0.82rem; color: var(--text); white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.qr-doc-list { margin: 4px 0 10px; padding-left: 18px; }
.qr-doc-list li { margin-bottom: 5px; }
.qr-doc-body code {
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px;
  padding: 1px 5px; font-family: ui-monospace, monospace; font-size: 0.82rem; color: var(--text);
}
.qr-code code { background: none; border: none; padding: 0; }
.qr-doc-note { margin: 8px 0; }
