/* ==========================================================================
   System Cupidy — Centro legal
   ========================================================================== */

/* ---------- Hero ---------- */
.legal-hero { position: relative; padding: calc(var(--header-h) + 64px) 0 8px; overflow: hidden; }
.legal-hero__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent);
}
.legal-hero .blob--1 { width: 520px; height: 520px; right: -140px; top: -200px; opacity: .4; }
.legal-hero .blob--2 { width: 380px; height: 380px; right: 30%; top: -160px; opacity: .22; }
.legal-hero .hero__grid { -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 20%, transparent 70%); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--dim); font-size: .85rem; }
.crumbs a { transition: color .3s; }
.crumbs a:hover { color: var(--text); }
.crumbs span[aria-hidden] { opacity: .5; }

.legal-hero__head { display: flex; align-items: flex-start; gap: 22px; }
.legal-hero__icon {
  display: grid; place-items: center; flex: none; width: 68px; height: 68px; border-radius: 22px;
  background: var(--grad); box-shadow: 0 18px 40px -12px rgba(255, 61, 129, .55);
}
.legal-hero__icon .ico { width: 30px; height: 30px; color: #fff; }
.legal-hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); letter-spacing: -.045em; line-height: 1.04; max-width: 18ch; }
.legal-hero__lead { margin-top: 16px; max-width: 58ch; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.12rem); }

.legal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--glass); color: var(--muted); font-size: .84rem;
}
.meta-chip .ico { width: 15px; height: 15px; color: var(--cyan); }
.meta-chip b { color: var(--text); font-weight: 600; }

/* ---------- Document tabs ---------- */
.doc-tabs {
  display: flex; gap: 8px; margin-top: 36px; padding: 6px; border-radius: 999px; width: fit-content; max-width: 100%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); font-size: .88rem; font-weight: 500; white-space: nowrap;
  transition: color .3s, background-color .3s;
}
.doc-tabs a .ico { width: 16px; height: 16px; }
.doc-tabs a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.doc-tabs a[aria-current="page"] { color: #fff; background: var(--grad); box-shadow: 0 8px 24px -10px rgba(255, 61, 129, .7); }

/* ---------- Quick summary ---------- */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.summary__item {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
}
.summary__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(140deg, rgba(255, 61, 129, .22), rgba(139, 92, 246, .22)); border: 1px solid rgba(255, 255, 255, .1);
}
.summary__icon .ico { width: 21px; height: 21px; color: #ffb3cf; }
.summary__item strong { font-family: var(--f-display); font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.summary__item span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.summary-label {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 44px; color: var(--dim);
  font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.summary-label + .summary { margin-top: 14px; }

/* ---------- Layout: TOC + prose ---------- */
.legal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; align-items: start; padding: 56px 0 110px; }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .1) transparent; }
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.toc__title, .toc-mobile summary {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--dim);
  font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.toc__title .ico, .toc-mobile summary .ico { width: 15px; height: 15px; }
.toc ol, .toc-mobile ol { display: grid; border-left: 1px solid var(--line); counter-reset: toc; }
.toc a, .toc-mobile a {
  display: block; margin-left: -1px; padding: 7px 14px; border-left: 2px solid transparent;
  color: var(--dim); font-size: .88rem; line-height: 1.4; counter-increment: toc;
  transition: color .3s, border-color .3s;
}
.toc a::before, .toc-mobile a::before { content: counter(toc, decimal-leading-zero) "  "; font-family: var(--f-mono); font-size: .72rem; opacity: .7; white-space: pre; }
.toc a:hover, .toc-mobile a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); border-left-color: var(--pink); }

.toc-mobile { display: none; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); padding: 16px 18px; }
.toc-mobile summary { margin: 0; cursor: pointer; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.toc-mobile[open] summary::after { content: "–"; }
.toc-mobile ol { margin-top: 14px; }

.prose { max-width: 780px; color: #cfcbe6; font-size: 1.02rem; line-height: 1.78; counter-reset: sec; }
.prose section { scroll-margin-top: 96px; padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.prose section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.prose h2 {
  counter-increment: sec; display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px;
  color: var(--text); font-size: clamp(1.35rem, 2.4vw, 1.75rem); letter-spacing: -.025em; line-height: 1.2;
}
.prose h2::before {
  content: counter(sec, decimal-leading-zero); flex: none; font-family: var(--f-mono); font-size: .8rem; font-weight: 500;
  color: var(--pink); letter-spacing: .05em; transform: translateY(-3px);
}
.prose h3 { margin: 26px 0 8px; color: var(--text); font-size: 1.1rem; letter-spacing: -.01em; }
.prose p + p, .prose p + ul, .prose ul + p, .prose ol + p, .prose p + ol { margin-top: 14px; }
.prose ul, .prose ol { display: grid; gap: 8px; margin-top: 12px; }
.prose ul li { position: relative; padding-left: 24px; }
.prose ul li::before {
  content: ""; position: absolute; left: 5px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--grad);
}
.prose ol { counter-reset: li; }
.prose ol li { position: relative; padding-left: 32px; counter-increment: li; }
.prose ol li::before { content: counter(li) "."; position: absolute; left: 4px; top: .1em; font-family: var(--f-mono); font-size: .85rem; font-weight: 500; color: var(--violet); }
.prose a { color: #f9a8d4; text-decoration: underline; text-decoration-color: rgba(249, 168, 212, .4); text-underline-offset: 3px; transition: color .3s; }
.prose a:hover { color: #fff; }
.prose strong { color: var(--text); font-weight: 600; }
.prose .caps { text-transform: uppercase; font-size: .92em; letter-spacing: .01em; }

.callout {
  display: flex; gap: 14px; margin: 18px 0; padding: 18px 20px; border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, .35); background: rgba(139, 92, 246, .08); color: #ddd9f5;
}
.callout > .ico { width: 22px; height: 22px; margin-top: 3px; color: #c4b5fd; }
.callout--pink { border-color: rgba(255, 61, 129, .35); background: rgba(255, 61, 129, .07); }
.callout--pink > .ico { color: #f9a8d4; }
.callout--green { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .07); }
.callout--green > .ico { color: var(--green); }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.55; }
.prose th, .prose td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); font-family: var(--f-display); font-weight: 600; background: rgba(255, 255, 255, .035); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); font-weight: 500; }

