/* Asistencia · identidad Universidad de la Amazonia (verde selva + rojo vital), como Vision_Computaciona_completo */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/marca/plus-jakarta-sans.woff2") format("woff2");
}

:root {
  --bg: #f4f7f5;
  --bg-elevated: #ffffff;
  --ink: #102418;
  --muted: #4d6356;
  --line: rgba(16, 36, 24, 0.1);
  --accent: #0b6b3a;
  --accent-ink: #f3fff8;
  --accent-soft: #d8f0e3;
  --brand-red: #c41e3a;
  --ok: #0b6b3a;
  --ok-soft: #d8f0e3;
  --warn: #9a6b12;
  --warn-soft: #fff3d6;
  --danger: #c41e3a;
  --danger-soft: #fde8ec;
  --shadow: 0 16px 36px rgba(11, 107, 58, 0.1);
  --radius: 18px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 420px at 0% 0%, #d8f0e3 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #fde8ec 0%, transparent 48%),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 50%, #eef3f0 100%);
  background-attachment: fixed;
}
button, input, label { font: inherit; }
button { touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid rgba(11, 107, 58, 0.45); outline-offset: 2px; }

.brand { font-weight: 800; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.xs { font-size: 0.75rem; }

/* ------------------------------------------------------------------ botones y campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; border: 0; border-radius: 999px; padding: 12px 20px;
  font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(11, 107, 58, 0.25); }
.btn-dark { background: var(--ink); color: #f7faf8; }
.btn-ghost { background: rgba(255, 255, 255, 0.78); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--accent); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }

.field {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--bg-elevated); color: var(--ink); outline: none; min-height: 46px;
}
.field::placeholder { color: rgba(77, 99, 86, 0.65); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 107, 58, 0.16); }
.label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }

/* ------------------------------------------------------------------ estructura */
.page-shell { width: min(960px, 100%); margin: 0 auto; padding: 18px 16px 40px; }
@media (min-width: 768px) { .page-shell { padding: 28px 24px 48px; } }
.glass {
  background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.pad { padding: 20px; }
@media (min-width: 768px) { .pad { padding: 26px; } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0; line-height: 1.15; }
.h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0; line-height: 1.2; }

.fade-in { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* cabecera con la marca */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.marca img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.marca-nombre { font-size: 1.3rem; line-height: 1.1; }
.marca-sub { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.usuario-nombre { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
@media (max-width: 520px) { .usuario-nombre { display: none; } .marca-sub { display: none; } }

.back { display: inline-flex; align-items: center; gap: 4px; font-size: 0.9rem; font-weight: 700; color: var(--accent); text-decoration: none; }

/* pestañas como botones (como la referencia) */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tab { min-height: 46px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.65); color: var(--ink);
  font-weight: 700; font-size: 0.9rem; cursor: pointer; text-decoration: none; display: grid; place-items: center; padding: 8px; text-align: center; }
.tab[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* mensajes */
.msg { border-radius: 14px; padding: 10px 14px; font-size: 0.9rem; }
.msg-ok { background: var(--ok-soft); color: var(--ok); }
.msg-warn { background: var(--warn-soft); color: #6b4a0a; }
.msg-error { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.vacio { border: 1.5px dashed var(--line); border-radius: 18px; padding: 36px 20px; text-align: center; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; font-weight: 800; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--danger-soft); color: var(--danger); }
.chip-gris { background: rgba(16, 36, 24, 0.06); color: var(--muted); }

/* tarjetas de clase */
.clase-card { display: block; padding: 20px; color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.clase-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.clase-card .flecha { color: var(--accent); font-size: 1.4rem; font-weight: 800; }

/* ------------------------------------------------------------------ foto (cámara / archivo) */
.dropzone {
  position: relative; border: 1.5px dashed rgba(16, 36, 24, 0.2); border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7f5 100%); min-height: 160px;
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
}
.dropzone[data-activa="true"] { border-color: var(--accent); background: var(--accent-soft); }
.dropzone img { width: 100%; height: 100%; max-height: 260px; object-fit: contain; background: #111; }
.dropzone-texto { padding: 22px 16px; text-align: center; }
.dropzone-icono { font-size: 2rem; line-height: 1; color: var(--accent); }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.72); padding: 16px; }
@media (min-width: 640px) { .modal { align-items: center; } }
.modal-caja { width: 100%; max-width: 560px; overflow: hidden; border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.modal-caja video, .modal-caja img { width: 100%; max-height: 70vh; background: #111; object-fit: contain; }
.modal-caja video.espejo { transform: scaleX(-1); }
.modal-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ estudiantes */
.alumnos { display: grid; gap: 10px; }
@media (min-width: 640px) { .alumnos { grid-template-columns: 1fr 1fr; } }
.alumno { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: rgba(244, 247, 245, 0.7); }
.alumno .foto, .fila .foto { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: #e6ece8; flex: none; }
.alumno .nombre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.link-btn.rojo { color: var(--danger); }
.link-btn.verde { color: var(--accent); }

/* ------------------------------------------------------------------ resultado de una lista */
.foto-marco { position: relative; line-height: 0; border-radius: 16px; overflow: hidden; background: #111; }
.foto-marco img { width: 100%; height: auto; }
.foto-marco.cargando { min-height: 160px; }
.foto-marco.cargando::after {
  content: "Cargando foto del salón…"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #cfd8d3; font-size: 0.9rem; font-weight: 600; line-height: 1.2;
}
.caja { position: absolute; border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 4px; padding: 0; background: none; cursor: pointer; }
.caja-presente { border-color: #2fd37f; }
.caja-revisar { border-color: #f5b52e; border-style: dashed; }
.caja-desconocida { border-color: rgba(255, 255, 255, 0.5); border-width: 1px; }
.caja.activa { border-width: 3px; z-index: 2; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5); }
.caja-nombre { position: absolute; left: -3px; bottom: 100%; margin-bottom: 4px; padding: 3px 8px; border-radius: 8px;
  font: 700 12px/1.3 var(--font); color: #fff; white-space: nowrap; background: var(--accent); }
.caja-revisar .caja-nombre { background: #b45309; }
.caja.derecha .caja-nombre { left: auto; right: -3px; }
.caja.abajo .caja-nombre { bottom: auto; top: 100%; margin: 4px 0 0; }
.caja-desconocida .caja-nombre { background: #333; }

.revisar-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border-radius: 18px; background: var(--warn-soft); }
.revisar-card figure { margin: 0; }
.revisar-card canvas, .revisar-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #fff; display: block; }
.revisar-card figcaption { text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.revisar-card .pie { grid-column: 1 / -1; }

/* tarjeta al tocar una cara: su cara en la foto + su foto registrada */
.ficha-cara { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border-radius: 18px; max-width: 460px; width: 100%; margin: 0 auto; }
.ficha-cara figure { margin: 0; }
.ficha-cara canvas, .ficha-cara img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #fff; display: block; }
.ficha-cara figcaption { text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.ficha-cara .pie { grid-column: 1 / -1; }
.ficha-cara .estado-ficha { font-weight: 800; font-size: 0.95rem; }
.ficha-presente { background: var(--ok-soft); }
.ficha-presente .estado-ficha { color: var(--ok); }
.ficha-revisar { background: var(--warn-soft); }
.ficha-revisar .estado-ficha { color: var(--warn); }

.filas { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.fila { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; border: 1.5px solid var(--line); flex-wrap: wrap; }
.fila .info { flex: 1; min-width: 140px; }
.fila .nombre { font-weight: 700; }
.fila .estado { font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.fila-presente { border-color: rgba(11, 107, 58, 0.45); background: var(--ok-soft); }
.fila-presente .estado { color: var(--ok); }
.fila-ausente { border-color: rgba(196, 30, 58, 0.35); background: var(--danger-soft); }
.fila-ausente .estado { color: var(--danger); }
.fila-revisar { border-color: rgba(154, 107, 18, 0.4); background: var(--warn-soft); }
.fila-revisar .estado { color: var(--warn); }
.fila.activa { box-shadow: 0 0 0 3px rgba(11, 107, 58, 0.35); }

.rueda { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: girar 0.9s linear infinite; flex: none; }
@keyframes girar { to { transform: rotate(360deg); } }
.barra-progreso { height: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.barra-progreso span { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--accent); animation: avanzar 1.4s ease-in-out infinite; }
@keyframes avanzar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #f7faf8;
  font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }

/* ================================================================== login (copiado de Vision_Computaciona_completo) */
.ua-login-page {
  min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; position: relative; overflow: hidden;
  padding: 0 12px 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(11, 107, 58, 0.1) 0%, transparent 48%),
    radial-gradient(circle at 88% 12%, rgba(196, 30, 58, 0.06) 0%, transparent 42%),
    linear-gradient(135deg, #f7fbf8 0%, #eef6f1 30%, #e8f3ec 60%, #f3f8f5 100%);
}
.ua-login-card {
  position: absolute; z-index: 0; pointer-events: none; border-radius: 14px; border: 2.5px solid rgba(11, 107, 58, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.76)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(11, 107, 58, 0.07) 2px, rgba(11, 107, 58, 0.07) 4px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(11, 107, 58, 0.16), 0 4px 16px rgba(11, 107, 58, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.ua-login-card::before {
  content: ""; position: absolute; top: 12px; left: 12px; right: 12px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(11, 107, 58, 0.4), rgba(20, 163, 90, 0.28), rgba(11, 107, 58, 0.4));
}
.ua-login-card span { position: absolute; top: 24px; left: 14px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(11, 107, 58, 0.55); }
.ua-login-card-left { left: 4%; top: 22%; width: min(250px, 28vw); height: min(165px, 18vw); transform: rotate(-5deg); animation: uaFloatLeft 20s ease-in-out infinite; }
.ua-login-card-right { right: 5%; top: 24%; width: min(210px, 24vw); height: min(135px, 15vw); transform: rotate(4deg); animation: uaFloatRight 18s ease-in-out infinite; }
.ua-login-card-right::before { width: 40%; right: auto; height: 2px; }
.ua-login-seal {
  position: absolute; left: 62%; top: 52%; z-index: 0; width: min(190px, 22vw); height: min(190px, 22vw); border-radius: 50%;
  border: 4px solid rgba(11, 107, 58, 0.32); display: grid; place-items: center; font-size: clamp(36px, 6vw, 72px); font-weight: 300;
  color: rgba(11, 107, 58, 0.45); line-height: 1; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 30%, rgba(11, 107, 58, 0.2) 60%, rgba(11, 107, 58, 0.12) 100%);
  box-shadow: 0 16px 40px rgba(11, 107, 58, 0.2), inset 0 2px 10px rgba(255, 255, 255, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.3);
  animation: uaFloatSeal 22s ease-in-out infinite;
}
.ua-login-seal::before { content: ""; position: absolute; width: 60%; height: 60%; border-radius: 50%; border: 3px solid rgba(11, 107, 58, 0.22); }
@keyframes uaFloatLeft { 0%, 100% { transform: rotate(-5deg) translate(0, 0); } 33% { transform: rotate(-4deg) translate(8px, -15px); } 66% { transform: rotate(-6deg) translate(-6px, 10px); } }
@keyframes uaFloatRight { 0%, 100% { transform: rotate(4deg) translate(0, 0); } 25% { transform: rotate(5deg) translate(-8px, -12px); } 50% { transform: rotate(3deg) translate(6px, 8px); } 75% { transform: rotate(4.5deg) translate(-4px, -8px); } }
@keyframes uaFloatSeal { 0%, 100% { transform: translate(0, 0) scale(1); } 25% { transform: translate(8px, -15px) rotate(2deg) scale(1.02); } 50% { transform: translate(-6px, 10px) rotate(-1.5deg) scale(0.98); } 75% { transform: translate(5px, -8px) rotate(1deg) scale(1.01); } }
.ua-login-main { position: relative; z-index: 1; width: 100%; max-width: 450px; display: flex; justify-content: center; padding-top: 5vh; }
.ua-login-content { width: 90%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
.ua-login-logo-section { width: 100%; display: flex; justify-content: center; align-items: center; margin-bottom: 10px; position: relative; padding: 10px; }
.ua-login-logo-section::before {
  content: ""; position: absolute; width: 80%; height: 80%; border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 107, 58, 0.16) 0%, transparent 70%); animation: uaPulse 3s ease-in-out infinite; z-index: 0;
}
@keyframes uaPulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 0.3; } }
.ua-login-logo-image { width: 60%; max-width: 150px; height: auto; object-fit: contain; position: relative; z-index: 1;
  filter: drop-shadow(0 8px 18px rgba(11, 107, 58, 0.18)); animation: uaLogoFloat 4s ease-in-out infinite; }
@keyframes uaLogoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ua-login-form {
  width: 100%; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 28px; padding: 28px; border: 1px solid rgba(11, 107, 58, 0.22); position: relative; overflow: hidden;
  box-shadow: 0 20px 60px rgba(11, 107, 58, 0.16), 0 8px 24px rgba(11, 107, 58, 0.1), 0 0 0 2px rgba(11, 107, 58, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 0 40px rgba(11, 107, 58, 0.1);
}
.ua-login-form::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #0b6b3a 0%, #14a35a 50%, #0b6b3a 100%); opacity: 0.9; box-shadow: 0 0 18px rgba(11, 107, 58, 0.35);
}
.ua-login-title {
  margin: 0 0 8px; text-align: center; font-size: 32px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #074d2a 0%, #0b6b3a 35%, #12a054 70%, #0e8a4b 100%); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(11, 107, 58, 0.25)); animation: uaTitleShine 3s ease-in-out infinite;
}
@keyframes uaTitleShine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ua-login-description { margin: 0 0 20px; text-align: center; font-size: 15px; color: #777; font-weight: 500; letter-spacing: 0.4px; }
.ua-login-field { display: flex; flex-direction: column; margin-bottom: 12px; width: 100%; }
.ua-login-field-label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: #444; margin-bottom: 10px;
  letter-spacing: 0.4px; transition: color 0.25s ease, transform 0.25s ease; }
.ua-login-field:focus-within .ua-login-field-label { color: #0b6b3a; transform: translateX(3px); }
.ua-login-field-label svg { color: #0b6b3a; filter: drop-shadow(0 0 6px rgba(11, 107, 58, 0.35)); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ua-login-field:focus-within .ua-login-field-label svg { transform: scale(1.12) rotate(4deg); }
.ua-login-field input {
  width: 100%; padding: 14px 16px; border: 2px solid rgba(11, 107, 58, 0.28); border-radius: 14px; font-size: 16px; font-weight: 500; color: #333;
  background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 12px rgba(11, 107, 58, 0.08); outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); -webkit-appearance: none; appearance: none;
}
.ua-login-field input:hover { border-color: rgba(11, 107, 58, 0.45); box-shadow: 0 6px 16px rgba(11, 107, 58, 0.12); transform: translateY(-1px); }
.ua-login-field input:focus { border-color: #0b6b3a; background: #fff; box-shadow: 0 0 0 4px rgba(11, 107, 58, 0.16), 0 8px 20px rgba(11, 107, 58, 0.16); transform: translateY(-2px); }
.ua-login-password { position: relative; display: flex; align-items: center; width: 100%; }
.ua-login-password input { padding-right: 50px; }
.ua-login-toggle { position: absolute; right: 10px; border: 0; background: transparent; color: #0b6b3a; cursor: pointer; padding: 8px;
  display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease, color 0.2s ease; }
.ua-login-toggle:hover { color: #0e8a4b; transform: scale(1.08); }
.ua-login-toggle svg { display: block; filter: drop-shadow(0 0 6px rgba(11, 107, 58, 0.35)); }
.ua-login-error { color: #d32f2f; font-size: 13px; text-align: center; margin: -4px 0 10px; padding: 6px; background: #ffebee; border-radius: 8px; }
.ua-login-submit {
  width: 100%; padding: 14px; margin-top: 8px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 650; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #074d2a 0%, #0b6b3a 50%, #12a054 100%);
  box-shadow: 0 4px 12px rgba(11, 107, 58, 0.35), 0 2px 6px rgba(11, 107, 58, 0.22);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.2s ease;
}
.ua-login-submit:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); box-shadow: 0 6px 20px rgba(11, 107, 58, 0.4), 0 4px 10px rgba(11, 107, 58, 0.25); }
.ua-login-submit:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.ua-login-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
@media (max-width: 720px) {
  .ua-login-card-left, .ua-login-card-right { opacity: 0.55; }
  .ua-login-card span { font-size: 8px; top: 16px; left: 8px; }
  .ua-login-seal { left: 78%; top: 58%; width: 70px; height: 70px; font-size: 22px; border-width: 2px; opacity: 0.7; }
}
@media (max-width: 480px) {
  .ua-login-page { padding: 0 10px 20px; }
  .ua-login-main { padding-top: 4vh; }
  .ua-login-card-left { left: 2%; top: 18%; width: 55px; height: 35px; border-radius: 10px; border-width: 2px; }
  .ua-login-card-right { right: 2%; top: 18%; width: 50px; height: 32px; border-radius: 10px; border-width: 2px; }
  .ua-login-card::before { top: 6px; left: 6px; right: 6px; height: 1.5px; }
  .ua-login-card span { font-size: 5px; top: 11px; left: 6px; }
  .ua-login-seal { width: 42px; height: 42px; font-size: 16px; left: 75%; top: 55%; }
  .ua-login-form { padding: 22px 18px; border-radius: 24px; }
  .ua-login-title { font-size: 28px; }
  .ua-login-logo-image { max-width: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .ua-login-card, .ua-login-seal, .ua-login-logo-image, .ua-login-logo-section::before, .ua-login-title, .fade-in, .barra-progreso span { animation: none; }
}

/* Chat flotante abajo a la derecha (estilo WhatsApp / soporte). */
.chat-flotante {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.chat-burbuja {
  width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%;
  overflow: hidden; cursor: pointer; background: #0b6b3a;
  box-shadow: 0 10px 28px rgba(11, 107, 58, 0.35);
}
.chat-burbuja img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.chat-panel {
  width: min(360px, calc(100vw - 28px));
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px rgba(16, 36, 24, 0.18); overflow: hidden;
}
.chat-cabeza {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #0b6b3a; color: #fff;
}
.chat-cabeza .asistente-cara {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.55); flex: 0 0 auto; background: #e8f2ec;
}
.chat-cabeza .asistente-foto { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.chat-titulos { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.chat-titulos strong { font-size: 0.98rem; }
.chat-titulos span { font-size: 0.78rem; opacity: 0.9; }
.chat-cerrar {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.chat-hilos {
  height: 280px; overflow-y: auto; padding: 12px; background: #efeae2;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
}
.chat-msg-bot { align-self: flex-start; background: #fff; color: var(--ink); border-top-left-radius: 4px; }
.chat-msg-yo { align-self: flex-end; background: #d9fdd3; color: var(--ink); border-top-right-radius: 4px; }
/* «Escribiendo…» (tres puntos) solo mientras el respaldo interpreta una frase rara. */
.chat-escribiendo { display: inline-flex; gap: 4px; align-items: center; padding: 11px 14px; }
.chat-escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: #8a8f98; animation: chat-punto 1s ease-in-out infinite; }
.chat-escribiendo span:nth-child(2) { animation-delay: 0.15s; }
.chat-escribiendo span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-punto { 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-escribiendo span { animation: none; } }
.chat-barra {
  display: flex; align-items: center; gap: 8px; padding: 10px;
  background: #fff; border-top: 1px solid var(--line);
}
.chat-caja {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 22px;
  padding: 10px 14px; font: inherit; background: #f4f7f5;
}
.chat-enviar, .chat-mic {
  height: 42px; border: 0; border-radius: 22px; cursor: pointer;
  padding: 0 12px; font: inherit; font-size: 0.88rem; font-weight: 600; flex: 0 0 auto;
}
.chat-enviar { background: #0b6b3a; color: #fff; }
.chat-mic { background: #eef3f0; color: #0b6b3a; }
.chat-mic.escuchando { background: #c62828; color: #fff; }
.asistente-cara[data-modo="oye"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55); }
.asistente-cara[data-modo="habla"] { animation: asistente-habla 1.6s ease-in-out infinite alternate; }
@keyframes asistente-habla { from { transform: scale(1); } to { transform: scale(1.012); } }
@media (prefers-reduced-motion: reduce) {
  .asistente-cara[data-modo="habla"] { animation: none; }
}

/* Mirada del asistente: la foto gira un poco hacia el ratón (lo mueve asistente.js, sin saltos). */
.chat-burbuja img, .chat-cabeza .asistente-foto { transform-origin: 50% 62%; will-change: transform; backface-visibility: hidden; }
.chat-burbuja.con-aviso { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(11, 107, 58, 0.55), 0 10px 28px rgba(11, 107, 58, 0.35); animation: chat-llama 1.6s ease-in-out 3; }
@keyframes chat-llama { 50% { transform: translateY(-3px); } }
/* Globito junto al botón: «Entraste a la lista …» con el chat cerrado. */
.chat-aviso {
  max-width: min(280px, calc(100vw - 100px)); margin: 0; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: 14px; border-bottom-right-radius: 4px; background: #fff; color: var(--ink);
  font: inherit; font-size: 0.86rem; line-height: 1.35; text-align: left; cursor: pointer;
  box-shadow: 0 12px 28px rgba(16, 36, 24, 0.16); animation: chat-aviso-entra 0.25s ease-out;
}
.chat-aviso[hidden] { display: none; }
@keyframes chat-aviso-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-titulos span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Código de 4 números de cada clase y lista (para entrar desde el chat). */
.chip-codigo { background: rgba(11, 107, 58, 0.08); color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
@media (prefers-reduced-motion: reduce) {
  .chat-burbuja.con-aviso, .chat-aviso { animation: none; }
}

/* Caras del asistente: dos fotos encimadas para el fundido al cambiar de mirada (asistente.js). */
.chat-burbuja, .chat-cabeza .asistente-cara { position: relative; }
.chat-burbuja img.cara-capa, .chat-cabeza .asistente-foto.cara-capa { position: absolute; inset: 0; }

/* Barra del chat estilo WhatsApp: caja + botón redondo (micrófono, o enviar si hay texto). */
.chat-redondo {
  width: 42px; min-width: 42px; height: 42px; padding: 0; border-radius: 50%;
  display: inline-grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.chat-redondo svg { display: block; }
.chat-mic.chat-redondo { background: #0b6b3a; color: #fff; }
.chat-mic.chat-redondo.escuchando { background: #c62828; color: #fff; }
.chat-barra.manteniendo .chat-mic.chat-redondo { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.16); }
.chat-barra.grabando > .chat-caja, .chat-barra.grabando > .chat-enviar { display: none; }
.chat-barra.grabando:not(.manteniendo) > .chat-mic { display: none; }
.chat-grabando { flex: 1 1 auto; min-width: 0; height: 42px; display: flex; align-items: center; gap: 10px; }
.chat-grabando[hidden] { display: none; }
.chat-basura {
  width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center; background: transparent; color: var(--muted);
}
.chat-basura:hover, .chat-basura:focus-visible { color: var(--danger); background: var(--danger-soft); }
.chat-rec-punto { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #e53935; animation: chat-rec-punto 1s ease-in-out infinite; }
@keyframes chat-rec-punto { 50% { opacity: 0.2; } }
.chat-rec-tiempo { flex: 0 0 auto; min-width: 2.6em; font-size: 0.92rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chat-ondas { flex: 1 1 auto; min-width: 0; height: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.chat-ondas i { flex: 0 0 3px; height: 100%; border-radius: 2px; background: var(--accent); opacity: 0.85; transform: scaleY(0.25); transform-origin: center; animation: chat-onda 0.9s ease-in-out infinite alternate; }
.chat-ondas i:nth-child(3n) { animation-delay: -0.3s; }
.chat-ondas i:nth-child(3n+1) { animation-delay: -0.6s; }
.chat-ondas i:nth-child(4n) { animation-duration: 0.7s; }
.chat-ondas i:nth-child(5n+2) { animation-duration: 1.1s; }
.chat-grabando.nivel-real .chat-ondas i { animation: none; transition: transform 70ms linear; }
@keyframes chat-onda { from { transform: scaleY(0.18); } to { transform: scaleY(0.9); } }
@keyframes chat-onda-quieta { from { transform: scaleY(0.12); } to { transform: scaleY(0.3); } }
.chat-grabando:not(.con-voz) .chat-ondas i { animation-name: chat-onda-quieta; }
.chat-deslizar { display: none; flex: 1 1 auto; min-width: 0; overflow: hidden; text-align: center; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.chat-deslizar span { display: inline-block; transform: translateX(var(--arrastre, 0px)); }
.chat-barra.manteniendo .chat-deslizar { display: block; }
.chat-barra.grabando > .chat-grabando { order: 1; }
.chat-barra.grabando > .chat-mic { order: 2; }
.chat-barra.manteniendo .chat-basura, .chat-barra.manteniendo .chat-grabando .chat-enviar, .chat-barra.manteniendo .chat-ondas { display: none; }
@media (prefers-reduced-motion: reduce) {
  .chat-rec-punto, .chat-ondas i { animation: none; }
  .chat-ondas i { transform: scaleY(0.5); }
}
