/* Generador de códigos QR (prefijo qr-). Usa las piezas tl- de mm-tools.css. */
.qr fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.qr [hidden] { display: none !important; }

/* Tipos */
.qr-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
.qr-type { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 56px; padding: 14px; border: 0; border-radius: 16px; font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
  color: var(--paper-dim); background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s, color .2s, transform .2s cubic-bezier(.16,1,.3,1); }
.qr-type:hover { color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.qr-type:active { transform: scale(.97); }
.qr-type[aria-pressed="true"] { color: var(--paper); background: linear-gradient(135deg, rgba(240,54,225,.1), rgba(145,73,255,.1)); box-shadow: inset 0 0 0 1.5px #f036e1; }
.qr-type[aria-pressed="true"] svg { color: var(--tl-acc); }
@media (max-width: 560px) {
  .qr-types { gap: 6px; }
  .qr-type { flex-direction: column; align-items: flex-start; min-height: 68px; padding: 11px 10px; gap: 8px; font-size: 12.5px; }
}

.qr-panel { display: grid; gap: 18px; animation: tlIn .4s cubic-bezier(.16,1,.3,1) both; }
.qr-panel .tl-note { display: flex; gap: 8px; align-items: flex-start; }
.qr-panel .tl-note svg { flex-shrink: 0; margin-top: 2px; color: var(--tl-warn); }
.qr-phone { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: start; }
.qr-phone + .help { margin-top: -10px; font-size: 12px; color: var(--paper-faint); }
.qr-pass { position: relative; }
.qr-pass .pg-input { padding-right: 56px; }
.qr-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--paper-dim); cursor: pointer; border-radius: 12px; }
.qr-eye:hover { color: var(--paper); }
.qr-eye svg:last-child, .qr-eye[aria-pressed="true"] svg:first-child { display: none; }
.qr-eye[aria-pressed="true"] svg:last-child { display: block; }
.qr .tl-seg.full button { padding: 0 10px; }
@media (max-width: 420px) { .qr [data-seg="sec"] { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } .qr [data-seg="sec"] button:first-child { grid-column: 1 / -1; } }

.qr-short { padding-top: 4px; }
.qr-short-body { display: grid; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--line); margin-top: 6px; }
.qr-short-body .tl-note a { color: var(--paper); text-underline-offset: 3px; }
.qr-short-out { font-size: 13px; color: var(--tl-acc); word-break: break-all; }

/* Rejilla: contenido y diseño a la izquierda, vista previa fija a la derecha;
   en móvil la vista previa queda justo después del contenido. */
.qr-grid { grid-template-areas: "main out" "design out"; grid-template-rows: auto 1fr; }
.qr-main { grid-area: main; }
.qr-out { grid-area: out; align-self: start; }
.qr-design { grid-area: design; align-self: start; }
@media (max-width: 1040px) { .qr-grid { grid-template-areas: "main" "out" "design"; grid-template-rows: auto; } }

/* Diseño */
.qr-design { display: grid; gap: 20px; }
.qr-design > .tl-h { margin: 0; }
.qr-color { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
.qr-color input[type="color"] { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.qr-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.qr-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 10px; }
.qr-color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 10px; }
.qr-color.bad .pg-input { box-shadow: inset 0 0 0 1px #ff7a8a; }
#q-contrast:empty { display: none; }
.qr .pg-range { height: 44px; margin: 0; }
.qr-logo { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qr-logo-btn { cursor: pointer; }
.qr-logo-btn:has(+ input:focus-visible) { outline: 2px solid #f036e1; outline-offset: 2px; }
#q-logo-opts { display: grid; gap: 4px; margin-top: 10px; }
.qr-logo-s-l { font-size: 13px; font-weight: 500; color: var(--paper); display: flex; justify-content: space-between; gap: 8px; }
.qr-logo-s-l small { font-weight: 400; font-size: 12px; color: var(--paper-faint); }
.qr-logo-f .pg-label small { font-weight: 400; font-size: 12px; color: var(--paper-faint); margin-left: 6px; }

/* Vista previa */
.qr-out { display: grid; gap: 18px; }
.qr-stage { display: grid; place-items: center; padding: 22px; border-radius: 22px; background: repeating-conic-gradient(rgba(var(--glass-tint), .045) 0 25%, transparent 0 50%) 0 0 / 18px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.qr-preview { width: min(100%, 300px); aspect-ratio: 1; display: grid; place-items: center; filter: drop-shadow(0 18px 30px rgba(0,0,0,.28)); transition: opacity .3s; }
.qr-preview svg { display: block; width: 100%; height: 100%; border-radius: 6px; }
.qr-preview.is-example { opacity: .9; }
#q-msg { display: grid; gap: 10px; }
#q-msg:empty { display: none; }
.qr-kpis dd small { font-size: 12px; }
.qr-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.qr-dl .btn { justify-content: center; min-height: 50px; gap: 8px; }
.qr-dl .tl-btn { min-height: 50px; padding: 0 20px; }
.qr-dl button[disabled] { opacity: .45; pointer-events: none; }
.qr-raw summary { cursor: pointer; font-size: 13px; color: var(--paper-dim); min-height: 44px; display: flex; align-items: center; }
.qr-raw summary:hover { color: var(--paper); }
.qr-raw .tl-code { max-height: 200px; font-size: 12px; }
.qr-tips li { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .qr-panel { animation: none; } }
