/* Generatore QR Myndus: regole specifiche dello strumento.
   Colori, font e tema (scuro/chiaro) arrivano da /style.css; qui si mappano solo i token. */
:root {
  --qr-accent-text: #060a10;
  --qr-warn-bg: #3a2d12;
  --qr-warn-text: #f2c879;
  --qr-err-bg: #3b1a1a;
  --qr-err-text: #f5a3a3;
}
html.light-mode {
  --qr-accent-text: #ffffff;
  --qr-warn-bg: #fff4e0;
  --qr-warn-text: #7a4a00;
  --qr-err-bg: #fdeaea;
  --qr-err-text: #8a1f1f;
}

body.qr-page { padding-top: 80px; }
.qr { max-width: 1040px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.qr *, .qr *::before, .qr *::after { box-sizing: border-box; }

.qr .qr-hero { padding: 36px 0 8px; }
.qr .qr-hero h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; margin: 0 0 10px; color: var(--text-primary); }
.qr .qr-hero p { margin: 0; color: var(--text-secondary); max-width: 62ch; }

.qr .tool { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 24px 0 40px; }
@media (min-width: 880px) { .qr .tool { grid-template-columns: 1.15fr .85fr; align-items: start; } }

.qr .card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  color: var(--text-primary); transform: none; position: static; cursor: auto;
}
.qr .card:hover { transform: none; background: var(--bg-surface); border-color: var(--border); }
.qr .card h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 12px; color: var(--text-primary); }

.qr .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qr .tabs button {
  font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-primary);
}
.qr .tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--qr-accent-text); }

.qr label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 4px; color: var(--text-primary); }
.qr label:first-child { margin-top: 0; }
.qr input[type="text"], .qr input[type="email"], .qr input[type="tel"], .qr input[type="url"],
.qr input[type="number"], .qr input[type="password"], .qr textarea, .qr select {
  width: 100%; font: inherit; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-deep); color: var(--text-primary);
}
.qr textarea { min-height: 88px; resize: vertical; }
.qr input:focus-visible, .qr textarea:focus-visible, .qr select:focus-visible, .qr button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qr .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qr .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .qr .row, .qr .row3 { grid-template-columns: 1fr; } }
.qr .check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 12px; }
.qr .check input { width: auto; }
.qr input[type="color"] { width: 100%; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-deep); }
.qr input[type="range"] { width: 100%; }
.qr input[type="file"] { width: 100%; font: inherit; color: var(--text-secondary); }
.qr .hint { font-size: .8rem; color: var(--text-secondary); margin: 4px 0 0; }

.qr details.opts { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.qr details.opts summary { cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--text-primary); }

.qr .preview { position: sticky; top: 92px; }
.qr .canvas-box {
  background: #ffffff; border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; overflow: hidden;
}
.qr .canvas-box canvas { max-width: 100%; max-height: 100%; width: 100%; height: auto; image-rendering: pixelated; display: block; }
.qr .canvas-box .empty { color: #6b7380; font-size: .9rem; text-align: center; padding: 20px; }
.qr .msg { margin-top: 12px; padding: 9px 11px; border-radius: 8px; font-size: .85rem; }
.qr .msg.warn { background: var(--qr-warn-bg); color: var(--qr-warn-text); }
.qr .msg.err { background: var(--qr-err-bg); color: var(--qr-err-text); }
.qr .msg[hidden] { display: none; }
.qr .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.qr .btn {
  font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--qr-accent-text);
}
.qr .btn.secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.qr .btn:disabled { opacity: .45; cursor: not-allowed; }
.qr .meta { margin-top: 10px; font-size: .8rem; color: var(--text-secondary); text-align: center; min-height: 1.2em; }

.qr .privacy { font-size: .85rem; color: var(--text-secondary); margin: 0 0 18px; }
.qr section.info { margin: 8px 0 36px; padding: 0; max-width: none; }
.qr section.info h2 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-primary); }
.qr section.info h3 { font-size: 1rem; margin: 18px 0 4px; color: var(--text-primary); }
.qr section.info p { margin: 0 0 8px; color: var(--text-secondary); max-width: 72ch; }

@media print { header, footer, .qr .actions, .qr .tabs { display: none; } }
