/* ============================================================
   www.tegestiona.com — Estilo claro · paleta inspirada en pixilegal.com
   ============================================================ */

:root {
  --bg: #fafaf9;
  --bg-alt: #f0f7f7;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e2e2e0;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #2b8a8f;
  --accent-2: #84cdd2;
  --accent-deep: #1d6f73;
  --accent-soft: #e8f7f8;
  --green: #2ecc71;
  --red: #e74c3c;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(26, 26, 26, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* overflow-x: clip en vez de hidden -> NO crea contenedor de scroll,
   por eso position: sticky del header sigue funcionando.
   overflow-anchor: none -> la pagina es estatica, asi que ningun cambio de
   contenido (como reiniciar el chat) puede desplazarla. */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-anchor: none;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
.gold { color: var(--accent); }

.container { width: min(1120px, 92%); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.5px; margin-right: 20px; }
.brand img.brand-logo { display: block; height: 82px; width: auto; flex: 0 0 auto; }
.site-footer .brand-logo { height: 92px; }
.nav-links { display: flex; align-items: center; gap: 18px; list-style: none; flex-wrap: nowrap; }
.nav-links li { flex: 0 0 auto; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 0.9rem; white-space: nowrap; flex: 0 0 auto; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 800;
  margin-left: 18px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(43, 138, 143, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover { color: #fff !important; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(43, 138, 143, 0.4); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.6rem; cursor: pointer; padding: 10px 6px; line-height: 1; }

/* ---------- Botones ---------- */
/* Unico formato para TODOS los botones: fondo verde azulado, texto blanco.
   Las clases btn-gold / btn-green / btn-ghost / nav-cta se conservan
   porque ya estan usadas en el HTML, pero se ven iguales. */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 6px 18px rgba(43, 138, 143, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 12px 30px rgba(43, 138, 143, 0.4);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(43, 138, 143, 0.45); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* variantes: mismo aspecto que .btn */
.btn-gold, .btn-green, .btn-ghost {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border: 0;
}
.btn-gold:hover, .btn-green:hover, .btn-ghost:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}
.btn-gold:disabled, .btn-green:disabled, .btn-ghost:disabled { opacity: 0.55; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  text-align: center;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(43, 138, 143, 0.10), transparent 60%),
    radial-gradient(800px 400px at 10% 10%, rgba(132, 205, 210, 0.18), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero .badge {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px solid rgba(43, 138, 143, 0.35);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 900; letter-spacing: -0.5px; line-height: 1.1; max-width: 900px; margin: 0 auto 18px; color: #1a1a1a; }
.hero h1 .gold { color: var(--accent); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 720px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.stat b { display: block; font-size: 1.7rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Secciones genéricas ---------- */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 900; line-height: 1.15; margin-bottom: 12px; }
.section-head p { color: var(--muted); }

/* ---------- Grid especialistas ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.grid.team-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.team-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.avatar {
  width: 92px; height: 118px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  display: grid; place-items: center;
  overflow: hidden;
  margin-bottom: 14px;
  border: 2px solid var(--border);
  font-size: 2rem; font-weight: 900; color: var(--accent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.card .role { color: var(--accent); font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.93rem; }
.card .online { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 0.8rem; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- Tarjeta de presentación (equipo) ---------- */
.card.team { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card.team .photo { width: 100%; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.card.team .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.card.team .info { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card.team .info h3 { font-size: 1.2rem; margin-bottom: 4px; }
.card.team .info .role { margin-bottom: 8px; }
.card.team .info p { flex: 1; }
.card.team .online { margin-top: 14px; }

/* la tarjeta completa es el boton que abre el chat del especialista */
.card.team[href] { text-decoration: none; color: inherit; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card.team[href]:hover { transform: translateY(-5px); box-shadow: 0 18px 42px rgba(26, 26, 26, 0.14); }
.card.team[href]:hover .info h3 { color: var(--accent); transition: color 0.18s ease; }
.card.team[href]:focus-visible { outline: 3px solid rgba(43, 138, 143, 0.5); outline-offset: 3px; }

/* ---------- Pasos (cómo funciona) ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; position: relative; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; top: -16px; left: 24px;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-weight: 900;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 1.1rem;
}
.step h3 { margin: 14px 0 8px; font-size: 1.1rem; }
.step p { color: var(--muted); font-size: 0.95rem; }
.step .price { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 800; }

/* ---------- Carrusel de tareas (inicio) ---------- */
.task-carousel { position: relative; overflow: hidden; }
.task-track { display: flex; gap: 20px; transition: transform 0.55s ease; }
.task-card {
  flex: 0 0 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.task-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.task-card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-weight: 900; font-size: 1.05rem;
  border-radius: 10px; margin-bottom: 14px;
}
.task-card h3 { font-size: 1.08rem; margin-bottom: 8px; text-align: left; }
.task-card p { color: var(--muted); font-size: 0.92rem; text-align: left; }
.task-card .who { display: block; margin-top: 12px; color: var(--accent); font-size: 0.8rem; font-weight: 700; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.carousel-dots .c-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background 0.3s; }
.carousel-dots .c-dot.on { background: var(--accent); }

/* ---------- Características (seguridad & privacidad) ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature .icon { font-size: 2.2rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.93rem; }

/* ---------- Chat demo ---------- */
.chat-window {
  max-width: 720px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.chat-head .avatar { margin: 0; width: 42px; height: 42px; border-radius: 8px; font-size: 1rem; font-weight: 900; color: var(--accent); }
.chat-head b { display: block; font-size: 0.98rem; }
.chat-head small { color: var(--muted); }
.chat-body { padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.bubble { max-width: 82%; padding: 13px 16px; border-radius: 14px; font-size: 0.95rem; }
.bubble.bot { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.user { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 600; }
.bubble .src { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.bubble.user .src { color: #e8f7f8; }
.chat-doc {
  margin-top: 12px; padding: 12px 14px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  font-size: 0.9rem;
}
.chat-doc b { color: var(--accent); }
.chat-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--bg-alt); }
.chat-input input { flex: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 10px; font-size: 0.95rem; }
.chat-input input:focus { outline: none; border-color: var(--accent); }

/* ---------- Chat grande (ventana de consulta) ---------- */
.chat-window.chat-lg { max-width: 1000px; }
.chat-head.chat-centered {
  flex-direction: column;
  text-align: center;
  padding: 28px 20px 20px;
  gap: 2px;
}
.spec-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(43, 138, 143, 0.18);
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.spec-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.chat-head .spec-name { font-size: 1.2rem; font-weight: 800; }
.chat-head .spec-role { color: var(--accent); font-size: 0.92rem; font-weight: 700; }
.spec-status { margin-top: 8px; color: var(--muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }

.chat-pinned {
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.pin-tag {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px solid rgba(43, 138, 143, 0.35);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 12px;
  margin-bottom: 8px;
}
.chat-pinned p { color: var(--text); font-size: 0.95rem; font-weight: 600; }

.bubble.doc-ready { border-left: 3px solid var(--green); }
.doc-ready-text { font-weight: 700; }

/* ---------- Barra de documento ---------- */
.doc-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.doc-mini {
  position: relative;
  width: 74px; height: 90px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.2s;
}
.doc-mini:hover { border-color: var(--accent); }
.doc-mini svg { color: var(--muted); width: 36px; height: 36px; }
.zoom-btn {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid;
  place-items: center;
}
.zoom-btn svg { width: 16px; height: 16px; }
.doc-status { flex: 1; min-width: 200px; text-align: center; }
.doc-status b { display: block; font-size: 1rem; }
.doc-status b span { color: var(--accent); }
.doc-status small { color: var(--muted); font-size: 0.8rem; }
.doc-downloads { flex: 1; min-width: 220px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dl-row { display: flex; gap: 26px 20px; flex-wrap: wrap; justify-content: center; }
.dl-file { padding: 10px 16px; font-size: 0.85rem; flex-direction: column; gap: 0; }
.file-ico {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900;
  margin-bottom: 6px;
}
.file-txt { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.8rem; font-weight: 800; }
.file-txt small { color: var(--muted); font-weight: 500; font-size: 0.7rem; }
.dl-word { background: rgba(43, 87, 154, 0.10); border: 1px solid rgba(43, 87, 154, 0.45); color: #1d3f73; }
.dl-word .file-ico { background: linear-gradient(135deg, #2b579a, #1d3f73); color: #fff; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 1.35rem; }
.dl-word:hover { background: rgba(43, 87, 154, 0.18); border-color: #2b579a; }
.dl-pdf { background: rgba(196, 30, 30, 0.10); border: 1px solid rgba(196, 30, 30, 0.45); color: #8f1212; }
.dl-pdf .file-ico { background: linear-gradient(135deg, #c41e1e, #8f1212); color: #fff; font-size: 0.62rem; letter-spacing: 0.5px; font-family: Arial, sans-serif; }
.dl-pdf:hover { background: rgba(196, 30, 30, 0.16); border-color: #c41e1e; }
.dl-both { font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.dl-both:hover { color: var(--accent-deep); }
.pay-btn { flex: 0 0 auto; }

/* ---------- Previsualización de documento ---------- */
.doc-preview {
  position: fixed; inset: 0;
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}
.doc-preview.open { display: flex; }
.dp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 820px;
  width: 100%;
  max-height: 94vh;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}
.dp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; width: 100%; }
.dp-head b { font-size: 1.1rem; }
.dp-close { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.dp-close:hover { color: var(--text); }
.dp-sheet {
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  width: min(100%, 560px);
  max-height: 58vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.18);
}
.dp-sheet::-webkit-scrollbar { width: 10px; }
.dp-sheet::-webkit-scrollbar-thumb { background: #2b8a8f; border-radius: 6px; }
.dp-inner { padding: 34px 40px; font-size: 0.95rem; }
.dp-page {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.dp-page:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.dp-title {
  font-weight: 800;
  text-align: center;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
  margin-bottom: 18px;
  font-size: 1.05rem;
}
.dp-field { margin-bottom: 12px; }
.dp-field span { font-weight: 700; color: var(--accent-deep); display: inline-block; min-width: 180px; }
.dp-blur { position: relative; }
.dp-blur .dp-page {
  filter: blur(3px);
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}
.dp-blur::after {
  content: "2° parte oculta · descarga para ver";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}
.dp-note { color: #999; font-style: italic; margin-top: 14px; }
.dp-pgwrap { position: relative; margin: 0 0 18px; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 14px rgba(26, 26, 26, 0.12); }
.dp-pgwrap:last-child { margin-bottom: 0; }
.dp-pgwrap canvas { display: block; width: 100%; height: auto; }
.dp-blurlayer {
  position: absolute; left: 0; right: 0; top: 33.33%; bottom: 0;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  background: rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.dp-blur-full { top: 0; }
.dp-blurnote {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.dp-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 18px 0 6px;
  width: 100%;
}
.dp-card .btn { align-self: center; }

/* ---------- Chat animado estilo video (inicio) ---------- */
.chat-auto { max-width: 780px; margin: 0 auto; }
.chat-auto .chat-head { position: relative; }
.chat-auto .chat-stage {
  position: relative;
  /* El alto definitivo lo mide el JS sobre la conversacion COMPLETA y lo fija
     como min-height: la caja tiene siempre el mismo tamano (no crece ni se
     encoge al reiniciar) y nunca hay scroll interno. */
  min-height: 560px;
  padding: 16px 18px;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(43, 138, 143, 0.05), transparent 60%),
    var(--surface);
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* animacion pura: no seleccionable ni copiable */
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
.chat-auto .chat-stage::-webkit-scrollbar { display: none; width: 0; height: 0; }
.chat-auto .msg, .chat-auto .bub, .chat-auto .cite { user-select: text; -webkit-user-select: text; }
.chat-auto .bub a { user-select: none; -webkit-user-select: none; cursor: pointer; }

/* Fundido cruzado al reiniciar: el contenido viejo se desvanece mientras el
   nuevo se escribe encima, asi la ventana NUNCA se ve vacia ni "colapsa".
   Va posicionado en absoluto -> no altera el alto de la caja. */
.chat-auto .chat-ghost {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: 16px 18px;
  pointer-events: none;
  animation: chatGhostOut 0.45s ease both;
}
/* El fantasma es la conversacion ANTERIOR ya terminada: sin animacion de
   entrada (si no reapareceria TranslateY) y sin cursor parpadeando. */
.chat-auto .chat-ghost .msg,
.chat-auto .chat-ghost .typing { animation: none; opacity: 1; transform: none; }
.chat-auto .chat-ghost .caret { display: none; }
@keyframes chatGhostOut { from { opacity: 1; } to { opacity: 0; } }

/* Modo compacto: se activa solo si la conversacion completa no cabe en la
   pantalla. Reduce tipografia y espacios para que se vea ENTERA. */
.chat-auto.chat-dense { font-size: 14px; }
.chat-auto.chat-dense .msg { margin-bottom: 7px; }
.chat-auto.chat-dense .msg .bub { max-width: 92%; padding: 8px 11px; font-size: 0.78rem; line-height: 1.4; }
.chat-auto.chat-dense .msg .cite { margin-top: 5px; padding-top: 5px; font-size: 0.64rem; }
.chat-auto.chat-dense .msg .cite small { margin-top: 0; font-size: 0.92em; }
.chat-auto.chat-dense .msg-doc { margin-top: 6px; padding: 7px 9px; font-size: 0.7rem; }
.chat-auto.chat-dense .msg-doc .price { font-size: 0.8rem; margin-top: 3px; }
.chat-auto.chat-dense .typing { margin-bottom: 7px; }
.chat-auto.chat-dense .typing .dots { padding: 10px 12px; }
.chat-auto.chat-dense .chat-stage,
.chat-auto.chat-dense .chat-ghost { padding: 12px 14px; }

.msg { display: flex; margin-bottom: 9px; animation: msgIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.msg.user { justify-content: flex-end; }
.msg .bub {
  max-width: 90%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.msg.user .bub {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 600;
}
.msg.bot { justify-content: flex-start; }
.msg.bot .bub {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg .bub b { font-weight: 800; }
.msg.user .bub b { color: #fff; }
.msg .cite {
  display: block;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
}
.msg.user .cite { color: #e8f7f8; border-top-color: rgba(255, 255, 255, 0.25); }
.msg .cite small { display: block; color: var(--muted); font-weight: 500; margin-top: 1px; }
.msg.user .cite small { color: rgba(255, 255, 255, 0.8); }

.msg-doc {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px dashed var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 0.78rem;
}
.msg-doc b { color: var(--accent); }
.msg-doc .price { font-size: 0.88rem; font-weight: 900; color: var(--accent); display: block; margin-top: 4px; }

.typing { display: flex; margin-bottom: 9px; animation: msgIn 0.3s ease both; }
.typing .dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  border-bottom-left-radius: 4px;
}
.typing .dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: dotBlink 1.25s infinite ease-in-out;
}
.typing .dots i:nth-child(2) { animation-delay: 0.18s; }
.typing .dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes msgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dotBlink { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-auto-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.chat-auto-foot .replay {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.chat-auto-foot .replay:hover { border-color: var(--accent); color: var(--accent); }
.chat-auto-foot .btn { white-space: nowrap; }

/* cursor parpadeante del efecto escritura */
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: caretBlink 0.85s steps(1) infinite;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.chat-auto-note {
  text-align: center;
  color: var(--muted);
  margin-top: 22px;
  font-size: 0.9rem;
}
.chat-auto-note .copy-hint {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px dashed var(--accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Precios / formularios ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.price-card .cat { text-transform: uppercase; letter-spacing: 1px; font-size: 0.75rem; color: var(--accent); font-weight: 800; }
.price-card h3 { font-size: 1.2rem; }
.price-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.price { font-size: 2rem; font-weight: 900; color: var(--accent); }
.price small { font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.price-card .files { font-size: 0.82rem; color: var(--muted); }
.price-card .files b { color: var(--text); }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(43, 138, 143, 0.25), var(--shadow); }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; margin-left: 8px; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
details summary { cursor: pointer; font-weight: 700; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 50px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center;
  gap: 80px;
  max-width: 980px;
  margin: 0 auto 30px;
}
.site-footer .brand-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.site-footer .brand-footer .brand-logo { height: 76px; }
.site-footer .footer-tagline { font-size: 0.9rem; color: var(--muted); max-width: 280px; }
.footer-grid .col h4 { color: var(--accent); margin-bottom: 14px; font-size: 0.95rem; }
.footer-grid .col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid .col ul a { color: var(--muted); font-size: 0.92rem; }
.footer-grid .col ul a:hover { color: var(--text); }
.footer-grid .social-title { margin-top: 18px; }
.social-links { display: flex; gap: 10px; }
.social-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-btn:hover { transform: translateY(-2px); }
.social-btn[aria-label="Facebook"] { color: #1877f2; border-color: rgba(24, 119, 242, 0.4); }
.social-btn[aria-label="Facebook"]:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn[aria-label="TikTok"] { color: #00f2ea; border-color: rgba(0, 242, 234, 0.35); }
.social-btn[aria-label="TikTok"]:hover { background: #25f4ee; color: #111; border-color: #25f4ee; }
.social-btn[aria-label="Instagram"] { color: #e1306c; border-color: rgba(225, 48, 108, 0.4); }
.social-btn[aria-label="Instagram"]:hover {
  background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  color: #fff; border-color: transparent;
}
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ---------- Page head (páginas internas) ---------- */
.page-head { padding: 70px 0 40px; text-align: center; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.15; }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 640px; margin-inline: auto; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(26, 26, 26, 0.10);
    padding: 10px 22px 18px;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: 0; }
  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    color: var(--text);
  }
  .nav-cta { margin-left: 0; text-align: center; padding: 13px 16px; }
  .brand img.brand-logo { height: 60px; }
  .site-footer .brand-logo { height: 76px; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .hero { padding: 70px 0 50px; }
  .hero-stats { gap: 24px; }
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; justify-items: center; text-align: center; }
  .site-footer .brand-footer { align-items: center; }
  .social-links { justify-content: center; }

  /* Chat y documento */
  .chat-window.chat-lg { max-width: 100%; }
  .bubble { max-width: 92%; }
  .doc-bar { padding: 16px 14px; gap: 14px; }
  .doc-status, .doc-downloads { min-width: 100%; text-align: center; }
  .dl-row { gap: 12px; width: 100%; }
  .dl-file { flex: 1 1 130px; }
  .dp-card { padding: 16px 12px; }
  .dp-sheet { width: 100%; max-height: 52vh; }
  .doc-preview { padding: 12px; }
}

/* ============================================================
   PULIDO VISUAL (octubre 2026)
   - sombras más suaves y jerarquía de superficies
   - foco visible consistente en todos los enlaces y botones
   - CTA fijo solo en móvil, sin pisar el composer del chat
   - aparición suave al hacer scroll (si el usuario no pide menos movimiento)
   ============================================================ */

:root {
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04), 0 4px 12px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 2px 4px rgba(26, 26, 26, 0.04), 0 12px 28px rgba(26, 26, 26, 0.07);
  --shadow-lg: 0 24px 60px rgba(26, 26, 26, 0.10);
  --radius-sm: 10px;
  --radius-lg: 18px;
  --focus: 0 0 0 3px rgba(43, 138, 143, 0.35);
}

/* tarjetas: sombra de base, más presión al pasar el cursor */
.card, .step, .task-card { box-shadow: var(--shadow-sm); }
.card:hover, .step:hover { box-shadow: var(--shadow-md); }
.card.team[href]:hover { box-shadow: var(--shadow-lg); }

/* tipografía: títulos balanceados y más aire */
h1, h2, h3 { text-wrap: balance; }
h2 { letter-spacing: -0.3px; }

/* foco visible uniforme (accesibilidad) */
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}
.btn, .nav-cta { border-radius: var(--radius-sm); }

/* header con separación más fina */
.site-header { box-shadow: 0 1px 0 rgba(26, 26, 26, 0.03), 0 10px 24px rgba(26, 26, 26, 0.04); }

/* estadísticas del hero como fichas */
.hero-stats .stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 22px;
  box-shadow: var(--shadow-sm);
}
.hero-trust { margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.hero-trust b { color: var(--text); }

/* botón fijo solo en pantallas chicas */
.cta-movil { display: none; }
@media (max-width: 700px) {
  .cta-movil {
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 60;
    display: flex;
    justify-content: center;
  }
  .cta-movil .btn {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(43, 138, 143, 0.45);
  }
  body:has(.cta-movil) { padding-bottom: 86px; }
}

/* aparición suave al hacer scroll (solo si no pidió menos movimiento).
   La clase .reveal-ready la pone el JS: si el script no carga o falla,
   el contenido se ve siempre, nunca queda oculto. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .reveal-ready [data-reveal].reveal-on { opacity: 1; transform: none; }
}


/* ---------- Especialistas: etiquetas, chips y avisos ---------- */
.card.team .tags {
  display: block;
  margin-top: 10px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card.team .photo { border-bottom: 1px solid var(--border); }
.team-note {
  margin: 34px auto 0;
  max-width: 780px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.ia-chip {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px solid rgba(43, 138, 143, 0.3);
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 2px 0 6px;
}

/* ---------- Catálogo: enlace "Pagar este formulario" ---------- */
.price-card .pay-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-deep);
}
.price-card .pay-link:hover { color: var(--accent); }