/* ══════════════════════════════════════════════════════════════════════
   LEGAL — páginas legales editorial Xtryde
   Alineado a landing/login/registro/suscripcion editorial:
   Fraunces titulares · DM Sans cuerpo · JetBrains Mono eyebrows
   Sin pills, sin dot pulsante, sin greca animada.
   ══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

:root {
    --xt-terracota:      #D84315;
    --xt-terracota-dark: #BF360C;
    --xt-jade:           #00897B;
    --xt-jade-dark:      #00695C;
    --xt-carbon:         #2A363D;
    --xt-carbon-soft:    #3A4750;
    --xt-crema:          #FFF8F0;
    --xt-crema-2:        #F5ECDD;
    --xt-line:           rgba(42,54,61,0.10);
    --xt-line-strong:    rgba(42,54,61,0.18);
    --xt-muted:          #6B7B82;
    --xt-text:           #2A363D;
    --xt-alerta:         #C62828;
    --xt-exito:          #2E7D32;

    --xt-radius-sm:      4px;
    --xt-radius-md:      6px;
    --xt-radius-lg:      10px;
    --xt-shadow:         0 18px 40px -28px rgba(42,54,61,0.25), 0 2px 6px -3px rgba(42,54,61,0.06);

    --xt-font-display:   "Fraunces", Georgia, "Times New Roman", serif;
    --xt-font-body:      "DM Sans", system-ui, -apple-system, sans-serif;
    --xt-font-mono:      "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --xt-ease:           cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--xt-font-body);
    color: var(--xt-text);
    background: var(--xt-crema);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

a { color: var(--xt-terracota-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--xt-terracota); text-decoration: underline; text-underline-offset: 3px; }

/* ══════════ HEADER editorial ══════════════════════════════════════════
   Crema, watermark X grande, eyebrow mono, sin glow ni animación. */
.lg-header {
    position: relative;
    background: var(--xt-crema);
    color: var(--xt-carbon);
    padding: 28px 24px 26px;
    overflow: hidden;
    border-bottom: 1px solid var(--xt-line);
}
.lg-header::before {
    content: "";
    position: absolute;
    right: -28px; bottom: -32px;
    width: 180px; height: 180px;
    background-image: url('../img/isotipo-terracota.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.10;
    pointer-events: none;
}
.lg-header-inner {
    position: relative; z-index: 1;
    max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
}
.lg-brand {
    display: inline-flex; align-items: center; gap: 18px;
    color: var(--xt-carbon); font-weight: 600;
}
.lg-brand img.lg-logo {
    height: 30px; width: auto; display: block;
}
/* Eyebrow editorial (reemplaza el viejo pill con dot pulsante) */
.lg-brand-tag {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 0 0 0 16px;
    border-left: 1px solid var(--xt-line-strong);
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--xt-muted);
    background: transparent;
    border-radius: 0;
}
.lg-brand-tag::before { content: none; }

/* Volver al inicio — link editorial con guion */
.lg-header-home {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 0;
    background: transparent; border: none;
    border-radius: 0;
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--xt-muted);
    transition: color 0.25s var(--xt-ease), transform 0.25s var(--xt-ease);
}
.lg-header-home::before {
    content: "";
    display: block; width: 28px; height: 1px;
    background: currentColor;
    transition: width 0.3s var(--xt-ease);
}
.lg-header-home:hover {
    color: var(--xt-terracota);
    text-decoration: none;
    transform: translateX(-3px);
}
.lg-header-home:hover::before { width: 38px; }

/* ══════════ NAV de tabs (sin pills) ══════════════════════════════════ */
.lg-nav {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 248, 240, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--xt-line);
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.lg-nav::-webkit-scrollbar { display: none; }
.lg-nav-inner {
    display: inline-flex; gap: 0;
    max-width: 1180px; margin: 0 auto;
    width: max-content;
}
.lg-tab {
    position: relative;
    flex-shrink: 0;
    padding: 16px 22px;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--xt-muted);
    white-space: nowrap;
    transition: color 0.2s var(--xt-ease);
}
.lg-tab::after {
    content: "";
    position: absolute; left: 22px; right: 22px; bottom: 0;
    height: 2px;
    background: var(--xt-terracota);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.3s var(--xt-ease);
}
.lg-tab:hover { color: var(--xt-carbon); text-decoration: none; }
.lg-tab.activo { color: var(--xt-carbon); }
.lg-tab.activo::after { transform: scaleX(1); }

