/* ── Escáner ─────────────────────────────────────────────── */
.escaner-container { padding-top: 2rem; }

/* Tarjeta inicial */
.scan-card { 
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center; 
  padding: 3rem 1.5rem; 
  gap: 0.5rem;
}
.scan-icon-wrap { margin-bottom: 1.5rem; display: flex; justify-content: center; }

.scan-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  color: var(--white); margin-bottom: .6rem;
}
.scan-desc {
  font-size: .9rem; color: var(--text-dim); line-height: 1.65;
  max-width: 320px; margin: 0 auto 2rem;
}

.btn-scan {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--red); color: #fff; border: none; border-radius: 12px;
  padding: .85rem 2.5rem;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 0 24px rgba(203,21,23,.4); 
  margin-top: 1rem;
}
.btn-scan:hover { background: #e01a1c; transform: scale(1.03); }
.btn-scan:active { transform: scale(.97); }

.scan-tip { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }

.btn-upload {
  display: inline-block; padding: .5rem 1.2rem; border-radius: 8px;
  border: 1.5px solid var(--border); background: transparent;
  font-family: 'Barlow Condensed', sans-serif; font-size: .88rem; font-weight: 700;
  letter-spacing: .04em; color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.btn-upload:hover { border-color: var(--muted); color: var(--text); }

/* Vista de cámara */
.scanner-view { 
  display: none; 
  flex-direction: column; 
  align-items: center; 
  text-align: center; 
  padding: 1.5rem 0; 
  gap: 1.5rem;
}
.scanner-frame {
  position: relative;
  width: min(320px, 90vw); height: min(320px, 90vw);
  border-radius: 20px; overflow: hidden;
  background: #000;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
#scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Marco QR animado */
.scanner-crosshair { position: absolute; inset: 20px; }
.crosshair-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--red); border-style: solid;
}
.crosshair-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.crosshair-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.crosshair-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.crosshair-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

/* Línea de escaneo animada */
.scanner-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: scanLine 2s ease-in-out infinite;
  top: 0;
}
@keyframes scanLine {
  0%   { top: 0; opacity: 1; }
  50%  { top: calc(100% - 2px); opacity: 1; }
  100% { top: 0; opacity: 1; }
}

.scanner-hint { font-size: .82rem; color: var(--text-dim); margin-bottom: 1rem; }
.btn-cancel-scan {
  padding: .55rem 1.5rem; border-radius: 8px;
  border: 1.5px solid var(--border); background: transparent;
  font-family: 'Barlow Condensed', sans-serif; font-size: .95rem; font-weight: 700;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.btn-cancel-scan:hover { border-color: var(--fail); color: var(--fail); }

/* Resultado */
.scan-result { text-align: center; padding: 2rem 1.5rem; }
.result-icon { font-size: 3.5rem; display: block; margin-bottom: .75rem; }
.result-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .4rem; color: var(--white);
}
.result-desc { font-size: .88rem; color: var(--text-dim); margin-bottom: 1.2rem; line-height: 1.6; }

.result-raw {
  text-align: left; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem; font-size: .72rem; color: var(--text-dim);
  overflow-x: auto; white-space: pre; margin-bottom: 1.2rem; max-height: 200px; overflow-y: auto;
}
.result-signos { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-bottom: 1.2rem; }
.signo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--red-soft); border: 1px solid rgba(203,21,23,.3);
  font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 800; color: var(--red);
}

.result-actions { margin-top: 1.5rem; }
.btn-scan-again {
  padding: .65rem 1.8rem; border-radius: 10px;
  border: 1.5px solid var(--border); background: transparent;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); cursor: pointer;
  transition: all .15s;
}
.btn-scan-again:hover { border-color: var(--red); color: var(--red); }

/* ── Hint genérico ──────────────────────────────────────── */
.scan-hint-generic {
  font-size: .85rem; 
  color: var(--text-dim); 
  margin-top: 2rem;
  padding: 0.7rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.4;
  max-width: 90%;
  animation: fadeIn 0.8s ease;
}
.scan-hint-generic span { font-size: 1.1rem; filter: drop-shadow(0 0 5px rgba(255,215,0,0.3)); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Resultado QR genérico ──────────────────────────────── */
.qr-generic-result {
  margin: 1.5rem 0;
  text-align: center;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: resultEntry 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultEntry {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.qr-type-badge {
  margin-bottom: 1.2rem;
}
.qr-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1.4rem; border-radius: 30px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--badge-color, var(--red));
  box-shadow: 0 4px 15px color-mix(in srgb, var(--badge-color, var(--red)) 40%, transparent);
  animation: badgePop .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes badgePop {
  0% { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.qr-type-desc {
  font-size: .95rem; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 1rem;
}
.qr-type-desc strong { color: var(--white); font-weight: 800; }
.qr-type-desc code {
  background: rgba(255,255,255,.1); padding: .2em .5em;
  border-radius: 6px; font-size: .85em; color: var(--red);
  font-family: 'JetBrains Mono', monospace;
}

.qr-content-box {
  text-align: left;
}

.qr-raw-content {
  margin-top: .8rem; 
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px; padding: 1rem;
  position: relative;
  overflow: hidden;
}
.qr-raw-content::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  pointer-events: none;
}

.qr-raw-label {
  display: block; font-size: .75rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .1em;
  font-weight: 800; margin-bottom: .6rem;
  font-family: 'Barlow Condensed', sans-serif;
  opacity: 0.6;
}
.qr-raw-pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .8rem; color: var(--white);
  white-space: pre-wrap; word-break: break-all;
  margin: 0; max-height: 140px; overflow-y: auto;
  line-height: 1.6;
  scrollbar-width: thin;
}

/* ── Botones de acción QR ───────────────────────────────── */
.qr-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: center; margin-top: 1.5rem;
}
.qr-action-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .95rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: var(--text);
  transition: all .25s ease; text-decoration: none;
}
.qr-action-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.qr-action-primary {
  background: var(--red); color: #fff !important;
  border-color: var(--red);
  box-shadow: 0 4px 15px rgba(203,21,23,.3);
}
.qr-action-primary:hover {
  background: #e01a1c; 
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 22px rgba(203,21,23,.45);
}

.qr-action-copied {
  background: var(--ok) !important; border-color: var(--ok) !important;
  color: #fff !important;
}

/* ── Result-data para quiniela ──────────────────────────── */
.result-data {
  word-break: break-all; padding: 10px; border-radius: 8px;
  font-family: monospace; background: rgba(0,0,0,0.05);
}
