/* Evento 106 · escáner de la puerta. Pensado para el celular, a una mano.
   Mismo diseño que la landing 1.2: fondo #141414, tarjetas #1f1f1f de radio 20 sin borde,
   campos de 52 px, botones de 50 px en Rigid Square y el naranja de la marca.
   Los resultados van en tarjetas de color pleno (verde, ámbar, rojo) para leerlos de lejos. */
:root {
  --s-bg: #141414;
  --s-panel: #1f1f1f;
  --s-panel-2: #262626;
  --s-input: #141414;
  --s-line: #2a2a2a;
  --s-line-2: #3a3a3c;
  --s-text: #f2f2f2;
  --s-soft: #d6d6d8;
  --s-mute: #b4b4b6;
  --s-mute-2: #8a8a8c;
  --s-orange: #ff5d05;
  --s-green: #00c363;
  --s-green-ink: #06140c;
  --s-amber: #e8b400;
  --s-amber-ink: #241c04;
  --s-red: #e5383b;
  --s-display: rigid-square, "Montserrat", system-ui, sans-serif;
  --s-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --s-pad: 15px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.tbxe-sc { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--s-bg); color: var(--s-text); font: 500 16px/1.45 var(--s-body); -webkit-font-smoothing: antialiased; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--s-orange); outline-offset: 2px; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }

