/* Contesa — documentos legales. Mismos tokens que index.html. */
:root {
  --accent: #ee5d3b; --accent-ink: #c9401e; --accent-soft: rgba(238, 93, 59, 0.1);
  --bg: #ffffff; --bg-soft: #f7f6f5; --bg-sunk: #f0efed;
  --line: rgba(40, 28, 20, 0.09); --line-strong: rgba(40, 28, 20, 0.16);
  --text: #1d1b1a; --text-2: #5f5c59; --text-3: #9c9894;
  --serif: 'Instrument Serif', 'New York', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #f0694a; --accent-ink: #ff8a6c; --accent-soft: rgba(240, 105, 74, 0.16);
    --bg: #161514; --bg-soft: #1c1b1a; --bg-sunk: #262524;
    --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.15);
    --text: #f5f3f1; --text-2: #b0aca8; --text-3: #7a7673;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #f0694a; --accent-ink: #ff8a6c; --accent-soft: rgba(240, 105, 74, 0.16);
  --bg: #161514; --bg-soft: #1c1b1a; --bg-sunk: #262524;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f3f1; --text-2: #b0aca8; --text-3: #7a7673;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
h1, h2, h3, p, ul, ol { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.nav-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; }
.mark { width: 28px; height: 28px; border-radius: 7.5px; background: linear-gradient(#f7774f, #df4529); display: grid; place-items: center; flex-shrink: 0; }
.mark svg { width: 18px; height: 18px; }
.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--text-2); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { font-weight: 600; }

.doc-head { padding-block: clamp(48px, 7vw, 80px) 36px; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5.5vw, 3.8rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; max-width: 18ch; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: 14px; color: var(--text-2); }
.doc-meta b { color: var(--text); font-weight: 600; }
.doc-lede { margin-top: 18px; max-width: 46em; color: var(--text-2); font-size: 1.05rem; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 32px; }
.summary div { padding: 18px 20px; border-radius: 14px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); }
.summary h2 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.summary p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-block: 40px 96px; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 13.5px; }
.toc strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 28px minmax(0, 1fr); padding: 5px 8px; border-radius: 7px; color: var(--text-2); text-decoration: none; line-height: 1.4; }
.toc a::before { content: counter(toc) "."; color: var(--text-3); font-variant-numeric: tabular-nums; }
.toc a:hover { background: var(--bg-soft); color: var(--text); }
.toc a.is-current { background: var(--accent-soft); color: var(--accent-ink); }

.body { max-width: 70ch; counter-reset: sec; }
.body section { padding-block: 28px; border-top: 1px solid var(--line); counter-increment: sec; }
.body section:first-child { border-top: 0; padding-top: 0; }
.body h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 12px; display: flex; gap: 12px; }
.body h2::before { content: counter(sec) "."; color: var(--accent); font-variant-numeric: tabular-nums; }
.body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 6px; }
.body p, .body li { color: var(--text-2); }
.body p + p, .body p + ul, .body ul + p, .body p + ol, .body ol + p { margin-top: 12px; }
.body ul, .body ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.body strong { color: var(--text); font-weight: 600; }
.body dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; }
.body dt { font-weight: 600; color: var(--text); }
.body dd { margin: 0; color: var(--text-2); }

.table-wrap { overflow-x: auto; margin-top: 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; font-size: 13.5px; background: var(--bg-soft); }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }

.callout { margin-top: 16px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 15px; }
.steps { counter-reset: st; list-style: none; padding: 0 !important; }
.steps li { position: relative; padding-left: 36px; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-sunk); color: var(--text); font-size: 12.5px; font-weight: 600; display: grid; place-items: center; }

.contact-card { margin-top: 14px; padding: 18px 20px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-strong); }

.footer { border-top: 1px solid var(--line); padding-block: 28px 40px; font-size: 13px; color: var(--text-3); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer a { color: var(--text-2); }

@media (max-width: 880px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { position: static; max-height: none; padding: 16px; border-radius: 14px; background: var(--bg-soft); }
}
@media (max-width: 560px) { .nav-links a:not([aria-current]) { display: none; } .body dl { grid-template-columns: 1fr; gap: 2px 0; } .body dd { margin-bottom: 8px; } }
@media print { .nav, .toc, .footer { display: none; } .doc { display: block; } }
