/* QR Code Generator — tool styles (page shell comes from ../assets/css/tools.css).
   Ported from URQR's qr-generator.css onto the AJ TechSoft free-tools palette. */

.qrg-layout {
  --qrg-brand: var(--tl-navy);
  --qrg-accent: var(--tl-cyan-600);
  --qrg-ink: var(--tl-ink);
  --qrg-muted: var(--tl-muted);
  --qrg-line: var(--tl-line);
  --qrg-soft: var(--tl-soft);
  --qrg-ok: #138a48;
  --qrg-warn: #b06a00;
  --qrg-bad: #c0392b;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
  scroll-margin-top: 90px;
}
.qrg-builder { display: grid; gap: 22px; min-width: 0; }

.qrg-card { background: #fff; border: 1px solid var(--qrg-line); border-radius: 20px; padding: 24px; min-width: 0; box-shadow: var(--tl-shadow); }
.qrg-sticky { position: sticky; top: 92px; }

.qrg-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.qrg-card-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--qrg-ink); letter-spacing: -.01em; }
.qrg-card-head p { margin: 3px 0 0; color: var(--qrg-muted); font-size: 0.92rem; }
.qrg-step { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tl-cyan-600), var(--tl-navy)); color: #fff; font-weight: 800; }

/* ---------- content types ---------- */
.qrg-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.qrg-type { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 11px 6px; border: 1.5px solid var(--qrg-line); border-radius: 14px;
  background: #fff; color: var(--qrg-muted); font: 600 0.82rem/1.2 var(--tl-font); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.qrg-type:hover { border-color: #c9d4e6; color: var(--qrg-ink); }
.qrg-type.is-active { border-color: var(--qrg-brand); background: #eef3fb; color: var(--qrg-brand); }

.qrg-form { display: none; }
.qrg-form.is-active { display: block; }

/* ---------- fields ---------- */
.qrg-field { display: block; margin: 0 0 14px; }
.qrg-field > span { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; font-weight: 700; color: var(--qrg-ink); margin-bottom: 6px; }
.qrg-input { width: 100%; border: 1px solid #d4dce8; border-radius: 10px; padding: 11px 12px; font: 400 0.95rem/1.4 var(--tl-font); color: var(--qrg-ink);
  background: #fbfcfe; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea.qrg-input { resize: vertical; min-height: 80px; }
select.qrg-input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--qrg-muted) 50%), linear-gradient(135deg, var(--qrg-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.qrg-input:focus { border-color: var(--qrg-accent); background: #fff; box-shadow: 0 0 0 4px rgba(56, 184, 208, .18); }

.qrg-color { width: 100%; height: 44px; border: 1px solid #d4dce8; border-radius: 10px; padding: 4px; background: #fff; cursor: pointer; }
.qrg-layout input[type=range] { width: 100%; accent-color: var(--qrg-brand); cursor: pointer; }
.qrg-field output { color: var(--qrg-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.qrg-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.qrg-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }

.qrg-check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--qrg-ink); font-weight: 500; margin: 4px 0 12px; cursor: pointer; }
.qrg-check input { width: 17px; height: 17px; accent-color: var(--qrg-brand); }
.qrg-check-inline { align-self: end; margin-bottom: 26px; }

.qrg-hint { margin: -4px 0 0; font-size: 0.84rem; color: var(--qrg-muted); }
.qrg-or { text-align: center; color: var(--qrg-muted); font-size: 0.82rem; margin: -2px 0 10px; }
.qrg-sub { padding: 12px 14px 2px; margin: -4px 0 14px; border-radius: 14px; background: var(--qrg-soft); }

.qrg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 0; border-radius: 999px;
  background: var(--tl-cyan-50); color: var(--tl-cyan-700); font: 600 0.85rem/1 var(--tl-font); cursor: pointer; text-decoration: none; }
.qrg-chip:hover { background: #d3f0f5; color: var(--tl-navy); }

/* ---------- design ---------- */
.qrg-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-bottom: 18px; }
.qrg-template { border: 2px solid transparent; border-radius: 16px; padding: 6px 6px 8px; background: var(--qrg-soft); cursor: pointer; text-align: center;
  font: 600 0.78rem/1.2 var(--tl-font); color: var(--qrg-muted); }
.qrg-template img { width: 100%; aspect-ratio: 1; border-radius: 10px; display: block; margin-bottom: 5px; background: #fff; }
.qrg-template:hover { border-color: #c9d4e6; }
.qrg-template.is-active { border-color: var(--qrg-brand); color: var(--qrg-brand); }

.qrg-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: var(--qrg-soft); overflow-x: auto; }
.qrg-tab { flex: 1 0 auto; border: 0; background: none; padding: 9px 12px; border-radius: 10px; color: var(--qrg-muted); font: 600 0.88rem/1 var(--tl-font); cursor: pointer; }
.qrg-tab.is-active { background: #fff; color: var(--qrg-brand); box-shadow: 0 2px 8px rgba(13, 27, 51, 0.12); }

.qrg-panel { display: none; }
.qrg-panel.is-active { display: block; }

.qrg-label { font-size: 0.78rem; font-weight: 700; color: var(--qrg-muted); margin: 2px 0 8px; text-transform: uppercase; letter-spacing: .05em; }

.qrg-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.qrg-swatches button { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; border: 1.5px solid var(--qrg-line); border-radius: 12px;
  background: #fff; padding: 8px 12px; font: 600 0.84rem/1.2 var(--tl-font); color: var(--qrg-muted); cursor: pointer; }
.qrg-swatches button:hover { border-color: #c9d4e6; color: var(--qrg-ink); }
.qrg-swatches button.is-active { border-color: var(--qrg-brand); color: var(--qrg-brand); background: #eef3fb; }

/* frame thumbnails */
.qrg-fr { display: block; width: 46px; height: 56px; position: relative; border-radius: 6px; }
.qrg-fr::before { content: ""; position: absolute; left: 9px; top: 6px; width: 28px; height: 28px; border-radius: 3px;
  background: repeating-conic-gradient(#0d1b33 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.qrg-fr-none::before { top: 14px; }
.qrg-fr-caption { border: 2px solid #0d1b33; }
.qrg-fr-caption::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 7px; height: 5px; border-radius: 3px; background: #0d1b33; }
.qrg-fr-banner { border: 3px solid var(--qrg-brand); }
.qrg-fr-banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 13px; background: var(--qrg-brand); }
.qrg-fr-pill::before { top: 4px; }
.qrg-fr-pill::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 6px; height: 12px; border-radius: 999px; background: var(--qrg-brand); }
.qrg-fr-top { border: 3px solid var(--qrg-brand); }
.qrg-fr-top::before { top: 19px; }
.qrg-fr-top::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 13px; background: var(--qrg-brand); }

.qrg-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.qrg-quick button { border: 1px solid var(--qrg-line); background: #fff; border-radius: 999px; padding: 5px 11px; font: 600 0.76rem/1 var(--tl-font); color: var(--qrg-muted); cursor: pointer; }
.qrg-quick button:hover { border-color: var(--qrg-brand); color: var(--qrg-brand); }

.qrg-logos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.qrg-logos > button, .qrg-upload { position: relative; width: 54px; height: 54px; border-radius: 14px; border: 1.5px solid var(--qrg-line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: var(--qrg-muted); cursor: pointer; padding: 0; margin: 0; overflow: hidden; }
.qrg-logos > button img { width: 34px; height: 34px; object-fit: contain; }
.qrg-logos > button.is-active, .qrg-upload.is-active { border: 2px solid var(--qrg-brand); color: var(--qrg-brand); }
.qrg-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.qrg-saved { border-top: 1px solid var(--qrg-line); margin-top: 6px; padding-top: 16px; }
.qrg-saved-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.qrg-saved-list:empty::before { content: "Nothing saved yet."; color: var(--qrg-muted); font-size: 0.86rem; }
.qrg-saved-item { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--qrg-line); border-radius: 999px; padding: 2px 4px 2px 12px; background: #fff; }
.qrg-saved-item button { border: 0; background: none; cursor: pointer; color: var(--qrg-ink); font: 600 0.86rem/1 var(--tl-font); padding: 4px 2px; }
.qrg-saved-item button.qrg-del { color: var(--qrg-muted); display: inline-flex; padding: 3px; }
.qrg-saved-item button.qrg-del:hover { color: var(--qrg-bad); }

/* ---------- preview ---------- */
.qrg-stage { position: relative; border-radius: 16px; padding: 18px; min-height: 300px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(45deg, #eef2f8 25%, transparent 25%, transparent 75%, #eef2f8 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, #eef2f8 25%, transparent 25%, transparent 75%, #eef2f8 75%) 10px 10px / 20px 20px, #f9fbfe; }
.qrg-stage canvas { display: block; max-width: 100%; height: auto; max-height: 420px; filter: drop-shadow(0 10px 24px rgba(13, 27, 51, 0.16)); }
.qrg-stage.is-empty canvas { display: none; }
.qrg-placeholder { display: none; text-align: center; color: var(--qrg-muted); }
.qrg-placeholder iconify-icon { color: #b9c6da; }
.qrg-placeholder p { margin: 4px 0 0; }
.qrg-stage.is-empty .qrg-placeholder { display: block; }

.qrg-checks { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 6px; }
.qrg-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.86rem; line-height: 1.45; }
.qrg-checks iconify-icon { flex: none; margin-top: 1px; }
.qrg-checks .ok iconify-icon { color: var(--qrg-ok); }
.qrg-checks .warn iconify-icon { color: var(--qrg-warn); }
.qrg-checks .bad iconify-icon { color: var(--qrg-bad); }

.qrg-download { margin-top: 14px; display: grid; gap: 10px; }
.qrg-size { margin-bottom: 0; }
.qrg-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.qrg-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid #d4dce8; background: #fff; color: var(--qrg-ink); font: 700 0.9rem/1 var(--tl-font); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.qrg-btn:hover { border-color: var(--qrg-brand); color: var(--qrg-brand); }
.qrg-btn-primary { background: var(--tl-navy); color: #fff; border-color: var(--tl-navy); }
.qrg-btn-primary:hover { background: var(--tl-navy-800); border-color: var(--tl-navy-800); color: #fff; }
.qrg-btn-ghost { background: var(--qrg-soft); border-color: transparent; }
.qrg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.qrg-print-layout { flex: 1 1 120px; width: auto; }

.qrg-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--tl-ink); color: #fff; padding: 10px 18px; border-radius: 12px;
  font: 600 0.9rem/1.3 var(--tl-font); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2000; }
.qrg-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- features ---------- */
.qrg-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.qrg-features > div { background: #fff; border: 1px solid var(--tl-line); border-radius: 16px; padding: 22px; box-shadow: var(--tl-shadow-sm); }
.qrg-features iconify-icon { color: #fff; background: var(--tl-navy); border-radius: 12px; padding: 10px; }
.qrg-features h3 { margin: 14px 0 6px; font-size: 16.5px; color: var(--tl-ink); }
.qrg-features p { margin: 0; font-size: 14.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .qrg-layout { grid-template-columns: 1fr; }
  /* one column: content first, then the preview, then design — so the preview sits right under what you type */
  .qrg-builder { display: contents; }
  .qrg-builder > :first-child { order: 1; }
  .qrg-preview { order: 2; }
  .qrg-builder > :last-child { order: 3; }
  .qrg-sticky { position: static; }
  .qrg-stage canvas { max-height: 320px; }
  .qrg-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .qrg-card { padding: 18px 16px 20px; border-radius: 16px; }
  .qrg-grid2, .qrg-grid3 { grid-template-columns: 1fr; }
  .qrg-types { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .qrg-type { padding: 9px 2px; font-size: 0.68rem; border-radius: 12px; }
  .qrg-check-inline { margin-bottom: 12px; }
  .qrg-features { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .qrg-type { font-size: 0.6rem; padding: 8px 1px; letter-spacing: -.01em; }
}
