/* =====================================================================
 * OPERATYX · Demo de Extracción de Datos · Hoja de estilos
 * © Operatyx. Todos los derechos reservados. Código propietario.
 * Prohibida su copia o distribución sin autorización por escrito.
 * ===================================================================== */
:root {
  --bg: #060912;
  --bg-2: #0b1222;
  --card: rgba(20, 28, 48, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e8edf7;
  --mute: #9aa6c4;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.15);
  --orange: #ff8c42;
  --green: #34d399;
  --red: #f87171;
  --radius: 18px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Anti-selección global (refuerzo visual de protección) */
html, body {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* Permitir selección/edición solo dentro de los inputs */
input, textarea { -webkit-user-select: text; user-select: text; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212,175,55,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,140,66,0.08), transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.container { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }

/* ============ MARCA / HEADER ============ */
.brand {
  display: flex; align-items: center; gap: .7rem; margin-bottom: .4rem;
}
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.15rem; color: #060912;
  background: linear-gradient(135deg, #ffe9a8, var(--gold) 55%, var(--orange));
  box-shadow: 0 8px 22px -8px rgba(212,175,55,.5);
}
.brand .name { font-weight: 800; letter-spacing: .02em; font-size: 1.15rem; }
.brand .name small { display: block; font-weight: 500; color: var(--mute); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }

h1.title {
  font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; margin: .2rem 0 .3rem;
  background: linear-gradient(135deg, #ffe9a8, var(--gold) 55%, var(--orange));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
p.lead { color: var(--mute); margin: 0 0 1.2rem; font-size: clamp(.9rem, 2.3vw, 1rem); }

/* ============ PANTALLA DE BLOQUEO ============ */
.lock-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 1.2rem;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(212,175,55,0.12), transparent 60%),
    linear-gradient(160deg, var(--bg), #02050c);
}
.lock-screen.show { display: flex; }
.lock-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 2rem 1.6rem; backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.7);
}
.lock-card .lock-ico {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 1rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: 2.1rem;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(212,175,55,.4);
}
.lock-card h2 { margin: 0 0 .3rem; font-size: 1.35rem; font-weight: 800; }
.lock-card p { color: var(--mute); font-size: .9rem; margin: 0 0 1.3rem; }
.pin-input {
  width: 100%; text-align: center; letter-spacing: .25em;
  font-family: var(--mono); font-size: 1.3rem; font-weight: 700;
  padding: .85rem 1rem; border-radius: 14px; color: var(--ink);
  background: rgba(255,255,255,.05); border: 1.5px solid var(--line); outline: none;
  transition: border-color .2s;
}
.pin-input:focus { border-color: var(--gold); }
.pin-input.shake { animation: shake .42s; border-color: var(--red) !important; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.pin-error { color: var(--red); min-height: 1.1rem; font-size: .82rem; font-weight: 600; margin: .6rem 0 0; }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.2rem; border-radius: 13px; font-weight: 700; font-size: .95rem;
  border: 1px solid var(--line); cursor: pointer; transition: all .18s;
  font-family: var(--font);
}
.btn-gold { background: linear-gradient(135deg, #ffe9a8, var(--gold) 60%, var(--orange)); color: #060912; border: none; }
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--ink); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-outline { background: transparent; color: var(--gold); border-color: rgba(212,175,55,.4); }
.btn-outline:hover { background: var(--gold-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ VISTAS ============ */
.view { display: none; animation: fade .25s; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body:not(.logged) .view { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.back-link { color: var(--mute); font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.back-link:hover { color: var(--gold); }

/* ============ MENÚ — 2 RECUADROS ============ */
.choices { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 700px) { .choices { grid-template-columns: 1fr 1fr; gap: 1.2rem; } }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .8rem;
  min-height: 200px; padding: 1.6rem 1.4rem; border-radius: 20px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(16px);
  text-align: left; transition: all .25s; overflow: hidden; color: inherit; width: 100%;
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.5);
}
.choice::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; transition: opacity .25s;
  background: radial-gradient(circle at 100% 0%, var(--c, var(--gold-soft)), transparent 60%);
}
.choice:hover { transform: translateY(-4px); border-color: var(--cc, var(--gold)); box-shadow: 0 20px 44px -12px rgba(0,0,0,.6); }
.choice:hover::before { opacity: 1; }
.choice .ic {
  width: 56px; height: 56px; border-radius: 16px; font-size: 1.7rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c, var(--gold-soft)); border: 1px solid var(--line); color: var(--cc, var(--gold));
}
.choice .t { font-size: 1.35rem; font-weight: 800; }
.choice .s { color: var(--mute); font-size: .92rem; line-height: 1.5; }
.choice .go { margin-top: auto; display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--cc, var(--gold)); }
.choice .go .circ {
  width: 30px; height: 30px; border-radius: 50%; background: var(--cc, var(--gold)); color: #060912;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900; transition: transform .2s;
}
.choice:hover .go .circ { transform: translateX(4px); }

/* ============ CAPTURA ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; backdrop-filter: blur(16px); margin-bottom: 1.1rem;
}
.card h3 { margin: 0 0 .3rem; font-size: 1.05rem; font-weight: 800; }
.card .sub { color: var(--mute); font-size: .85rem; margin: 0 0 1rem; }

.stage {
  border-radius: 14px; border: 1px dashed rgba(212,175,55,.4);
  background: rgba(0,0,0,.25); padding: 1rem; text-align: center; margin-bottom: 1rem;
  min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
}
.stage video, .stage img { max-width: 100%; max-height: 320px; border-radius: 10px; display: none; }
.cam-hint { color: var(--mute); font-size: .85rem; }

.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }

.progress-wrap { display: none; margin: 1rem 0 .3rem; }
.progress-track { height: 9px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-bar { height: 100%; width: 2%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--orange)); transition: width .25s; }
.progress-label { color: var(--mute); font-size: .8rem; margin-top: .4rem; font-family: var(--mono); }

/* ============ FORMULARIO ============ */
.form-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .78rem; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.field input {
  padding: .7rem .8rem; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink); font-size: .95rem; outline: none; transition: border-color .18s;
  font-family: var(--font);
}
.field input:focus { border-color: var(--gold); }
.field input.mono { font-family: var(--mono); letter-spacing: .03em; }

/* ============ DATA TABLA ============ */
.datos-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(212,175,55,.35); padding: .35rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 880px; }
.data-table th { background: rgba(255,255,255,.04); color: var(--gold); text-align: left; padding: .65rem .7rem; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.data-table td { padding: .6rem .7rem; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(212,175,55,.05); }
.data-table .fecha { color: var(--mute); font-family: var(--mono); font-size: .76rem; }
.data-table .vacio { color: rgba(255,255,255,.2); }
.row-del { background: rgba(248,113,113,.12); color: var(--red); border: 1px solid rgba(248,113,113,.3); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-weight: 700; }
.row-del:hover { background: rgba(248,113,113,.25); }
.empty { color: var(--mute); text-align: center; padding: 2.5rem 1rem; font-size: .92rem; }

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px);
  background: #14203b; color: var(--ink); border: 1px solid var(--line);
  padding: .8rem 1.2rem; border-radius: 12px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.7); opacity: 0; transition: all .3s; z-index: 2000; max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.success { border-color: rgba(52,211,153,.5); }
.toast.error { border-color: rgba(248,113,113,.5); }

/* ============ FOOTER / COPYRIGHT ============ */
.copyright {
  text-align: center; color: var(--mute); font-size: .75rem; margin: 2rem 0 1rem;
  font-family: var(--mono); letter-spacing: .03em;
}
.copyright strong { color: var(--gold); }
.watermark {
  position: fixed; right: 10px; bottom: 8px; z-index: 5; pointer-events: none;
  color: rgba(212,175,55,.18); font-size: .7rem; font-weight: 700; letter-spacing: .1em; font-family: var(--mono);
}
