/**
 * Legal pages (/aviso-legal, /politica-privacidad)
 * Self-contained: defines its own .tl-* base so it never depends on
 * tools-redesign.css being loaded (which it isn't on these routes).
 */

/* ============================================================
   Tokens + base layout (.tl-* / .lg-*)
   ============================================================ */
.lg-page {
  --tl-primary: #e61c72;
  --tl-primary-dark: #b51358;
  --tl-primary-light: #ff4d94;
  --tl-text-1: #0f172a;
  --tl-text-2: #475569;
  --tl-text-3: #94a3b8;
  --tl-border: #e5e7eb;
  --tl-border-soft: #f1f5f9;
  --tl-surface: #ffffff;
  --tl-surface-soft: #fafafa;
  --tl-success: #10b981;

  background: #fff;
  color: var(--tl-text-1);
  font-family: 'Inter', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  display: block;
}
.lg-page *, .lg-page *::before, .lg-page *::after { box-sizing: border-box; }
.lg-page a { text-decoration: none; }
.lg-page img, .lg-page svg { max-width: 100%; }

.lg-page .tl-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.lg-page .tl-hero {
  padding: 56px 0 36px;
  background: var(--tl-surface-soft);
  border-bottom: 1px solid var(--tl-border);
}
.lg-page .tl-hero-inner { max-width: 760px; }
.lg-page .tl-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(230, 28, 114, 0.08);
  color: var(--tl-primary);
  border: 1px solid rgba(230, 28, 114, 0.2);
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.lg-page .tl-eyebrow svg { width: 13px; height: 13px; }
.lg-page .tl-hero h1 {
  font-size: clamp(1.85rem, 3.8vw, 2.65rem);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
  margin: 0 0 14px;
  color: var(--tl-text-1);
}
.lg-page .tl-hero h1 .accent {
  background: linear-gradient(135deg, #e61c72, #ff4d94);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lg-page .tl-hero p.tl-lead {
  font-size: 1.04rem;
  color: var(--tl-text-2);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 620px;
}
.lg-page .tl-meta-row {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--tl-text-2); font-weight: 600;
}
.lg-page .tl-meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.lg-page .tl-meta-row svg { color: var(--tl-success); width: 16px; height: 16px; }

/* Generic sections */
.lg-page .tl-section { padding: 48px 0; }
.lg-page .tl-section.alt {
  background: var(--tl-surface-soft);
  border-top: 1px solid var(--tl-border);
  border-bottom: 1px solid var(--tl-border);
}

/* ============================================================
   Trust grid (hero, only on privacy page)
   ============================================================ */
.lg-trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 24px;
}
.lg-trust {
  background: #fff; padding: 14px 16px;
  border: 1px solid var(--tl-border); border-radius: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.lg-trust svg { width: 22px; height: 22px; color: var(--tl-primary); }
.lg-trust strong { font-size: 0.92rem; font-weight: 700; color: var(--tl-text-1); }
.lg-trust span { font-size: 0.78rem; color: var(--tl-text-2); line-height: 1.4; }
@media (max-width: 880px) { .lg-trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .lg-trust-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Body layout: TOC sidebar + content article
   ============================================================ */
.lg-body { padding: 48px 0; }
.lg-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 48px;
  align-items: start;
}
@media (max-width: 960px) {
  .lg-grid { grid-template-columns: 1fr; gap: 24px; }
}

.lg-toc-sticky { position: sticky; top: 80px; }
@media (max-width: 960px) {
  .lg-toc-sticky {
    position: static;
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    border-radius: 14px;
    padding: 16px 18px;
  }
}
.lg-toc-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase;
  color: var(--tl-text-3) !important;
  margin: 0 0 12px !important;
}
.lg-toc-list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: lg-toc;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.88rem;
}
.lg-toc-list li {
  counter-increment: lg-toc;
  position: relative;
}
.lg-toc-list a {
  display: block;
  padding: 7px 10px 7px 32px;
  color: var(--tl-text-2);
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.35;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.lg-toc-list a::before {
  content: counter(lg-toc, upper-roman);
  position: absolute; left: 8px; top: 7px;
  font-size: 0.72rem; font-weight: 800; color: var(--tl-text-3);
  letter-spacing: 0.3px;
}
.lg-toc-list a:hover {
  background: var(--tl-surface-soft);
  color: var(--tl-text-1);
}
.lg-toc-list a.is-active {
  background: rgba(230, 28, 114, 0.08);
  color: var(--tl-primary);
}
.lg-toc-list a.is-active::before { color: var(--tl-primary); }

/* ============================================================
   Content article — typography
   ============================================================ */
.lg-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--tl-text-2);
  max-width: 760px;
}
.lg-content section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--tl-border-soft);
}
.lg-content section:last-child { border-bottom: 0; padding-bottom: 0; }

