/* QR Code Generator — full-screen business posters */

.qr-app {
  max-width: min(1400px, 100%);
  margin: 0 auto;
}

.qr-app .tool-privacy {
  display: none;
}

.qr-hero {
  text-align: center;
  margin-bottom: 1rem;
}

.qr-hero-lead {
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
}

.qr-workspace--poster {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 380px);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .qr-workspace--poster {
    grid-template-columns: 1fr;
  }
  .qr-preview-card { order: -1; }
}

.qr-settings-card,
.qr-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.qr-settings-card {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100dvh - 5.5rem);
  overflow-y: auto;
}

@media (max-width: 960px) {
  .qr-settings-card {
    position: static;
    max-height: none;
  }
}

.qr-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.qr-preview-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.qr-preview-stage--poster {
  min-height: min(78dvh, 900px);
  height: min(78dvh, 900px);
  padding: 0.5rem;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #111;
  border-radius: calc(var(--radius) - 2px);
  position: relative;
  overflow: hidden;
  container-type: size;
}

.qr-app.is-poster-fs .qr-preview-stage--poster {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  padding: 1.25rem;
}

.qr-app.is-poster-fs .qr-preview-card {
  position: static;
}

.qr-poster {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  background: var(--poster-bg, #0f172a);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  container-type: size;
}

.qr-app.is-poster-fs .qr-poster {
  width: min(96vw, calc(94dvh * 0.75));
  max-height: 94dvh;
}

.qr-poster-scrim {
  display: none;
}

.qr-hero-lead {
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
}

.qr-poster-texts {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.qr-poster-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  margin: 0;
  padding: 0 0.35rem;
  line-height: 1.25;
  text-wrap: balance;
}

.qr-poster-line--headline {
  font-family: Georgia, "Times New Roman", serif;
}

.qr-poster-line--eyebrow {
  text-transform: uppercase;
}

/* Square QR panel — size set by JS; never stretch the code */
.qr-scene-slot {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem;
  box-shadow: none;
  border: 0;
  filter: none !important;
  animation: none !important;
  box-sizing: border-box;
}

.qr-poster-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.qr-poster-cat {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text);
}

.qr-poster-cat.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--bg));
  font-weight: 600;
}

.qr-poster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.qr-poster-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

.qr-poster-card.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.qr-poster-card-emoji { font-size: 1.15rem; }
.qr-poster-card-label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.qr-poster-card-tag { font-size: 0.68rem; color: var(--muted); line-height: 1.25; }

.qr-poster-fields .form-row { margin-bottom: 0.55rem; }

@keyframes qr-dino-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}


.qr-step {
  margin-bottom: 1.25rem;
}

.qr-step-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.qr-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.qr-region-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.qr-region-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.qr-region-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.qr-region-chip:hover {
  border-color: var(--primary);
}

.qr-region-chip.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  background: rgba(37, 99, 235, 0.04);
}

.qr-region-chip-emoji { font-size: 1.25rem; }
.qr-region-chip-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.qr-region-chip-hint { font-size: 0.7rem; color: var(--muted); }

.qr-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.qr-type-pill {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted);
}

.qr-type-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qr-demo-btn {
  margin-bottom: 0.65rem;
}

.qr-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.qr-theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.4rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  min-height: 96px;
  transition: border-color 0.15s, transform 0.15s;
}

.qr-theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.qr-theme-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.qr-theme-card-emoji { font-size: 1.5rem; line-height: 1; }
.qr-theme-card-label { font-size: 0.72rem; font-weight: 600; color: var(--text); text-align: center; }
.qr-theme-card-tag { font-size: 0.62rem; color: var(--muted); text-align: center; line-height: 1.2; }
.qr-theme-card-swatch {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.qr-mascot-picker {
  margin-bottom: 0.75rem;
}

.qr-mascot-picker-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.qr-mascot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qr-mascot-opt {
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-mascot-opt.is-active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.qr-eye-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qr-eye-chip {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--muted);
}

.qr-eye-chip.is-active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.qr-payload-details,
.qr-advanced {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.qr-payload-details summary,
.qr-advanced summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.qr-payload-preview {
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.72rem;
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: auto;
  color: var(--muted);
}

.qr-preview-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.qr-preview-stage {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  border-radius: calc(var(--radius) - 2px);
  position: relative;
  overflow: hidden;
  background: #0f172a;
  transition: background 0.3s, min-height 0.25s ease;
}

.qr-preview-stage--immersive {
  min-height: 0;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
}

@media (min-width: 901px) {
  .qr-workspace--immersive {
    grid-template-columns: minmax(0, 1fr) minmax(320px, min(480px, 42vw));
  }
}

.qr-scene-root {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.qr-scene-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.qr-scene-art svg,
.qr-scene-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-scene-3d-canvas {
  object-fit: cover;
}

.qr-scene-root--3d .qr-scene-slot {
  filter: none;
}

.qr-scene-root--3d.qr-scene-root--glow .qr-scene-slot {
  animation: none;
}

@keyframes qr-panel-glow-3d {
  0%, 100% { filter: none; }
  50% { filter: none; }
}

/* Legacy scene glow rules disabled — solid posters only */
.qr-scene-root--glow .qr-scene-slot,
.qr-scene-root[data-effect="neon-pulse"] .qr-scene-slot {
  animation: none;
  filter: none;
}

.qr-scene-root[data-effect="sparkle"] .qr-scene-art {
  animation: qr-scene-sparkle 4s ease-in-out infinite;
}

.qr-scene-root[data-effect="leaf-sway"] .qr-scene-art {
  animation: qr-leaf-sway 6s ease-in-out infinite;
}

.qr-scene-root[data-effect="wave"] .qr-scene-art {
  animation: qr-wave-drift 5s ease-in-out infinite;
}

.qr-scene-root[data-effect="petals"] .qr-scene-art {
  animation: qr-petal-drift 7s ease-in-out infinite;
}

@keyframes qr-panel-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.25)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 0, 234, 0.4)); }
}

