:root {
  --primary: #0d9488;
  --primary-dark: #0e7490;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}
a { color: var(--primary); text-decoration: none; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--card);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 420px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--muted); margin-top: 0; margin-bottom: 24px; font-size: 14px; }
.brand { font-weight: 800; color: var(--primary); font-size: 26px; margin-bottom: 20px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
button, .btn {
  cursor: pointer; border: none; background: var(--primary); color: white;
  padding: 11px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-danger { background: var(--red); }
.error { background: #fef2f2; color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.success { background: #f0fdf4; color: var(--green); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.form-submit { margin-top: 20px; width: 100%; }
.form-submit button { width: 100%; }
.foot-link { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* App layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: #101828; color: #cbd5e1; padding: 24px 16px; flex-shrink: 0;
}
.sidebar .brand { color: white; font-size: 20px; margin-bottom: 30px; padding-left: 8px; }
.sidebar a {
  display: block; padding: 10px 12px; border-radius: 8px; color: #cbd5e1; font-size: 14px; margin-bottom: 4px;
}
.sidebar a:hover, .sidebar a.active { background: #1e293b; color: white; }
.sidebar .empresa-name { font-size: 12px; color: #64748b; padding: 0 8px 16px; border-bottom: 1px solid #1e293b; margin-bottom: 16px; }
.main { flex: 1; padding: 32px; max-width: 1200px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.topbar h1 { font-size: 24px; margin: 0; }

/* Barra superior móvil: botón de menú + marca, oculta en escritorio */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

/* Tablas anchas: permite scroll horizontal dentro de su propio contenedor
   en vez de desbordar la página, clave para verlas bien en el celular. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 560px; }

.cards { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-card {
  background: var(--card); border-radius: 12px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  min-width: 180px; flex: 1;
}
.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 700; }

.card { background: var(--card); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-entrada { background: #dcfce7; color: #166534; }
.badge-salida { background: #fee2e2; color: #991b1b; }
.badge-trial { background: #fef3c7; color: #92400e; }

.filters { display: flex; gap: 12px; margin-bottom: 20px; align-items: end; }
.filters label { margin: 0 0 4px; }
.filters .field { display: flex; flex-direction: column; }

.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
.form-inline .field { min-width: 160px; }
.form-inline label { margin: 0 0 4px; }

/* Mis horas (vista del empleado) */
.mis-horas-wrap { max-width: 720px; margin: 32px auto; padding: 0 16px; text-align: left; }
.mis-horas-wrap .cards { margin-top: 16px; }
.mis-horas-wrap .filters { flex-wrap: wrap; }

/* Marcar page */
.marcar-wrap { max-width: 480px; margin: 40px auto; text-align: center; }
.marcar-wrap video, .marcar-wrap canvas { width: 100%; border-radius: 16px; background: #000; }
.marcar-wrap .clock { font-size: 42px; font-weight: 700; margin: 16px 0 4px; }
.marcar-wrap .date { color: var(--muted); margin-bottom: 20px; }
.face-status { margin: 10px 0; font-size: 14px; font-weight: 600; }
.face-ok { color: var(--green); }
.face-no { color: var(--muted); }
.big-btn { font-size: 17px; padding: 16px; width: 100%; border-radius: 12px; }

.text-right { text-align: right; }
.total-row td { font-weight: 700; border-top: 2px solid var(--text); }

/* ================== Responsivo (celular / tablet) ================== */
@media (max-width: 860px) {
  .auth-card { padding: 28px 22px; }

  /* El sidebar se convierte en un menú deslizable ("drawer") que se abre con
     el botón de hamburguesa, en vez de ocupar espacio fijo todo el tiempo. */
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    background: #101828; color: white; padding: 14px 16px;
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-topbar .brand { margin: 0; font-size: 18px; }
  .menu-toggle {
    background: transparent; border: none; color: white; font-size: 22px;
    padding: 4px 8px; line-height: 1; cursor: pointer;
  }

  .app { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: 250px; max-width: 80vw; transform: translateX(-100%);
    transition: transform 0.2s ease; overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 45;
  }

  .main { padding: 16px; max-width: 100%; }
  .topbar h1 { font-size: 20px; }

  .cards { gap: 10px; }
  .stat-card { min-width: 45%; padding: 14px 16px; }
  .stat-card .value { font-size: 22px; }

  .card { padding: 16px; }

  /* Formularios y filtros pasan de una fila con varias columnas a apilarse
     en una sola columna a lo ancho, más cómodo de tocar en pantallas chicas. */
  .form-inline, .filters { flex-direction: column; align-items: stretch; }
  .form-inline .field, .filters .field { min-width: 0; width: 100%; }
  .form-inline button, .filters button, .form-inline .btn, .filters .btn { width: 100%; text-align: center; }

  table { font-size: 12.5px; }
  th, td { padding: 8px; }
}

@media (max-width: 480px) {
  .marcar-wrap { margin: 20px auto; padding: 0 12px; }
  .marcar-wrap .clock { font-size: 32px; }
  .auth-wrap { padding: 12px; }
  .auth-card { padding: 22px 18px; }
}

/* Aviso de consentimiento (cámara, ubicación, datos biométricos) que se muestra la
   primera vez que un empleado va a marcar asistencia en su navegador. */
.consent-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.consent-box {
  background: #fff; border-radius: 14px; padding: 22px; max-width: 460px; width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

/* ================== Landing page ================== */
.landing { background: #fff; overflow-x: hidden; max-width: 100vw; }
.landing a { color: inherit; }
.landing * { min-width: 0; }

.l-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.l-nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.l-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); }
.l-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  display: flex; align-items: center; justify-content: center;
}
.l-nav-links { display: flex; gap: 26px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.l-nav-links a:hover { color: var(--primary); }
.l-nav-cta { display: flex; gap: 10px; align-items: center; }

.l-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
  cursor: pointer; border: none; text-decoration: none; white-space: nowrap;
}
.l-btn-primary { background: var(--primary); color: #fff; }
.l-btn-primary:hover { background: var(--primary-dark); }
.l-btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.l-btn-ghost:hover { background: #f1f5f9; }
.l-btn-ghost-light { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.l-btn-ghost-light:hover { background: rgba(255,255,255,0.2); }
.l-btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 12px; }

.l-hero {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #0e7490 100%);
  color: #fff; overflow: hidden; position: relative;
}
.l-hero-inner {
  max-width: 1160px; margin: 0 auto; padding: 80px 24px 90px;
  display: flex; align-items: center; gap: 48px;
}
.l-hero-copy { flex: 1.1; min-width: 0; }
.l-pill {
  display: inline-block; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700; margin-bottom: 22px;
}
.l-hero h1 { font-size: 48px; line-height: 1.14; font-weight: 800; letter-spacing: -1px; margin: 0 0 20px; }
.l-accent { color: #fde68a; }
.l-sub { font-size: 18px; line-height: 1.6; color: rgba(255,255,255,0.88); max-width: 540px; margin: 0 0 32px; }
.l-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.l-hero-visual { flex: 1; display: flex; justify-content: center; min-width: 0; }
.l-mock {
  width: 320px; max-width: 100%; box-sizing: border-box;
  background: #0f172a; border-radius: 22px; padding: 10px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.l-mock-top { display: flex; gap: 6px; padding: 6px 8px 12px; }
.l-mock-dot { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.l-mock-body {
  background: linear-gradient(180deg, #1e293b, #0f172a); border-radius: 16px; padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.l-mock-face {
  width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.l-mock-line { color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.l-mock-btn {
  width: 100%; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px; border-radius: 10px; margin-bottom: 22px;
}
.l-mock-rows { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.l-mock-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.06); border-radius: 8px; padding: 8px 12px;
  font-size: 12.5px; color: #cbd5e1;
}
.l-mock-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.l-mock-in { background: #dcfce7; color: #166534; }
.l-mock-out { background: #fee2e2; color: #991b1b; }

.l-section { padding: 84px 24px; }
.l-section-alt { background: #f8fafc; }
.l-section-inner { max-width: 1160px; margin: 0 auto; }
.l-section-narrow { max-width: 760px; }
.l-h2 { font-size: 32px; font-weight: 800; text-align: center; margin: 0 0 10px; letter-spacing: -0.5px; }
.l-h2-sub { text-align: center; color: var(--muted); font-size: 16px; margin: 0 0 48px; }

.l-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.l-feature { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.l-feature-icon {
  width: 48px; height: 48px; border-radius: 12px; background: #ecfdf5;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.l-feature h3 { font-size: 17px; margin: 0 0 8px; }
.l-feature p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; }

.l-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.l-step { text-align: center; }
.l-step-num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
  margin: 0 auto 16px;
}
.l-step h3 { font-size: 17px; margin: 0 0 8px; }
.l-step p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 auto; max-width: 280px; }

.l-faq-item {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 12px;
}
.l-faq-item summary { font-weight: 700; font-size: 15px; cursor: pointer; }
.l-faq-item p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 12px 0 0; }

.l-billing-toggle {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  width: fit-content; margin: 0 auto 40px; background: #f1f5f9; border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
}
.l-billing-opt {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14px; color: var(--muted);
  padding: 9px 18px; border-radius: 999px;
}
.l-billing-opt.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.l-billing-badge {
  background: #fde68a; color: #78350f; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}

.l-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.l-plan {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; display: flex; flex-direction: column;
  position: relative;
}
.l-plan-featured {
  background: #0f172a; border-color: #0f172a; color: #fff;
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(15,23,42,0.18);
}
.l-plan-badge {
  position: absolute; top: -14px; left: 28px;
  background: #fde68a; color: #78350f; font-weight: 800; font-size: 12px;
  padding: 5px 12px; border-radius: 999px;
}
.l-plan-tag { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.l-plan-tag-dark { color: #94a3b8; }
.l-plan-name { font-size: 21px; font-weight: 800; margin: 0 0 14px; }
.l-plan-price { display: flex; align-items: baseline; gap: 4px; }
.l-plan-amount { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.l-plan-period { font-size: 14px; color: var(--muted); }
.l-plan-featured .l-plan-period { color: #94a3b8; }
.l-plan-billing { font-size: 12.5px; color: var(--muted); margin: 2px 0 20px; }
.l-plan-featured .l-plan-billing { color: #94a3b8; }
.l-plan-features { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.l-plan-features li { font-size: 14px; padding-left: 26px; position: relative; line-height: 1.4; }
.l-plan-features li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: #22c55e; font-weight: 800;
}
.l-plan-cta { width: 100%; padding: 13px 18px; }
.l-plan-featured .l-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.l-plan-featured .l-btn-ghost:hover { background: rgba(255,255,255,0.1); }

.l-plans-note { text-align: center; font-size: 13.5px; color: var(--muted); max-width: 680px; margin: 32px auto 0; line-height: 1.6; }

.l-cta {
  background: linear-gradient(135deg, #134e4a, #0e7490);
  color: #fff; text-align: center; padding: 76px 24px;
}
.l-cta h2 { font-size: 30px; font-weight: 800; margin: 0 0 12px; }
.l-cta p { font-size: 16px; color: rgba(255,255,255,0.85); margin: 0 0 30px; }
.l-cta-inner { max-width: 640px; margin: 0 auto; }

.l-footer { background: #0f172a; color: #94a3b8; padding: 36px 24px; }
.l-footer-inner {
  max-width: 1160px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.l-brand-footer { color: #fff; }
.l-footer-links { display: flex; gap: 22px; font-size: 13.5px; flex-wrap: wrap; }
.l-footer-links a:hover { color: #fff; }
.l-footer-copy { width: 100%; text-align: center; font-size: 12.5px; margin-top: 12px; border-top: 1px solid #1e293b; padding-top: 16px; }

@media (max-width: 900px) {
  .l-nav-links { display: none; }
  .l-hero-inner { flex-direction: column; padding: 56px 20px 60px; text-align: center; }
  .l-hero h1 { font-size: 36px; }
  .l-sub { margin-left: auto; margin-right: auto; }
  .l-hero-actions { justify-content: center; }
  .l-features { grid-template-columns: 1fr; }
  .l-steps { grid-template-columns: 1fr; gap: 40px; }
  .l-plans { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .l-plan-featured { transform: none; }
  .l-section { padding: 56px 20px; }
  .l-h2 { font-size: 26px; }
  .l-footer-inner { flex-direction: column; text-align: center; }
}

/* Teléfonos angostos: la barra superior (logo + botones) es lo primero que se
   desborda si no se achica, porque "Iniciar sesión" + "Prueba gratis" no caben
   junto al nombre en ~360px de ancho. */
@media (max-width: 480px) {
  .l-nav-inner { padding: 12px 14px; gap: 6px; }
  .l-brand { font-size: 15px; gap: 6px; }
  .l-logo { width: 28px; height: 28px; border-radius: 8px; }
  .l-logo svg { width: 17px; height: 17px; }
  .l-nav-cta { gap: 6px; }
  .l-nav-cta .l-btn { padding: 8px 10px; font-size: 12px; border-radius: 8px; }
  .l-hero-inner { padding: 44px 16px 48px; }
  .l-pill { font-size: 12px; padding: 7px 12px; }
  .l-hero h1 { font-size: 28px; letter-spacing: -0.5px; }
  .l-sub { font-size: 15.5px; }
  .l-hero-actions { flex-direction: column; align-items: stretch; }
  .l-hero-actions .l-btn-lg { width: 100%; }
  .l-section { padding: 44px 16px; }
  .l-h2 { font-size: 22px; }
  .l-feature { padding: 20px; }
  .l-billing-toggle { width: 100%; }
  .l-billing-opt { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; }
  .l-plan { padding: 22px; }
  .l-cta { padding: 52px 16px; }
  .l-cta h2 { font-size: 24px; }
}

/* ================== Escaneo facial "pro" (encuadre + malla en vivo) ================== */
/* Encuadre estilo HUD de reconocimiento facial: fondo oscuro, cuadrícula sutil,
   esquinas tipo visor de cámara, y una malla de puntos dibujada en vivo sobre el
   rostro detectado (ver /js/face-mesh-ui.js). Se usa en el enrolamiento, el modo
   kiosco y la pantalla individual de marcar, para que toda la experiencia de
   cámara se vea consistente. */
.scan-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 28px -8px rgba(15, 23, 42, 0.45);
}
.scan-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scan-frame.scan-frame--mirror video { transform: scaleX(-1); } /* efecto espejo: solo en el enrolamiento (selfie) */
.scan-frame .scan-mesh {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.scan-frame.scan-frame--mirror .scan-mesh { transform: scaleX(-1); } /* la malla se dibuja sin espejar; esto la alinea con el video espejado */
.scan-frame .scan-grid {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 234, 212, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 55%, transparent 90%);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 55%, transparent 90%);
}
.scan-frame .scan-corners {
  position: absolute; inset: 0;
  pointer-events: none;
}
.scan-frame .scan-corners span {
  position: absolute;
  width: 32px; height: 32px;
  border: 0 solid #5eead4;
  filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.55));
  transition: border-color 0.25s ease, filter 0.25s ease;
}
.scan-frame .scan-corners .tl { top: 16px; left: 16px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.scan-frame .scan-corners .tr { top: 16px; right: 16px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.scan-frame .scan-corners .bl { bottom: 16px; left: 16px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.scan-frame .scan-corners .br { bottom: 16px; right: 16px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }
.scan-frame.detectada .scan-corners span { border-color: #4ade80; filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.65)); }
.scan-frame .scan-line-full {
  position: absolute; left: 6%; right: 6%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.9), transparent);
  box-shadow: 0 0 10px 2px rgba(45, 212, 191, 0.65);
  animation: scan-sweep 2.4s ease-in-out infinite;
  pointer-events: none;
}
.scan-frame.detectada .scan-line-full { display: none; }
@keyframes scan-sweep {
  0% { top: 8%; opacity: 0; }
  10% { opacity: 1; }
  50% { top: 92%; opacity: 1; }
  60% { opacity: 0; }
  100% { top: 8%; opacity: 0; }
}
.scan-frame .scan-badge {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-frame .scan-badge.detectada { background: rgba(22, 163, 74, 0.85); color: #fff; }
.scan-tips {
  display: flex; flex-direction: column; gap: 6px;
  margin: 12px 0 4px;
  font-size: 13px; color: var(--muted);
}
.scan-tips span { display: flex; align-items: center; gap: 8px; }

/* ================== Panel de indicadores (gráficos de barras en CSS puro) ================== */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  padding: 10px 4px 0;
}
.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.bar-chart .bar-col .bar-track {
  width: 100%;
  max-width: 42px;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  justify-content: flex-start;
}
.bar-chart .bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: var(--primary);
  min-height: 3px;
  transition: height 0.3s ease;
  position: relative;
}
.bar-chart .bar-col .bar-value {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
}
.bar-chart .bar-col .bar-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}
.bar-chart.bar-chart--dual .bar-track { flex-direction: row; gap: 3px; align-items: flex-end; }
.bar-chart.bar-chart--dual .bar-track .bar { flex: 1; }
.bar-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ================== Páginas legales (Términos, Política de Datos) ================== */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.legal-wrap .legal-back { font-size: 13.5px; font-weight: 600; }
.legal-wrap h1 { font-size: 30px; margin: 20px 0 4px; }
.legal-wrap .legal-fecha { color: var(--muted); font-size: 13.5px; margin: 0 0 32px; }
.legal-wrap h2 { font-size: 19px; margin: 36px 0 10px; }
.legal-wrap p, .legal-wrap li { font-size: 15px; line-height: 1.7; color: #334155; }
.legal-wrap ul, .legal-wrap ol { padding-left: 22px; }
.legal-wrap li { margin-bottom: 6px; }
.legal-notice {
  background: #ecfdf5; border: 1px solid #99f6e4; border-radius: 12px;
  padding: 14px 18px; font-size: 13.5px; color: #134e4a; margin: 24px 0;
}