.lg-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--tl-text-1);
  margin: 0 0 14px;
  padding-top: 8px;
  scroll-margin-top: 80px;
}
.lg-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tl-text-1);
  margin: 22px 0 8px;
}
.lg-content p { margin: 0 0 14px; }
.lg-content p:last-child { margin-bottom: 0; }

.lg-content ul, .lg-content ol { margin: 0 0 14px; padding-left: 22px; }
.lg-content li { margin-bottom: 6px; }
.lg-content li::marker { color: var(--tl-text-3); }

.lg-content strong { color: var(--tl-text-1); font-weight: 700; }
.lg-content a {
  color: var(--tl-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.lg-content a:hover { color: var(--tl-primary-dark); }

/* Hide legacy header block left over from the old terms HTML */
.lg-content header { display: none; }

.lg-content blockquote {
  margin: 14px 0;
  padding: 12px 16px;
  background: rgba(230, 28, 114, 0.05);
  border-left: 3px solid var(--tl-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  color: var(--tl-text-1);
}
.lg-content blockquote p:last-child { margin-bottom: 0; }

/* ============================================================
   Tables — zebra, sticky-feel header, dense
   ============================================================ */
.lg-content table.lg-table,
.lg-content .lg-table-wrap > table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 18px 0; font-size: 0.93rem;
  border: 1px solid var(--tl-border);
  border-radius: 12px; overflow: hidden;
  background: #fff;
}
.lg-content .lg-table-wrap { overflow-x: auto; margin: 18px 0; -webkit-overflow-scrolling: touch; }
.lg-content .lg-table-wrap > table { margin: 0; }
.lg-content table.lg-table th,
.lg-content .lg-table-wrap > table th {
  background: var(--tl-surface-soft);
  font-weight: 700; color: var(--tl-text-1);
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--tl-border);
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.35px;
  white-space: nowrap;
}
.lg-content table.lg-table td,
.lg-content .lg-table-wrap > table td {
  padding: 12px 14px; border-bottom: 1px solid var(--tl-border-soft);
  vertical-align: top; color: var(--tl-text-2);
}
.lg-content table.lg-table tr:nth-child(even) td,
.lg-content .lg-table-wrap > table tr:nth-child(even) td {
  background: var(--tl-surface-soft);
}
.lg-content table.lg-table tr:last-child td,
.lg-content .lg-table-wrap > table tr:last-child td { border-bottom: 0; }
.lg-content table.lg-table strong,
.lg-content .lg-table-wrap > table strong { color: var(--tl-text-1); }

/* Fallback for raw <table> without class — same style */
.lg-content table:not(.lg-table) {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 18px 0; font-size: 0.93rem;
  border: 1px solid var(--tl-border); border-radius: 12px; overflow: hidden;
  background: #fff;
}
.lg-content table:not(.lg-table) th {
  background: var(--tl-surface-soft);
  font-weight: 700; color: var(--tl-text-1);
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--tl-border);
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.35px;
}
.lg-content table:not(.lg-table) td {
  padding: 12px 14px; border-bottom: 1px solid var(--tl-border-soft);
  vertical-align: top; color: var(--tl-text-2);
}
.lg-content table:not(.lg-table) tr:nth-child(even) td { background: var(--tl-surface-soft); }
.lg-content table:not(.lg-table) tr:last-child td { border-bottom: 0; }

