/* Chatbot IA · páginas legales (términos, privacidad, eliminación de datos)
   Se apoya en assets/tema.css: mismos colores, vidrio y tipografía. */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { font-size: 16px; line-height: 1.7; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }

.top { position: sticky; top: 0; z-index: 50; background: rgba(5, 22, 30, .84); border-bottom: 1px solid var(--edge); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.marca img:first-child { height: 32px; width: auto; } .marca img:last-child { height: 14px; width: auto; }
.bar nav { display: flex; align-items: center; gap: 6px; }
.bar nav a { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-2); padding: 9px 14px; border-radius: 999px; transition: color .3s, background .3s; }
.bar nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.bar nav a[aria-current="page"] { color: #fff; background: rgba(31,181,160,.24); }

.legal-hero { padding: clamp(36px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); }
.legal-hero .kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.legal-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; letter-spacing: -.035em !important; margin: 10px 0 12px; }
.legal-hero p { color: var(--text-2); max-width: 64ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.meta span { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(255,255,255,.05); color: var(--text-2); }

.borrador { margin: 0 0 22px; padding: 16px 18px; border-radius: 18px; border: 1px solid rgba(255,198,90,.55); background: rgba(255,198,90,.1); color: #ffe3a8; font-size: 14.5px; }
.borrador b { color: #fff; }
.ph { background: rgba(255,198,90,.18); color: #ffe3a8; border-radius: 6px; padding: 0 5px; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 72px; }
.toc { position: sticky; top: 92px; padding: 18px !important; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; display: grid; gap: 2px; counter-reset: t; }
.toc a { display: block; font-size: 13.5px; line-height: 1.35; text-decoration: none; color: var(--text-2); padding: 7px 10px; border-radius: 10px; transition: background .3s, color .3s; }
.toc a:hover { background: rgba(255,255,255,.08); color: #fff; }

.doc { padding: clamp(22px, 4vw, 44px) !important; }
.doc section + section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--edge); }
.doc h2 { font-size: clamp(21px, 2.4vw, 25px); line-height: 1.25; letter-spacing: -.02em !important; margin-bottom: 12px; }
.doc h3 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.doc p, .doc li { color: var(--text-2); }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 22px; margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.doc strong { color: #fff; font-weight: 600; }
.doc a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(34,211,238,.6); }
.doc a:hover { text-decoration-color: var(--cyan); }
.doc table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--edge); }
.doc th { color: #fff; font-weight: 600; background: rgba(255,255,255,.04); }
.doc td { color: var(--text-2); }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--edge); }
.table-wrap table { margin: 0; }
.nota { margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--edge-strong); background: linear-gradient(135deg, rgba(31,181,160,.16), rgba(43,134,201,.12)); color: var(--text-2); font-size: 15px; }
.leyenda { margin-top: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(255,255,255,.04); font-size: 14.5px; }
.pasos { counter-reset: paso; list-style: none; padding: 0 !important; gap: 12px !important; }
.pasos li { position: relative; padding: 14px 16px 14px 58px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(255,255,255,.04); }
.pasos li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--teal-deep), var(--blue-deep)); }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.acciones .btn-primary, .acciones .btn-secondary { min-height: 46px; padding: 0 22px; font-size: 15px; }

footer.pie { border-top: 1px solid var(--edge); padding: 30px 0 calc(30px + env(safe-area-inset-bottom, 0px)); }
.pie-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; font-size: 14px; color: var(--text-3); }
.pie-in nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pie-in nav a { text-decoration: none; color: var(--text-2); } .pie-in nav a:hover { color: #fff; }

@media (max-width: 900px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
  .bar nav a:not([aria-current]) { display: none; }
}
@media (max-width: 640px) {
  /* tablas como tarjetas apiladas: en el celular no hay que deslizarlas de costado */
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .table-wrap thead { display: none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap tr { padding: 14px 16px; border: 1px solid var(--edge); border-radius: 16px; background: rgba(255,255,255,.04); }
  .table-wrap tr + tr { margin-top: 10px; }
  .doc .table-wrap td { padding: 0; border: 0; }
  .doc .table-wrap td:first-child { color: #fff; font-weight: 600; margin-bottom: 4px; }
  .doc .table-wrap td:nth-child(3) { margin-top: 6px; font-size: 13.5px; color: var(--text-3); }
  .table-wrap td:nth-child(3)::before { content: "Dónde: "; font-weight: 600; }
  .table-wrap td:nth-child(3):lang(en)::before { content: "Location: "; }
}
@media (max-width: 400px) {
  /* solo queda el link de la página actual: en pantallas angostas se oculta para que entre el logo */
  .bar nav { display: none; }
}
@media print {
  body::before, .top, .toc, footer.pie, .borrador { display: none !important; }
  body, html { background: #fff !important; color: #000 !important; }
  .doc { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .doc p, .doc li, .doc td, .doc h2, .doc h3, .doc strong, .doc a { color: #000 !important; }
  .legal-grid { display: block; }
}