/* Botones */
.tbxe-sc__btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--s-orange); color: #fff; font-family: var(--s-display); font-weight: 600; font-size: 18px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.tbxe-sc__btn:hover { background: #ff6d1f; }
.tbxe-sc__btn:active { transform: translateY(1px); }
.tbxe-sc__btn[disabled] { opacity: .7; }
.tbxe-spin { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: tbxe-gira .7s linear infinite; }
.is-cargando .tbxe-spin { display: inline-block; }
@keyframes tbxe-gira { to { transform: rotate(360deg); } }
.tbxe-sc__link { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--s-line-2); background: transparent; color: var(--s-text); font-weight: 600; font-size: 15px; cursor: pointer; }
.tbxe-sc__link:hover { border-color: #555; background: rgba(255,255,255,.03); }
.tbxe-sc__salir { flex: none; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--s-line-2); background: transparent; color: var(--s-soft); font-weight: 600; font-size: 13px; cursor: pointer; }
.tbxe-sc__salir:hover { border-color: #555; color: #fff; }
.tbxe-sc__msg { padding: 12px 14px; border-radius: 10px; background: rgba(255,77,77,.1); border: 1px solid rgba(255,77,77,.5); color: #ffc9c9; font-size: 14px; line-height: 1.5; }
.tbxe-sc__nota { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--s-mute-2); text-align: center; }

/* Campos */
.tbxe-sc__login label, .tbxe-sc__manual label { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--s-soft); }
.tbxe-sc__login input, .tbxe-sc__manual input { width: 100%; height: 52px; margin: 0; padding: 0 15px; border-radius: 12px; border: 1px solid var(--s-line-2); background: var(--s-input); color: var(--s-text); font: 400 16px/1.2 var(--s-body); -webkit-appearance: none; appearance: none; transition: border-color .15s ease, box-shadow .15s ease; }
.tbxe-sc__login input::placeholder, .tbxe-sc__manual input::placeholder { color: #7a7a7c; opacity: 1; }
.tbxe-sc__login input:focus, .tbxe-sc__manual input:focus { outline: none; border-color: var(--s-orange); box-shadow: 0 0 0 3px rgba(255,93,5,.22); }
#tbxe-pin { height: 60px; padding: 0 15px 0 calc(15px + .45em); font-family: var(--s-display); font-weight: 600; font-size: 28px; letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; }
#tbxe-pin::placeholder { color: #4a4a4c; }
.tbxe-sc__manual input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 18px no-repeat; }
.tbxe-sc__oculto { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Entrada con código: foto de portada arriba, como la landing */
.tbxe-sc__hero { position: relative; height: 300px; overflow: hidden; background: var(--s-panel); }
.tbxe-sc__hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 42% 55%; }
.tbxe-sc__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,20,.6) 0%, rgba(20,20,20,.05) 30%, rgba(20,20,20,.35) 58%, var(--s-bg) 100%); }
.tbxe-sc__hero-in { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; height: 100%; max-width: 460px; margin: 0 auto; padding: max(15px, env(safe-area-inset-top)) 20px 4px; }
.tbxe-sc__logo { display: block; width: 62px; height: 40px; }
.tbxe-sc__badge { display: inline-flex; padding: 6px 10px; border-radius: 6px; background: var(--s-orange); color: var(--s-bg); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tbxe-sc__h1 { margin: 14px 0 0; font-family: var(--s-display); font-weight: 600; font-size: 44px; line-height: .98; letter-spacing: -.015em; color: #fff; }
.tbxe-sc__login { display: flex; flex-direction: column; width: 100%; max-width: 460px; margin: 0 auto; padding: 0 var(--s-pad) max(24px, env(safe-area-inset-bottom)); }
.tbxe-sc__lead { margin: 12px 5px 0; font-size: 15px; line-height: 1.5; color: var(--s-soft); }
.tbxe-sc__card { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; padding: 20px; border-radius: 20px; background: var(--s-panel); }
.tbxe-sc__card label + input { margin-bottom: 10px; }
.tbxe-sc__card .tbxe-sc__btn { margin-top: 10px; }
.tbxe-sc__card .tbxe-sc__msg { margin-top: 10px; }

/* Escáner */
.tbxe-sc__app { display: flex; flex-direction: column; width: 100%; max-width: 520px; min-height: 100dvh; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) var(--s-pad) max(16px, env(safe-area-inset-bottom)); }
.tbxe-sc__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.tbxe-sc__marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbxe-sc__marca img { flex: none; width: 47px; height: 30px; }
.tbxe-sc__t { font-family: var(--s-display); font-weight: 600; font-size: 20px; line-height: 1.1; color: #fff; }

.tbxe-sc__cam { position: relative; flex: 1 1 auto; min-height: 240px; max-height: 46dvh; margin-top: 10px; border-radius: 20px; overflow: hidden; background: var(--s-panel); }
.tbxe-sc__cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tbxe-sc__marco { position: absolute; left: 50%; top: 50%; width: min(62%, 210px); aspect-ratio: 1; transform: translate(-50%, -54%); }
.tbxe-sc__marco i { position: absolute; width: 34px; height: 34px; border: 0 solid var(--s-orange); }
.tbxe-sc__marco i:nth-child(1) { left: 0; top: 0; border-left-width: 4px; border-top-width: 4px; border-top-left-radius: 10px; }
.tbxe-sc__marco i:nth-child(2) { right: 0; top: 0; border-right-width: 4px; border-top-width: 4px; border-top-right-radius: 10px; }
.tbxe-sc__marco i:nth-child(3) { left: 0; bottom: 0; border-left-width: 4px; border-bottom-width: 4px; border-bottom-left-radius: 10px; }
.tbxe-sc__marco i:nth-child(4) { right: 0; bottom: 0; border-right-width: 4px; border-bottom-width: 4px; border-bottom-right-radius: 10px; }
.tbxe-sc__cam.is-pausa video { filter: brightness(.35) blur(2px); }
.tbxe-sc__cam.is-pausa .tbxe-sc__marco { opacity: .35; }
.tbxe-sc__cam[data-estado] { cursor: pointer; }
/* Leyendo: una línea recorre el marco. Con un resultado en pantalla, la cámara queda quieta y sin el cartel. */
.tbxe-sc__marco::after { content: ""; position: absolute; left: 8%; right: 8%; top: 10%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,93,5,0), var(--s-orange) 30%, var(--s-orange) 70%, rgba(255,93,5,0)); box-shadow: 0 0 14px 2px rgba(255,93,5,.5); opacity: 0; transition: opacity .2s ease; }
.tbxe-sc__cam.is-vivo:not(.is-pausa) .tbxe-sc__marco::after { opacity: 1; }
.tbxe-sc__cam.is-pausa .tbxe-sc__cam-txt { opacity: 0; }
@keyframes tbxe-laser { from { top: 10%; } to { top: 88%; } }
@keyframes tbxe-sc-pop { from { opacity: .4; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .tbxe-sc__cam.is-vivo:not(.is-pausa) .tbxe-sc__marco::after { animation: tbxe-laser 1.8s ease-in-out infinite alternate; }
  .tbxe-sc__res.is-pop { animation: tbxe-sc-pop .28s cubic-bezier(.2,.9,.3,1.15); }
}
.tbxe-sc__cam-txt { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(20,20,20,.62); text-align: center; font-size: 13px; font-weight: 600; color: #f2f2f2; white-space: nowrap; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tbxe-sc__activar { position: absolute; left: 50%; top: 50%; width: auto; transform: translate(-50%, -50%); padding: 0 22px; }
.tbxe-sc__cam[data-estado="ok"] .tbxe-sc__marco i { border-color: var(--s-green); }
.tbxe-sc__cam[data-estado="ya"] .tbxe-sc__marco i { border-color: var(--s-amber); }
.tbxe-sc__cam[data-estado="no"] .tbxe-sc__marco i { border-color: var(--s-red); }

/* Resultado: tarjeta de color pleno */
.tbxe-sc__res { margin-top: 10px; padding: 18px 20px 20px; border-radius: 20px; background: var(--s-panel); }
.tbxe-sc__res-top { display: flex; align-items: center; gap: 14px; }
.tbxe-sc__res-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.14); }
.tbxe-sc__res-ic svg { width: 26px; height: 26px; }
.tbxe-sc__res-t { font-family: var(--s-display); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: .01em; }
.tbxe-sc__res-n { margin-top: 6px; font-size: 20px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
.tbxe-sc__res-n:empty { display: none; }
.tbxe-sc__res-d { margin-top: 12px; font-size: 14px; line-height: 20px; }
.tbxe-sc__res-d:empty { display: none; }
.tbxe-sc__datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1.5px dashed rgba(0,0,0,.22); }
.tbxe-sc__datos:empty { display: none; }
.tbxe-sc__datos dt { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.tbxe-sc__datos dd { margin: 4px 0 0; font-family: var(--s-display); font-weight: 600; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.tbxe-sc__res--ok { background: var(--s-green); color: var(--s-green-ink); }
.tbxe-sc__res--ya { background: var(--s-amber); color: var(--s-amber-ink); }
.tbxe-sc__res--no { background: var(--s-red); color: #fff; }
.tbxe-sc__res--no .tbxe-sc__res-ic { background: rgba(255,255,255,.18); }
.tbxe-sc__res--no .tbxe-sc__datos { border-top-color: rgba(255,255,255,.35); }
.tbxe-sc__res--carga { opacity: .8; }
/* "Escanear el siguiente" va dentro del resultado: oscuro, se lee igual sobre verde, ámbar o rojo. */
.tbxe-sc__sig { margin-top: 18px; min-height: 56px; padding: 0 16px; background: #141414; color: #fff; font-size: 17px; white-space: nowrap; }
.tbxe-sc__sig:hover { background: #050505; }
.tbxe-sc__sig .tbxe-i { flex: none; }

.tbxe-sc__acc { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 12px; }

/* Panel de búsqueda / código a mano */
.tbxe-sc__manual { position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: var(--s-bg); padding: max(12px, env(safe-area-inset-top)) var(--s-pad) max(20px, env(safe-area-inset-bottom)); }
.tbxe-sc__manual > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.tbxe-sc__manual-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.tbxe-sc__manual form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 18px 20px 20px; border-radius: 20px; background: var(--s-panel); }
.tbxe-sc__lista { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 0; list-style: none; }
.tbxe-sc__item { border-radius: 16px; background: var(--s-panel); overflow: hidden; }
.tbxe-sc__item.is-abierta { box-shadow: inset 0 0 0 1.5px var(--s-orange); }
.tbxe-sc__fila { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 14px 16px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.tbxe-sc__fila > div { flex: 1 1 auto; min-width: 0; }
.tbxe-sc__chev { flex: none; display: inline-flex; color: var(--s-mute); transition: transform .2s ease; }
.is-abierta .tbxe-sc__chev { transform: rotate(180deg); color: var(--s-orange); }
.tbxe-sc__det { padding: 0 16px 16px; }
.tbxe-sc__ficha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin: 0; padding-top: 14px; border-top: 1.5px dashed var(--s-line-2); }
.tbxe-sc__ficha dt { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--s-mute-2); }
.tbxe-sc__ficha dd { margin: 3px 0 0; font-size: 15px; line-height: 20px; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.tbxe-sc__det .tbxe-sc__btn { margin-top: 16px; }
.tbxe-sc__btn--ok { background: var(--s-green); color: var(--s-green-ink); }
.tbxe-sc__btn--ok:hover { background: #0bd56f; }
.tbxe-sc__det-nota { margin-top: 14px; font-size: 14px; line-height: 20px; color: var(--s-soft); }
.tbxe-sc__lista .n { font-size: 15px; line-height: 20px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.tbxe-sc__lista .d { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--s-mute); overflow-wrap: anywhere; }
.tbxe-sc__lista .e { margin-top: 4px; font-size: 12px; font-weight: 700; }
.tbxe-sc__lista .e--ya { color: #ffd34d; }
.tbxe-sc__lista .e::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.tbxe-sc__lista .e--no { color: #ff8a8a; }
.tbxe-sc__lista .e--ok { color: #4be08f; }

.tbxe-sc__vacio { padding: 12px 2px; color: var(--s-mute); font-size: 14px; }

@media (min-height: 760px) {
  .tbxe-sc__cam { min-height: 270px; }
}
/* En la compu: centrado, con más aire arriba */
@media (min-width: 960px) {
  .tbxe-sc__hero { height: 360px; }
  .tbxe-sc__hero-in { padding-top: 28px; }
  .tbxe-sc__app { padding-top: 28px; }
}