/* ============================================================
   Callouts (info / warning / danger / success / note)
   Usage:  <aside class="lg-callout lg-callout--warning">…</aside>
   ============================================================ */
.lg-callout {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px;
  align-items: start;
  margin: 18px 0; padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid;
  background: #fff;
  font-size: 0.93rem; line-height: 1.6;
}
.lg-callout::before {
  content: ''; width: 22px; height: 22px;
  background-repeat: no-repeat; background-position: center; background-size: 22px;
  margin-top: 1px;
}
.lg-callout-title {
  display: block;
  font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 0 0 4px;
}
.lg-callout p { margin: 0 0 8px; }
.lg-callout p:last-child { margin-bottom: 0; }
.lg-callout ul, .lg-callout ol { margin: 6px 0 0; padding-left: 20px; }
.lg-callout strong { color: inherit; }

/* info — primary tone */
.lg-callout--info {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.06);
}
.lg-callout--info .lg-callout-title { color: #1d4ed8; }
.lg-callout--info::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='16' x2='12' y2='12'/><line x1='12' y1='8' x2='12.01' y2='8'/></svg>");
}

/* warning — amber */
.lg-callout--warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.07);
}
.lg-callout--warning .lg-callout-title { color: #b45309; }
.lg-callout--warning::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
}

/* danger — red, also used as legal "prohibition" callout */
.lg-callout--danger {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}
.lg-callout--danger .lg-callout-title { color: #b91c1c; }
.lg-callout--danger::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='4.93' y1='4.93' x2='19.07' y2='19.07'/></svg>");
}

/* success — green */
.lg-callout--success {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
}
.lg-callout--success .lg-callout-title { color: #047857; }
.lg-callout--success::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/><polyline points='22 4 12 14.01 9 11.01'/></svg>");
}

/* note — neutral pink/primary tone */
.lg-callout--note {
  border-color: rgba(230, 28, 114, 0.22);
  background: rgba(230, 28, 114, 0.05);
}
.lg-callout--note .lg-callout-title { color: var(--tl-primary-dark); }
.lg-callout--note::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b51358' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/><line x1='16' y1='13' x2='8' y2='13'/><line x1='16' y1='17' x2='8' y2='17'/></svg>");
}

/* ============================================================
   Key-value rows (data dump used for "datos del titular", etc.)
   ============================================================ */
.lg-kv {
  margin: 14px 0;
  background: #fff;
  border: 1px solid var(--tl-border);
  border-radius: 12px;
  overflow: hidden;
}
.lg-kv-row {
  display: grid; grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--tl-border-soft);
}
.lg-kv-row:last-child { border-bottom: 0; }
.lg-kv-row dt {
  padding: 11px 14px;
  background: var(--tl-surface-soft);
  font-size: 0.82rem; font-weight: 700;
  color: var(--tl-text-1); text-transform: uppercase; letter-spacing: 0.35px;
  border-right: 1px solid var(--tl-border-soft);
}
.lg-kv-row dd {
  padding: 11px 14px; margin: 0;
  color: var(--tl-text-2); font-size: 0.93rem; line-height: 1.5;
}
@media (max-width: 640px) {
  .lg-kv-row { grid-template-columns: 1fr; }
  .lg-kv-row dt { border-right: 0; border-bottom: 1px solid var(--tl-border-soft); }
}

/* ============================================================
   KPI cards (used in the privacy "trust" mini-stats inside body)
   ============================================================ */
