/* QR tools. Builds on style.css and pdf.css (dropzone, status, steps, privacy note). */

.qr-tool [hidden], .qr-card-panel [hidden] { display: none !important; }

input[type="text"], input[type="url"], input[type="tel"], textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 46px;
}
textarea { resize: vertical; line-height: 1.5; }
input[type="url"], input[type="tel"] { text-align: left; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="file"] { font: inherit; font-size: 15px; max-width: 100%; }
.field:first-child, .qr-form > .calendar-choice:first-child { margin-top: 0; }
.field small.hint { display: block; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.phone-row .field, .two-cols .field { margin-top: 0; }
.phone-row, .two-cols { margin-top: 16px; row-gap: 16px; }
.qr-form > .phone-row:first-child, .qr-form > .two-cols:first-child { margin-top: 0; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); column-gap: 8px; }
.qr-form > .copy, .qr-form [data-calc-vat], .qr-form [data-vcf] { margin-top: 12px; }
.qr-form .copy:disabled { opacity: 0.4; cursor: default; }
.notice { margin: 0 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 15px; }
input[type="email"], input[type="datetime-local"] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 46px;
}
input[type="email"] { text-align: left; }

.ean-preview { margin: 0 auto; min-height: 120px; display: grid; place-items: center; padding: 16px; border-radius: 12px; background: #fff; }
.ean-preview svg { width: min(100%, 340px); height: auto; }
.ean-preview .qr-empty { color: #6e6e73; }

.link-check, .qr-check { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.link-check:empty, .qr-check:empty { display: none; }
.is-ok { color: var(--accent); }
.is-warn { color: var(--warn); }
.is-error { color: var(--error); }
.link-check.is-warn, .link-check.is-error, .link-check.is-note { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.link-check.is-warn { background: var(--warn-soft); }

.link-out { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.link-out span { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.link-out a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.link-out[hidden] { display: none; }

.qr-design { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.qr-design summary { cursor: pointer; font-weight: 600; }
.color-row { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.color-field { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.color-field input { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
[data-remove-logo] { margin-top: 8px; }

.qr-output { margin-top: 20px; text-align: center; }
.qr-preview {
  margin: 0 auto;
  width: min(100%, 280px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bg);
}
.qr-preview canvas { width: 100%; height: 100%; border-radius: 12px; image-rendering: pixelated; }
.qr-empty { color: var(--muted); font-size: 15px; padding: 16px; }
.qr-check { text-align: center; }

.qr-downloads { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.download-button {
  min-width: 88px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.download-button:disabled { opacity: 0.35; cursor: default; }
.download-button:not(:disabled):hover { filter: brightness(1.05); }

.promises { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.promises li { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.promises li::before { content: "✓ "; }

.qr-card-panel .card-canvas { display: block; width: min(100%, 320px); height: auto; margin: 16px auto 0; border-radius: 8px; box-shadow: 0 1px 6px rgb(0 0 0 / 0.15); }
.qr-card-panel .card-canvas[hidden] { display: none; }

.prose h2 + .steps, .prose .steps { margin-bottom: 12px; }
.prose h2:not(:first-child) { margin-top: 20px; }

/* Reader */
.paste-text { margin-top: 12px; }
.paste-text summary { cursor: pointer; color: var(--accent); }
.paste-text textarea { margin-top: 8px; }
.paste-text .copy { margin-top: 8px; }
.scan-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.scan-result { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.scan-result .rows { background: none; margin: 8px 0; }
.scan-result .rows li > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0; }
.scan-result h3 { font-size: 15px; margin: 12px 0 0; color: var(--muted); }
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-source { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-value { overflow-wrap: anywhere; }
.scan-host { margin: 8px 0; font-weight: 600; overflow-wrap: anywhere; }
.check-note { font-size: 14px; color: var(--muted); }
.check-note.is-ok { color: var(--accent); }
.check-note.is-warn { color: var(--warn); }
.check-note.is-error { color: var(--error); }
.raw { color: var(--muted); }
.scan-raw { margin: 8px 0; }
.scan-raw summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.scan-raw .code { margin-top: 8px; background: var(--surface); }
.disclaimer { font-size: 14px; color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 10px; }
.scan-result a.copy { display: inline-block; margin-inline-end: 8px; }

.qr-print-sheet { display: none; }
@media print {
  @page { size: A5; margin: 0; }
  body.is-printing > :not(.qr-print-sheet) { display: none !important; }
  body.is-printing { background: #fff; }
  body.is-printing .qr-print-sheet { display: block; width: 148mm; height: 210mm; margin: 0 auto; }
}
