@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800&display=swap');

/* Root a 14px: la app usa ese tamaño base (preset Material de PrimeNG), así que
   todos los rem de aquí abajo replican 1:1 los mismos px que usan los componentes
   Angular reales (header/footer/hero de las páginas de guía). */
html { font-size: 87.5%; }

:root {
    --primary-50: #F1F9F8;
    --primary-100: #DEF2EF;
    --primary-200: #BEE4DF;
    --primary-400: #56C2B4;
    --primary-500: #38A899;
    --primary-600: #2E8B7A;
    --primary-700: #237069;
    --primary-800: #1F5F5B;
    --coral: #E8453C;
    /* Paleta neutra "surface" real de la app (Tailwind slate, no zinc). */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    --ink: #0f172a;
    --ink-soft: #475569;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--slate-50);
    line-height: 1.6;
}

/* ---------- Header (igual a public-layout.html) ---------- */

header.legal-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, .95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-800);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}

.legal-header .header-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legal-header .brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    min-width: 0;
}

.legal-header .brand-badge {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: .75rem;
    padding: .125rem;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
}

.legal-header .brand-badge img {
    width: 100%;
    height: 100%;
    border-radius: .5rem;
    background: #fff;
    object-fit: contain;
    display: block;
}

.legal-header .brand-name {
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    background: linear-gradient(90deg, #ffffff, var(--slate-300));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.legal-header .back-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.1rem;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    color: #fff;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 15px -3px rgba(46, 139, 122, .3);
    transition: transform .2s ease, box-shadow .2s ease;
}

.legal-header .back-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(46, 139, 122, .5);
}

/* ---------- Hero (igual a app-guia-hero) ---------- */

section.legal-hero {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
}

.legal-hero .blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(64px);
    pointer-events: none;
}

.legal-hero .blob-1 {
    top: -10rem;
    right: -10rem;
    width: 24rem;
    height: 24rem;
    background: rgba(56, 168, 153, .1);
}

.legal-hero .blob-2 {
    top: 50%;
    left: -5rem;
    width: 18rem;
    height: 18rem;
    background: rgba(56, 168, 153, .05);
}

.legal-hero .hero-inner {
    position: relative;
    max-width: 56rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: center;
}

@media (min-width: 48em) {
    .legal-hero .hero-inner { padding: 4rem 1.5rem; }
}

.legal-hero .back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--primary-600);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.legal-hero .back-link:hover { text-decoration: underline; }

.legal-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem 1rem;
    border-radius: 9999px;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.legal-hero .hero-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.legal-hero h1 {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0 0 1rem;
    background: linear-gradient(90deg, var(--slate-900), var(--slate-700), var(--slate-900));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (min-width: 48em) {
    .legal-hero h1 { font-size: 3rem; }
}

.legal-hero .hero-subtitle {
    font-size: 1.125rem;
    color: var(--slate-600);
    max-width: 42rem;
    margin: 0 auto;
    line-height: 1.6;
}

@media (min-width: 48em) {
    .legal-hero .hero-subtitle { font-size: 1.25rem; }
}

/* ---------- Doc nav (tabs) ---------- */

.doc-nav {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
}

.doc-nav a {
    padding: .45rem .95rem;
    border-radius: 9999px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--slate-700);
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.doc-nav a:hover {
    background: var(--slate-200);
}

.doc-nav a.current {
    background: var(--primary-800);
    border-color: var(--primary-800);
    color: #fff;
}

/* ---------- Content card ---------- */

main.legal-doc {
    max-width: 58rem;
    margin: 2rem auto 3rem;
    padding: 0 1.5rem;
}

.doc-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem 2.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
}

@media (min-width: 40em) {
    .doc-card { padding: 2.5rem 3rem 3rem; }
}

.doc-meta {
    font-size: .875rem;
    color: var(--ink-soft);
    margin-bottom: 1.6rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--slate-200);
}

.doc-meta strong { color: var(--coral); }

.doc-card h2 {
    font-size: 1.125rem;
    color: var(--primary-800);
    margin: 1.9rem 0 .6rem;
}

.doc-card h2:first-child { margin-top: 0; }

.doc-card h3 {
    font-size: 1rem;
    color: var(--ink);
    margin: 1.3rem 0 .4rem;
}

.doc-card p, .doc-card li { font-size: .95rem; color: var(--slate-700); }

.doc-card ul, .doc-card ol { padding-left: 1.3rem; margin: .5rem 0 1rem; }

.doc-card li { margin-bottom: .35rem; }

.doc-card a { color: var(--primary-600); text-decoration: underline; }
.doc-card a:hover { color: var(--coral); }

.callout {
    background: var(--primary-50);
    border-left: 4px solid var(--primary-600);
    border-radius: 8px;
    padding: .9rem 1.1rem;
    margin: 1.1rem 0;
    font-size: .9rem;
}

.callout.warn {
    background: #fdf1f0;
    border-left-color: var(--coral);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: .8rem 0 1.3rem;
    font-size: .88rem;
}

table.data-table th, table.data-table td {
    border: 1px solid var(--slate-200);
    padding: .55rem .7rem;
    text-align: left;
    vertical-align: top;
}

table.data-table th {
    background: var(--primary-50);
    color: var(--primary-800);
    font-weight: 700;
}

/* ---------- Footer (igual a site-footer.component.html) ---------- */

footer.legal-footer {
    background: var(--slate-950);
    color: var(--slate-400);
    padding: 4rem 1.5rem 2rem;
}

.legal-footer .footer-inner {
    max-width: 80rem;
    margin: 0 auto;
}

.legal-footer .footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.legal-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    margin-bottom: 1rem;
}

.legal-footer .footer-brand-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, var(--primary-500), var(--primary-600));
}

.legal-footer .footer-brand-icon img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    display: block;
}

.legal-footer .footer-brand-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.legal-footer .footer-tagline {
    font-size: .875rem;
    color: var(--slate-400);
    line-height: 1.6;
    max-width: 22rem;
    margin: 0 0 1.25rem;
}

.legal-footer .footer-social {
    display: flex;
    gap: .5rem;
}

.legal-footer .footer-social a {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-500);
    transition: background .2s ease, color .2s ease;
}

.legal-footer .footer-social a:hover {
    background: var(--slate-800);
    color: var(--primary-400);
}

.legal-footer .footer-social svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }

.legal-footer .footer-legal-col h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-200);
    margin: 0 0 1rem;
}

.legal-footer .footer-legal-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.legal-footer .footer-legal-col a {
    font-size: .875rem;
    color: var(--slate-400);
    text-decoration: none;
    transition: color .2s ease;
}

.legal-footer .footer-legal-col a:hover { color: var(--primary-400); }

.legal-footer .footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--slate-800);
    padding-top: 2rem;
    text-align: center;
}

@media (min-width: 48em) {
    .legal-footer .footer-bottom {
        flex-direction: row;
        text-align: left;
    }
}

.legal-footer .copyright {
    font-size: .75rem;
    color: var(--slate-500);
    margin: 0;
    line-height: 1.6;
}

.legal-footer .footer-bottom-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: .75rem;
}

.legal-footer .footer-bottom-links a { color: var(--slate-500); text-decoration: none; }
.legal-footer .footer-bottom-links a:hover { color: var(--slate-300); }

@media print {
    header.legal-header, .legal-hero .blob, .doc-nav, footer.legal-footer { display: none; }
    .legal-hero { border: none; }
    body { background: #fff; }
    .doc-card { border: none; box-shadow: none; padding: 0; }
}