.lg-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 18px 0;
}
.lg-kpi {
  background: #fff;
  border: 1px solid var(--tl-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.lg-kpi-num {
  font-size: 1.45rem; font-weight: 800; color: var(--tl-text-1);
  background: linear-gradient(135deg, #e61c72, #ff4d94);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1; margin: 0 0 4px;
}
.lg-kpi-label {
  font-size: 0.78rem; color: var(--tl-text-2); line-height: 1.4;
}
@media (max-width: 640px) { .lg-kpis { grid-template-columns: 1fr; } }

/* ============================================================
   Inline badges
   ============================================================ */
.lg-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  font-size: 0.72rem; font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.3px;
  vertical-align: middle;
  white-space: nowrap;
}
.lg-badge--ok   { background: rgba(16, 185, 129, .12); color: #047857; }
.lg-badge--warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.lg-badge--info { background: rgba(59, 130, 246, .12); color: #1d4ed8; }
.lg-badge--danger { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.lg-badge--neutral { background: var(--tl-surface-soft); color: var(--tl-text-2); border: 1px solid var(--tl-border); }
.lg-badge--legal { background: rgba(230, 28, 114, .08); color: var(--tl-primary); }

/* ============================================================
   Definition list (used for glossary-style content)
   ============================================================ */
.lg-content dl:not(.lg-kv) {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  margin: 14px 0;
}
.lg-content dl:not(.lg-kv) dt {
  font-weight: 700; color: var(--tl-text-1);
  font-size: 0.95rem; margin-top: 4px;
}
.lg-content dl:not(.lg-kv) dd {
  margin: 0 0 4px;
  padding-left: 14px;
  border-left: 2px solid var(--tl-border);
  color: var(--tl-text-2);
}

/* ============================================================
   Highlight box for legal-reference paragraphs ("Art. 102…")
   ============================================================ */
.lg-legal-ref {
  display: inline-block;
  padding: 1px 7px;
  background: var(--tl-surface-soft);
  border: 1px solid var(--tl-border);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tl-text-2);
  font-family: 'SF Mono', Consolas, ui-monospace, monospace;
}

/* ============================================================
   Checklist (success ticks)
   ============================================================ */
.lg-checklist { list-style: none; padding: 0; margin: 12px 0; }
.lg-checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--tl-border-soft);
}
.lg-checklist li:last-child { border-bottom: 0; }
.lg-checklist li::before {
  content: ''; flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat; background-position: center;
}
.lg-checklist.lg-checklist--no li::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}

/* ============================================================
   Cross-promo block
   ============================================================ */
.lg-cross {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 26px;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: 16px;
}
.lg-cross-icon {
  flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(230, 28, 114, 0.08); color: var(--tl-primary);
  display: flex; align-items: center; justify-content: center;
}
.lg-cross-icon svg { width: 22px; height: 22px; }
.lg-cross-text { flex: 1; min-width: 0; }
.lg-cross-text h3 {
  margin: 0 0 4px;
  font-size: 1.02rem; font-weight: 700; color: var(--tl-text-1);
}
.lg-cross-text p {
  margin: 0; font-size: 0.9rem; color: var(--tl-text-2); line-height: 1.5;
}
.lg-cross-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #e61c72, #ff4d94);
  color: #fff !important;
  font-weight: 700; font-size: 0.88rem;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(230, 28, 114, 0.25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.lg-cross-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 28, 114, 0.32);
  color: #fff !important;
}
.lg-cross-btn svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .lg-cross { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
  .lg-cross-btn { width: 100%; justify-content: center; padding: 12px 18px; }
}

/* ============================================================
   Mobile polish
   ============================================================ */
@media (max-width: 640px) {
  .lg-page .tl-container { padding: 0 16px; }
  .lg-page .tl-hero { padding: 38px 0 26px; }
  .lg-body { padding: 32px 0; }
  .lg-page .tl-section { padding: 36px 0; }
  .lg-content { font-size: 0.96rem; line-height: 1.65; }
  .lg-content h2 { font-size: 1.2rem; }
  .lg-content h3 { font-size: 0.98rem; }
  .lg-content section { margin-bottom: 28px; padding-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-toc-list a, .lg-cross-btn { transition: none !important; }
}