/* ══════════ HERO del documento ═════════════════════════════════════ */
.lg-doc-hero {
    position: relative;
    padding: 72px 24px 56px;
    background: var(--xt-crema);
    overflow: hidden;
    border-bottom: 1px solid var(--xt-line);
}
.lg-doc-hero::before {
    content: "";
    position: absolute;
    left: -60px; top: 50%;
    transform: translateY(-50%);
    width: 380px; height: 380px;
    background-image: url('../img/isotipo-terracota.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.07;
    pointer-events: none;
}
.lg-doc-hero-inner {
    position: relative; z-index: 1;
    max-width: 880px; margin: 0 auto;
}
.lg-eyebrow {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--xt-muted);
    margin-bottom: 22px;
}
.lg-eyebrow::before {
    content: ""; display: block; width: 36px; height: 1px;
    background: var(--xt-terracota);
}
.lg-doc-hero h1 {
    font-family: var(--xt-font-display);
    font-weight: 500;
    letter-spacing: -0.015em;
    font-size: clamp(2.2rem, 5.4vw, 3.8rem);
    line-height: 1.04;
    color: var(--xt-carbon);
    margin-bottom: 22px;
    text-wrap: balance;
}
.lg-doc-hero h1 .lg-acento {
    font-style: italic;
    font-weight: 400;
    color: var(--xt-terracota-dark);
    background: none;
    -webkit-text-fill-color: currentColor;
}
.lg-lead {
    font-family: var(--xt-font-body);
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    color: var(--xt-carbon-soft);
    max-width: 64ch; line-height: 1.65;
    margin-bottom: 8px;
    font-weight: 400;
}
.lg-lead strong { color: var(--xt-carbon); font-weight: 600; }

.lg-meta {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--xt-line);
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--xt-muted);
}
/* badges → marca mono con bullet separator, sin pill */
.lg-meta .badge {
    display: inline-flex; align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-family: inherit; font-size: inherit; font-weight: inherit;
    letter-spacing: inherit; text-transform: inherit;
    color: var(--xt-muted);
    box-shadow: none;
}
.lg-meta .badge.primary { color: var(--xt-terracota-dark); }
.lg-meta .badge + .badge::before {
    content: "·";
    margin-right: 18px;
    color: var(--xt-line-strong);
    letter-spacing: 0;
}

/* ══════════ MAIN layout ═════════════════════════════════════════════ */
.lg-main {
    max-width: 1180px; margin: 0 auto;
    padding: 56px 20px 72px;
    display: grid; grid-template-columns: 1fr; gap: 36px;
}
@media (min-width: 1024px) {
    .lg-main { grid-template-columns: 240px minmax(0, 1fr); gap: 56px; }
}

/* TOC lateral editorial */
.lg-toc {
    background: transparent;
    border: none;
    border-left: 1px solid var(--xt-line);
    border-radius: 0;
    padding: 4px 0 4px 22px;
    box-shadow: none;
}
@media (min-width: 1024px) {
    .lg-toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
}
.lg-toc h4 {
    font-family: var(--xt-font-mono);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.28em;
    color: var(--xt-terracota-dark);
    margin-bottom: 18px;
    font-weight: 500;
}
.lg-toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 0; }
.lg-toc li { counter-increment: toc; }
.lg-toc a {
    display: flex; gap: 14px; align-items: flex-start;
    color: var(--xt-carbon-soft);
    font-family: var(--xt-font-body);
    font-size: 13.5px; line-height: 1.5;
    padding: 7px 0;
    transition: color 0.2s var(--xt-ease), gap 0.2s var(--xt-ease);
    font-weight: 400;
    border-radius: 0;
}
.lg-toc a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--xt-muted);
    font-family: var(--xt-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.08em;
    flex-shrink: 0; padding-top: 3px;
}
.lg-toc a:hover {
    color: var(--xt-terracota-dark);
    text-decoration: none;
    gap: 18px;
    background: none;
    transform: none;
}

/* ══════════ DOCUMENTO ═══════════════════════════════════════════════ */
.lg-doc {
    background: white;
    border: 1px solid var(--xt-line);
    border-radius: var(--xt-radius-md);
    padding: 40px 28px;
    box-shadow: var(--xt-shadow);
    min-width: 0;
    position: relative;
}
@media (min-width: 640px) { .lg-doc { padding: 56px 56px; } }
@media (min-width: 960px) { .lg-doc { padding: 72px 76px; } }