@keyframes qr-scene-sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}

@keyframes qr-leaf-sway {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

@keyframes qr-wave-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

@keyframes qr-petal-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

.qr-scene-slot .qr-renderer-slots {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-scene-slot .qr-canvas-host,
.qr-scene-slot .qr-styled-host,
.qr-scene-slot .qr-animated-host {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-scene-slot canvas,
.qr-scene-slot svg {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.qr-preview-mascot-empty {
  position: relative;
  z-index: 3;
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.qr-preview-stage--immersive .qr-preview-mascot-empty {
  display: none;
}

/* Legacy flat stage tints removed — scenes own the backdrop */

.qr-empty-dino {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.35rem;
  animation: qr-dino-bob 2s ease-in-out infinite;
}

.qr-preview-mascot-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.qr-canvas-host {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* EasyQRCodeJS wrapper — exact square size set in JS (never stretch to 100% width) */
.qr-canvas-host > div,
.qr-animated-host > div {
  display: block !important;
  flex-shrink: 0;
  line-height: 0;
  margin: 0 auto;
}

.qr-canvas-host canvas,
.qr-canvas-host svg,
.qr-animated-host canvas {
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.qr-scene-slot .qr-canvas-host,
.qr-scene-slot .qr-styled-host,
.qr-scene-slot .qr-animated-host,
.qr-scene-slot .qr-renderer-slots {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-scene-slot .qr-canvas-host > div,
.qr-scene-slot .qr-animated-host > div {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 1 / 1;
  margin: 0 auto !important;
}

.qr-scene-slot .qr-canvas-host canvas,
.qr-scene-slot .qr-canvas-host svg,
.qr-scene-slot .qr-animated-host canvas,
.qr-scene-slot .qr-styled-host canvas {
  box-shadow: none;
  border-radius: 4px;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.qr-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.qr-embed-preview {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.qr-embed-panel .btn-primary {
  width: 100%;
}

[data-theme="dark"] .qr-embed-panel {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.qr-color-grid { display: grid; gap: 0.35rem; }

.qr-color-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.qr-swatch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.qr-swatch-label input[type="color"] {
  width: 2.25rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.qr-size-value {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.qr-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.qr-scan-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.qr-renderer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.qr-renderer-chip {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.qr-renderer-chip:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.qr-renderer-chip.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.qr-renderer-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.qr-renderer-hint,
.qr-theme-mode-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.qr-renderer-slots {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.qr-renderer-slots > [data-renderer] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.qr-renderer-slots > [data-renderer][hidden] {
  display: none !important;
}

.qr-preview-stage--immersive .qr-renderer-slots {
  min-height: 0;
}

.qr-styled-host,
.qr-animated-host {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.qr-styled-host canvas,
.qr-styled-host svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.qr-animated-host {
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}

/* ── Interactive QR animation keyframes ─────────────────────────── */
@keyframes qr-materialize-in {
  0%   { opacity: 0; transform: scale(0.55) rotate(-8deg); }
  70%  { opacity: 1; transform: scale(1.04) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes qr-fade-top-down {
  0%   { opacity: 0; clip-path: inset(0 0 100% 0 round 8px); }
  100% { opacity: 1; clip-path: inset(0 0 0% 0 round 8px); }
}

@keyframes qr-radial-ripple {
  0%   { opacity: 0; transform: scale(0.4); filter: blur(6px); }
  60%  { opacity: 1; transform: scale(1.07); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes qr-fade-center-out {
  0%   { opacity: 0; clip-path: circle(4% at 50% 50%); }
  10%  { opacity: 1; }
  100% { opacity: 1; clip-path: circle(75% at 50% 50%); }
}

@keyframes qr-radial-ripple-in {
  0%   { opacity: 0; transform: scale(0.2) rotate(180deg); }
  75%  { opacity: 1; transform: scale(1.04) rotate(-3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.qr-animated-host.qr-anim-running canvas {
  animation-duration: 0.85s;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.qr-animated-host.qr-anim-running[data-animation="MaterializeIn"] canvas {
  animation-name: qr-materialize-in;
}

.qr-animated-host.qr-anim-running[data-animation="FadeInTopDown"] canvas {
  animation-name: qr-fade-top-down;
  animation-timing-function: ease-out;
  animation-duration: 0.75s;
}

.qr-animated-host.qr-anim-running[data-animation="RadialRipple"] canvas {
  animation-name: qr-radial-ripple;
  animation-timing-function: ease-out;
  animation-duration: 0.9s;
}

.qr-animated-host.qr-anim-running[data-animation="FadeInCenterOut"] canvas {
  animation-name: qr-fade-center-out;
  animation-timing-function: ease-out;
  animation-duration: 0.8s;
}

.qr-animated-host.qr-anim-running[data-animation="RadialRippleIn"] canvas {
  animation-name: qr-radial-ripple-in;
  animation-duration: 1s;
}

.qr-pass-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.qr-pass-wrap input {
  flex: 1;
  min-width: 0;
}

.qr-pass-toggle {
  flex-shrink: 0;
}

.qr-settings-card textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.qr-settings-card input[type="range"] {
  width: calc(100% - 4.5rem);
  vertical-align: middle;
  accent-color: var(--primary);
}

[data-theme="dark"] .qr-region-chip.is-active,
[data-theme="dark"] .qr-theme-card.is-active {
  background: rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .qr-settings-card,
[data-theme="dark"] .qr-preview-card {
  background: var(--surface);
  border-color: var(--border);
}
