/* ============================================================
   TURNNIA — Documentos legales (cookies, privacidad, términos,
   cancelaciones y contacto). Prefijos: .ld- (documento) · .ct- (contacto)
   Reutiliza los tokens de css/styles.css. Las páginas se generan con
   scripts/build-legal-pages.js.
   ============================================================ */

.ld-main { padding-bottom: clamp(64px, 12vw, 120px); }

/* ------------------------------ Hero ------------------------------ */
.ld-hero {
  padding-top: calc(var(--header-h) + clamp(30px, 6vw, 68px));
  padding-bottom: clamp(20px, 4vw, 34px);
}
.ld-wrap { max-width: 780px; margin-inline: auto; }
.ld-eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.ld-hero h1 {
  margin-top: 14px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.2vw, 2.9rem);
  letter-spacing: -.025em;
  line-height: 1.1;
}
.ld-lead { margin-top: 16px; color: var(--ink-soft); font-size: 1.04rem; max-width: 62ch; }
.ld-meta { margin-top: 14px; color: var(--muted); font-size: .85rem; }
.ld-meta strong { color: var(--ink-soft); font-weight: 600; }

.ld-switch {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px;
}
.ld-switch a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  color: var(--ink-soft); text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.ld-switch a:hover { border-color: var(--ink); color: var(--ink); }
.ld-switch a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------ Índice ------------------------------ */
.ld-toc {
  margin: 0 0 clamp(26px, 5vw, 40px);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.ld-toc h2 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.ld-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px 24px; grid-template-columns: 1fr; counter-reset: toc; }
@media (min-width: 640px) { .ld-toc ol { grid-template-columns: 1fr 1fr; } }
.ld-toc li { counter-increment: toc; }
.ld-toc a {
  display: block; padding: 5px 0; font-size: .92rem; color: var(--ink-soft); text-decoration: none;
}
.ld-toc a::before { content: counter(toc, decimal-leading-zero) "  "; color: var(--muted-2); font-family: var(--font-head); font-weight: 600; font-size: .78rem; }
.ld-toc a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------ Cuerpo ------------------------------ */
.ld-body { max-width: 780px; margin-inline: auto; }
.ld-sec { padding: clamp(22px, 4vw, 32px) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 14px); }
.ld-sec:first-of-type { border-top: 0; padding-top: 0; }
.ld-sec h2 {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 12px;
}
.ld-sec h3 {
  margin: 20px 0 8px;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
}
.ld-sec p, .ld-sec li { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.ld-sec p { margin: 0 0 12px; }
.ld-sec ul, .ld-sec ol { margin: 0 0 14px; padding-left: 1.25em; }
.ld-sec li { margin: 4px 0; }
.ld-sec a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ld-sec strong { color: var(--ink); font-weight: 600; }

.ld-callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--ink);
  background: var(--bg-2);
  border-radius: 0 12px 12px 0;
}
.ld-callout p { margin: 0; }
.ld-callout p + p { margin-top: 8px; }
.ld-callout--soft { border-left-color: var(--muted-2); }

/* Tablas (cookies / datos) */
.ld-table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 14px; }
.ld-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .88rem; }
.ld-table th, .ld-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink-soft); line-height: 1.5; }
.ld-table th { background: var(--bg-2); font-family: var(--font-head); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ld-table tr:last-child td { border-bottom: 0; }
.ld-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--bg-3); padding: 1px 5px; border-radius: 5px; color: var(--ink); word-break: break-all; }
.ld-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; font-family: var(--font-head); white-space: nowrap; }
.ld-tag--nec { background: #e9f6ee; color: #0b5a29; }
.ld-tag--opt { background: #fff3dc; color: #7a4b00; }

.ld-pending {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #fff3dc; color: #7a4b00; font-size: .8rem; font-weight: 600;
}

/* ------------------------------ Contacto ------------------------------ */
.ct-grid { display: grid; gap: 28px; max-width: 980px; margin-inline: auto; }
@media (min-width: 900px) { .ct-grid { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.ct-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3.5vw, 28px); background: #fff; box-shadow: var(--shadow-sm); }
.ct-card h2 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 14px; }
.ct-field { margin-bottom: 14px; }
.ct-field label { display: block; margin-bottom: 6px; font-family: var(--font-head); font-weight: 600; font-size: .86rem; color: var(--ink); }
.ct-field input, .ct-field select, .ct-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-size: .96rem;
}
.ct-field textarea { min-height: 150px; resize: vertical; }
.ct-field input:focus, .ct-field select:focus, .ct-field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.ct-field small { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.ct-count { text-align: right; }
.ct-error { color: #b3261e; font-size: .84rem; margin-top: 5px; min-height: 1em; }
.ct-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ct-msg { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .92rem; display: none; }
.ct-msg.is-ok { display: block; background: #e9f6ee; color: #0b5a29; }
.ct-msg.is-err { display: block; background: #fdecea; color: #8a1c14; }
.ct-turnstile { margin: 4px 0 14px; min-height: 65px; }
.ct-side p, .ct-side li { color: var(--ink-soft); font-size: .94rem; line-height: 1.65; }
.ct-side ul { padding-left: 1.2em; margin: 8px 0 14px; }
.ct-side a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.ct-side h3 { font-family: var(--font-head); font-size: 1rem; margin: 18px 0 6px; }

/* ------------------------------ Centro legal (índice) ------------------------------ */
.ld-cards { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; }
@media (min-width: 640px) { .ld-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .ld-cards { grid-template-columns: repeat(3, 1fr); } }
.ld-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; text-decoration: none; color: var(--ink);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
  scroll-margin-top: calc(var(--header-h) + 14px);
}
.ld-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ld-card__t { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.ld-card__d { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.ld-card__go { margin-top: auto; padding-top: 8px; font-family: var(--font-head); font-weight: 600; font-size: .85rem; color: var(--ink); }
.ld-identity { max-width: 980px; margin: clamp(32px, 6vw, 56px) auto 0; }
.ld-identity .ld-table { min-width: 0; }
.ld-identity th { width: 36%; text-transform: none; letter-spacing: 0; font-size: .86rem; }
.ct-turnstile:empty { min-height: 0; margin: 0; }