/* Callouts editoriales (sin gradient excesivo) */
.lg-callout {
    border-left: 2px solid var(--xt-terracota);
    background: rgba(216,67,21,0.04);
    border-radius: 0;
    padding: 16px 20px;
    margin: 22px 0;
    font-size: 14.5px; line-height: 1.65;
    color: var(--xt-carbon-soft);
}
.lg-callout strong { color: var(--xt-terracota-dark); font-weight: 600; }
.lg-callout em { color: var(--xt-carbon); font-style: italic; }
.lg-callout.warn {
    border-left-color: var(--xt-alerta);
    background: rgba(198,40,40,0.04);
}
.lg-callout.warn strong { color: var(--xt-alerta); }
.lg-callout.ok {
    border-left-color: var(--xt-exito);
    background: rgba(46,125,50,0.05);
}
.lg-callout.ok strong { color: var(--xt-exito); }

/* Placeholder (sin parpadeo, sin gradient) */
.lg-ph {
    display: inline-flex; align-items: center;
    background: var(--xt-crema-2);
    border: 1px dashed var(--xt-terracota);
    color: var(--xt-terracota-dark);
    padding: 1px 8px; border-radius: var(--xt-radius-sm);
    font-family: var(--xt-font-mono);
    font-size: 0.88em; font-weight: 500;
    letter-spacing: 0.04em;
}

/* Tipografía del documento */
.lg-doc h2 {
    font-family: var(--xt-font-display);
    font-size: clamp(1.45rem, 2.6vw, 1.95rem);
    font-weight: 500;
    letter-spacing: -0.012em;
    color: var(--xt-carbon);
    margin: 56px 0 18px;
    display: flex; gap: 18px; align-items: baseline;
    scroll-margin-top: 90px;
    line-height: 1.15;
}
.lg-doc section:first-of-type h2 { margin-top: 8px; }
/* Sello-num real: 01..15 numera secciones (memoria: permitido cuando numera algo) */
.lg-doc h2::before {
    content: attr(data-num);
    display: inline-flex; align-items: center; justify-content: flex-start;
    min-width: 32px;
    background: none;
    color: var(--xt-terracota);
    border-radius: 0;
    box-shadow: none;
    font-family: var(--xt-font-mono);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.22em;
    padding-top: 8px;
    align-self: flex-start;
}
/* Si el número viene de 1 dígito, lo padeamos visualmente con un cero */
.lg-doc h2[data-num]::before { content: "0" attr(data-num); }
.lg-doc h2[data-num="10"]::before,
.lg-doc h2[data-num="11"]::before,
.lg-doc h2[data-num="12"]::before,
.lg-doc h2[data-num="13"]::before,
.lg-doc h2[data-num="14"]::before,
.lg-doc h2[data-num="15"]::before,
.lg-doc h2[data-num="16"]::before,
.lg-doc h2[data-num="17"]::before,
.lg-doc h2[data-num="18"]::before,
.lg-doc h2[data-num="19"]::before,
.lg-doc h2[data-num="20"]::before { content: attr(data-num); }

.lg-doc h3 {
    font-family: var(--xt-font-body);
    font-size: 1.02rem; font-weight: 600;
    color: var(--xt-carbon);
    margin: 28px 0 10px;
    letter-spacing: -0.005em;
}
.lg-doc p { margin-bottom: 14px; font-size: 15.5px; line-height: 1.75; color: var(--xt-text); }
.lg-doc ul, .lg-doc ol { margin: 10px 0 20px 22px; }
.lg-doc li { margin-bottom: 8px; font-size: 15.5px; line-height: 1.7; color: var(--xt-text); }
.lg-doc li::marker { color: var(--xt-terracota); }
.lg-doc strong { color: var(--xt-carbon); font-weight: 600; }
.lg-doc em { color: var(--xt-carbon-soft); font-style: italic; }
.lg-doc code {
    background: var(--xt-crema-2);
    border: 1px solid var(--xt-line);
    padding: 1px 7px; border-radius: var(--xt-radius-sm);
    font-family: var(--xt-font-mono);
    font-size: 0.88em; color: var(--xt-terracota-dark);
}

