/* Páginas legales: Aviso de Privacidad / Términos y Condiciones */

/* ── Barra de progreso de lectura ─────────────────────────────────── */
.legal-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #c084fc, var(--brand-color));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.legal-hero {
    position: relative;
    overflow: hidden;
    padding: 48px 20px 110px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(192, 132, 252, 0.28) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(161, 72, 142, 0.45) 0%, transparent 50%),
        linear-gradient(135deg, #1f0b22 0%, #4a1a57 55%, #7B2D8B 100%);
}

.legal-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.025), 0 0 0 80px rgba(255, 255, 255, 0.02);
    pointer-events: none;
}

.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f3e8ff;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin: 16px 0 10px;
    line-height: 1.15;
}

.legal-subtitle {
    max-width: 560px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.98rem;
    line-height: 1.6;
}

.legal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.legal-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: 600 0.84rem 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.legal-hero-btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.legal-hero-btn.is-active { background: #fff; color: var(--brand-dark); border-color: #fff; cursor: default; transform: none; }

/* ── Layout: índice + documento ───────────────────────────────────── */
.legal-page {
    position: relative;
    max-width: 1120px;
    margin: -70px auto 0;
    padding: 0 20px 80px;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}
.legal-page.is-solo { grid-template-columns: minmax(0, 860px); justify-content: center; }
.legal-page.is-solo .legal-toc { display: none; }

.legal-toc {
    position: sticky;
    top: 136px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 14px 18px;
    box-shadow: 0 6px 24px rgba(30, 41, 59, 0.06);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.legal-toc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.legal-toc ol { list-style: none; margin: 0; padding: 0; }
.legal-toc a,
.legal-toc-mobile a {
    display: flex;
    gap: 10px;
}
.legal-toc-num {
    flex-shrink: 0;
    min-width: 1.4em;
    color: var(--brand-light);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.legal-toc a.is-active .legal-toc-num { color: var(--brand-color); }
.legal-toc li + li { margin-top: 2px; }
.legal-toc a {
    padding: 8px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-size: 0.83rem;
    line-height: 1.45;
    text-decoration: none;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.legal-toc a.is-sub { padding-left: 22px; font-size: 0.8rem; color: #64748b; }
.legal-toc a:hover { color: var(--brand-color); background: rgba(161, 72, 142, 0.05); }
.legal-toc a.is-active { color: var(--brand-color); border-left-color: var(--brand-color); background: rgba(161, 72, 142, 0.08); font-weight: 600; }

/* Índice móvil (desplegable) */
.legal-toc-mobile { display: none; }

/* ── Documento ────────────────────────────────────────────────────── */
.legal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 48px 56px;
    box-shadow: 0 12px 40px rgba(30, 41, 59, 0.08);
    color: #334155;
    font-size: 1rem;
    line-height: 1.8;
    overflow-wrap: break-word;
}

.legal-content h2,
.legal-content h3,
.legal-content h4 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    scroll-margin-top: 140px;
}
.legal-content h2 {
    position: relative;
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    margin: 44px 0 14px;
    padding-bottom: 12px;
}
.legal-content h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 44px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-color), #c084fc);
}
.legal-num {
    margin-right: 0.45em;
    color: var(--brand-color);
}
.legal-content h3 { font-size: 1.14rem; margin: 30px 0 10px; color: var(--brand-dark); }
.legal-content h4 { font-size: 1rem; margin: 24px 0 8px; }
.legal-content > :first-child { margin-top: 0; }

.legal-content p { margin: 0 0 16px; }
.legal-content strong, .legal-content b { color: var(--text-main); }
.legal-content ul,
.legal-content ol { margin: 0 0 18px; padding-left: 26px; }
.legal-content li { margin-bottom: 8px; padding-left: 4px; }
.legal-content li::marker { color: var(--brand-color); font-weight: 700; }
.legal-content a { color: var(--brand-color); text-decoration: underline; text-underline-offset: 3px; }
.legal-content blockquote {
    margin: 0 0 18px;
    padding: 14px 20px;
    border-left: 3px solid var(--brand-color);
    border-radius: 0 12px 12px 0;
    background: rgba(161, 72, 142, 0.05);
    color: #475569;
}
.legal-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0 0 20px;
    font-size: 0.9rem;
}
.legal-content th,
.legal-content td { border: 1px solid var(--border-color); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal-content th { background: #faf5ff; color: var(--text-main); }

/* ── Tarjetas finales ─────────────────────────────────────────────── */
.legal-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}
.legal-after.is-single { grid-template-columns: 1fr; }

.legal-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-main);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.legal-card:hover { border-color: var(--brand-light); box-shadow: 0 8px 24px rgba(161, 72, 142, 0.1); transform: translateY(-2px); }
.legal-card-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(161, 72, 142, 0.1);
    color: var(--brand-color);
}
.legal-card small { display: block; color: #64748b; font-size: 0.78rem; }
.legal-card strong { font-size: 0.95rem; }
.legal-card-arrow { margin-left: auto; color: #cbd5e1; transition: color 0.2s, transform 0.2s; }
.legal-card:hover .legal-card-arrow { color: var(--brand-color); transform: translateX(3px); }

@media (min-width: 769px) {
    .legal-hero { padding-top: 92px; }
    html { background: #000; }
}

@media (max-width: 1024px) {
    .legal-page { grid-template-columns: minmax(0, 1fr); }
    .legal-toc { display: none; }
    .legal-toc-mobile {
        display: block;
        margin-bottom: 14px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        box-shadow: 0 6px 20px rgba(30, 41, 59, 0.06);
    }
    .legal-page.is-solo .legal-toc-mobile { display: none; }
    .legal-toc-mobile summary {
        padding: 14px 18px;
        font-size: 0.86rem;
        font-weight: 600;
        color: var(--text-main);
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .legal-toc-mobile summary::-webkit-details-marker { display: none; }
    .legal-toc-mobile summary i { color: var(--brand-color); }
    .legal-toc-mobile summary .fa-chevron-down { margin-left: auto; color: #94a3b8; transition: transform 0.2s; }
    .legal-toc-mobile[open] summary .fa-chevron-down { transform: rotate(180deg); }
    .legal-toc-mobile ol { list-style: none; margin: 0; padding: 0 10px 12px; }
    .legal-toc-mobile a { display: flex; padding: 8px 10px; color: #475569; font-size: 0.86rem; text-decoration: none; border-radius: 8px; }
    .legal-toc-mobile a.is-sub { padding-left: 24px; font-size: 0.82rem; }
    .legal-toc-mobile a:active { background: rgba(161, 72, 142, 0.08); }
}

@media (max-width: 768px) {
    .legal-hero { padding: 32px 16px 84px; }
    .legal-title { font-size: 1.9rem; }
    .legal-subtitle { font-size: 0.9rem; }
    .legal-page { margin-top: -56px; padding: 0 14px 110px; }
    .legal-content { padding: 26px 20px; border-radius: 14px; font-size: 0.95rem; }
    .legal-content h2 { font-size: 1.3rem; margin-top: 34px; }
    .legal-content h2, .legal-content h3, .legal-content h4 { scroll-margin-top: 80px; }
    .legal-after { grid-template-columns: 1fr; }
}

/* ── Impresión / Guardar como PDF ─────────────────────────────────── */
@media print {
    .legal-progress, .legal-hero-actions, .legal-toc, .legal-toc-mobile, .legal-after,
    .site-footer, .pub-nav-spacer, .premium-background,
    .navbar-desktop, .pill-nav, #siteHeader, .vionda-desktop-fab-wrap, [class*="bottom-nav"], [class*="vionda"] { display: none !important; }
    html, body { background: #fff !important; }
    .legal-hero { background: none; color: #000; padding: 0 0 16px; }
    .legal-hero::after { display: none; }
    .legal-badge { display: none; }
    .legal-title { color: #000; }
    .legal-subtitle { color: #444; }
    .legal-page { display: block; margin: 0; padding: 0; }
    .legal-content { border: 0; box-shadow: none; padding: 0; }
}

/* ════ SITE FOOTER — copiado de welcome/index.css (la página legal no carga ese CSS) ════ */
.site-footer {
    background: #000000;
    color: rgba(255, 255, 255, 0.8);
    padding: 52px 24px 48px;
    margin-top: 40px;
    display: none; /* oculto en mobile */
}

@media (min-width: 769px) {
    .site-footer {
        display: block;
    }
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 0.8fr 1fr 1.4fr;
    gap: 40px;
    align-items: start;
}

.footer-block {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: #fff;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.footer-tagline {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.65;
    margin-bottom: 16px;
}

.footer-home-link {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--brand-light);
    text-decoration: none;
    border-bottom: 1px solid rgba(192, 132, 212, 0.35);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
    width: fit-content;
}

.footer-home-link:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.footer-block-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
}

.footer-social-row {
    display: flex;
    gap: 10px;
}

.footer-social-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s;
}

.footer-social-btn:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
    transform: translateY(-2px);
}

.footer-support-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px 18px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.83rem;
    line-height: 1.5;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.footer-support-btn:hover {
    background: rgba(123, 45, 139, 0.22);
    border-color: rgba(123, 45, 139, 0.5);
    color: #fff;
}

.footer-support-btn > i {
    font-size: 1.15rem;
    color: var(--brand-light);
    flex-shrink: 0;
    transition: color 0.25s;
}

.footer-support-btn:hover > i { color: #fff; }

.footer-support-btn strong {
    color: #fff;
    font-weight: 700;
}

.footer-newsletter-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 14px;
}

.footer-newsletter-form {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.25s;
}

.footer-newsletter-form:focus-within {
    border-color: var(--brand-light, #c084d4);
}

.footer-newsletter-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    padding: 11px 14px;
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.footer-newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.footer-newsletter-btn {
    background: var(--brand-color, #7B2D8B);
    border: none;
    padding: 11px 16px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}

.footer-newsletter-btn:hover {
    background: var(--brand-light, #c084d4);
}

.footer-newsletter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.footer-newsletter-msg {
    font-size: 0.78rem;
    margin-top: 8px;
    line-height: 1.4;
}

.footer-newsletter-msg.success {
    color: #4ade80;
}

.footer-newsletter-msg.error {
    color: #f87171;
}

.footer-copyright {
    max-width: 1200px;
    margin: 36px auto 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
    letter-spacing: 0.4px;
}