.doc-contact {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-top: 56px;
  padding: 28px; border-radius: 24px; border: 1px solid var(--line-2);
  background: radial-gradient(80% 140% at 100% 0%, rgba(255, 61, 129, .18), transparent 60%),
              radial-gradient(60% 120% at 0% 100%, rgba(34, 211, 238, .12), transparent 60%), var(--bg-2);
}
.doc-contact h3 { font-size: 1.3rem; margin: 0; }
.doc-contact p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Hub ---------- */
.legal-hub { padding: 48px 0 110px; }
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.doc-card {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 14px;
  min-height: 250px; padding: 28px; border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s var(--ease);
}
.doc-card:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: 0 30px 60px -30px rgba(139, 92, 246, .5); }
.doc-card > * { position: relative; z-index: 1; }
.doc-card__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: var(--grad); box-shadow: 0 14px 30px -12px rgba(255, 61, 129, .6); }
.doc-card__icon .ico { width: 25px; height: 25px; color: #fff; }
.doc-card h3 { font-size: 1.3rem; margin-top: 8px; }
.doc-card p { color: var(--muted); font-size: .94rem; }
.doc-card__go { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; font-family: var(--f-display); font-weight: 600; font-size: .9rem; }
.doc-card__go .ico { width: 17px; height: 17px; transition: transform .4s var(--ease); }
.doc-card:hover .doc-card__go .ico { transform: translateX(4px); }

.hub-bottom { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-top: 18px; }
.info-card { padding: 30px; border-radius: 26px; border: 1px solid var(--line); background: var(--glass); }
.info-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 20px; }
.info-card h3 .ico { width: 20px; height: 20px; color: var(--pink); }
.company-dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; font-size: .95rem; }
.company-dl dt { color: var(--dim); }
.company-dl dd { margin: 0; color: var(--text); }
.company-dl a { color: #f9a8d4; }
.info-card p { color: var(--muted); font-size: .95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .hub-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .legal-hero { padding-top: calc(var(--header-h) + 36px); }
  .legal-hero__head { flex-direction: column; gap: 18px; }
  .legal-hero__icon { width: 56px; height: 56px; border-radius: 18px; }
  .legal-hero__icon .ico { width: 25px; height: 25px; }
  .doc-tabs { border-radius: 18px; width: auto; margin-inline: calc(var(--gutter) * -1); border-left: 0; border-right: 0; border-radius: 0; padding: 6px var(--gutter); }
  .summary { gap: 10px; }
  .summary__item { padding: 16px; gap: 10px; border-radius: 18px; }
  .summary__item span { font-size: .82rem; }
  .prose { font-size: .98rem; }
  .prose section { padding-bottom: 32px; margin-bottom: 32px; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-card { min-height: 0; }

  /* Tablas como tarjetas apiladas */
  .table-wrap { overflow: visible; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .prose tr:last-child { border-bottom: 0; }
  .prose td { padding: 0; border: 0; }
  .prose td:first-child { margin-bottom: 6px; font-family: var(--f-display); font-weight: 600; }
  .prose td + td { margin-top: 6px; }
  .prose td + td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px; color: var(--dim);
    font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  }
  .doc-contact { padding: 22px; }
  .doc-contact .btn { width: 100%; }
  .company-dl { grid-template-columns: 1fr; gap: 2px; }
  .company-dl dd { margin-bottom: 10px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #111; }
  body::before, .header, .mobile-menu, .scroll-progress, .cursor-glow, .fab, .toast, .toc, .toc-mobile, .doc-tabs, .legal-hero__bg, .footer, .doc-contact, .skip-link { display: none !important; }
  .legal-hero { padding-top: 0; }
  .legal-layout { display: block; padding: 0; }
  .prose, .prose strong, .prose h2, .prose h3, .legal-hero h1, .summary__item strong { color: #111; }
  .legal-hero__lead, .summary__item span, .meta-chip { color: #333; }
  .grad-text { color: #111; background: none; -webkit-text-fill-color: currentColor; }
  .prose a { color: #111; }
}