/* Tabla editorial */
.lg-doc table {
    width: 100%; border-collapse: separate;
    border-spacing: 0; margin: 20px 0 24px;
    font-size: 14px;
    background: white;
    border: 1px solid var(--xt-line);
    border-radius: var(--xt-radius-md);
    overflow: hidden;
    table-layout: fixed;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.lg-doc th, .lg-doc td {
    text-align: left; padding: 12px 16px;
    border-bottom: 1px solid var(--xt-line);
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.lg-doc td a { overflow-wrap: anywhere; word-break: break-word; }
.lg-doc th {
    background: var(--xt-crema);
    color: var(--xt-carbon);
    font-family: var(--xt-font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--xt-line-strong);
}
.lg-doc tr:last-child td { border-bottom: none; }
.lg-doc tr:nth-child(even) td { background: rgba(245,236,221,0.35); }

/* Section spacing */
.lg-doc section { padding-top: 4px; }

/* Bloque de fuentes */
.lg-fuentes {
    margin-top: 56px; padding: 32px 0 0;
    border-top: 1px solid var(--xt-line);
    font-size: 13px; color: var(--xt-muted);
}
.lg-fuentes h4 {
    font-family: var(--xt-font-mono);
    font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--xt-terracota-dark); margin-bottom: 14px;
    font-weight: 500;
}
.lg-fuentes ul { list-style: none; margin: 0; padding: 0; }
.lg-fuentes li {
    padding-left: 18px; position: relative;
    margin-bottom: 7px; line-height: 1.55;
    font-family: var(--xt-font-body);
}
.lg-fuentes li::before {
    content: "§"; position: absolute; left: 0;
    color: var(--xt-terracota); font-weight: 500;
    font-family: var(--xt-font-display);
}

/* ══════════ FOOTER editorial ════════════════════════════════════════ */
.xtryde-footer-legal {
    position: relative;
    margin-top: 24px;
    background: var(--xt-carbon);
    color: rgba(255,255,255,0.7);
    padding: 56px 20px 36px;
    text-align: center;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.xtryde-footer-legal::before {
    content: "";
    position: absolute;
    right: -50px; top: -50px;
    width: 240px; height: 240px;
    background-image: url('../img/isotipo-blanco.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.08;
    pointer-events: none;
}
.xtryde-footer-legal-inner {
    position: relative; z-index: 1;
    max-width: 880px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.xtryde-footer-legal img { height: 26px; width: auto; }
.xtryde-footer-legal .fl-tag {
    font-family: var(--xt-font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    max-width: 60ch; line-height: 1.55;
}
.xtryde-footer-legal .fl-links {
    display: inline-flex; gap: 28px; flex-wrap: wrap; justify-content: center;
    margin-top: 8px; padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
    width: 100%;
    font-family: var(--xt-font-mono);
    font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
}
.xtryde-footer-legal .fl-links a {
    color: rgba(255,255,255,0.6);
    transition: color 0.2s var(--xt-ease);
}
.xtryde-footer-legal .fl-links a:hover { color: white; text-decoration: none; }
.xtryde-footer-legal .fl-copy {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

/* Mobile tuning */
@media (max-width: 640px) {
    .lg-header { padding: 20px 18px 18px; }
    .lg-header::before { width: 120px; height: 120px; right: -20px; bottom: -24px; }
    .lg-brand { gap: 14px; }
    .lg-brand img.lg-logo { height: 26px; }
    .lg-brand-tag { padding-left: 12px; font-size: 9.5px; letter-spacing: 0.2em; }
    .lg-header-home { font-size: 9.5px; letter-spacing: 0.2em; }
    .lg-doc-hero { padding: 48px 18px 40px; }
    .lg-doc-hero::before { width: 220px; height: 220px; left: -50px; }
    .lg-doc h2 { gap: 12px; margin-top: 44px; }
    .lg-toc { border-left: none; border-top: 1px solid var(--xt-line); padding: 22px 0 0; }
}

/* Print */
@media print {
    .lg-header::before, .lg-doc-hero::before, .xtryde-footer-legal::before { display: none !important; }
    .lg-header, .lg-nav, .lg-toc, .xtryde-footer-legal { display: none !important; }
    .lg-main { grid-template-columns: 1fr; padding: 0; max-width: 100%; }
    .lg-doc { border: none; box-shadow: none; padding: 0; border-radius: 0; }
    .lg-doc-hero { padding: 16px 0; background: none; border-bottom: 2px solid black; }
    body { background: white; color: black; }
    a { color: black; text-decoration: none; }
    a[href^="http"]::after, a[href^="mailto:"]::after {
        content: " (" attr(href) ")"; font-size: 10px; color: #666;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
