/* ============================================================
   LEGAL PAGE STYLES - SyServ v2
   Modern legal document page with sidebar navigation
   ============================================================ */

/* ============================================================
   LEGAL PAGE - MAIN CONTAINER
   ============================================================ */
.legal-page {
    position: relative;
    min-height: 100vh;
    padding: 2rem 1rem 3rem;
    background: #f3f4f6;
    overflow: hidden;
}

/* Ocultar TODAS las decoraciones SVG y elementos decorativos */
.legal-page svg:not(.legal-content svg),
.legal-page__decor,
.legal-page > svg,
.legal-page .decor-x,
.legal-page .x-decor,
.legal-content > svg,
.legal-page img[src*="x-"],
.legal-page img[src*="cruz"] {
    display: none !important;
}

/* Ocultar elementos decorativos fuera del contenido */
.legal-page::before,
.legal-page::after {
    display: none !important;
}

.legal-page__container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================================
   DECORATIVE ELEMENTS
   ============================================================ */
.legal-page__decor {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.legal-page__decor--circle-1 {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.legal-page__decor--circle-2 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
    bottom: 20%;
    left: -80px;
}

.legal-page__decor--dots {
    width: 120px;
    height: 120px;
    top: 200px;
    right: 5%;
    background-image: radial-gradient(circle, rgba(139, 92, 246, 0.2) 2px, transparent 2px);
    background-size: 20px 20px;
}

.legal-page__decor--curves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 300px;
    height: 250px;
    z-index: 0;
    opacity: 0.8;
}

.legal-page__decor--curves svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.legal-sidebar {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.legal-sidebar__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.legal-sidebar__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.125rem;
}

.legal-sidebar__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.legal-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.legal-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.legal-sidebar__link:hover {
    background: #f8f7ff;
    color: #8b5cf6;
    text-decoration: none;
}

.legal-sidebar__link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    color: #8b5cf6;
    font-weight: 600;
}

.legal-sidebar__link i {
    font-size: 1.125rem;
}

.legal-sidebar__contact {
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.legal-sidebar__contact p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.legal-sidebar__contact .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

/* ============================================================
   LEGAL CONTENT - MAIN ARTICLE (Estilo hoja de Word)
   ============================================================ */
.legal-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Cuando el contenido usa #formato-hoja, los estilos de hoja van en .hoja-datos */
.legal-content #formato-hoja {
    background: transparent;
}

.legal-content #formato-hoja .hoja-datos {
    background: #ffffff;
    border-radius: 0;
    /* Sombra estilo hoja de papel/Word */
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 16px 32px rgba(0, 0, 0, 0.08);
    border: none;
    max-width: 1000px;
    margin: 2rem auto;
    position: relative;
    width: 95%;
    left: 0;
    margin-left: auto;
    margin-right: auto;
}

/* Document Header */
.legal-content__header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.legal-content__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b5cf6;
    margin-bottom: 1rem;
}

.legal-content__title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.legal-content__title--accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-content__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.legal-content__meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legal-content__meta-item i {
    color: #8b5cf6;
}

/* Document Body */
.legal-content__body {
    color: #475569;
    line-height: 1.8;
}

.legal-content__body h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 2rem 0 1rem;
    padding-left: 1rem;
    border-left: 3px solid #8b5cf6;
}

.legal-content__body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin: 1.5rem 0 0.75rem;
}

.legal-content__body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-content__body ul,
.legal-content__body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-content__body li {
    margin-bottom: 0.5rem;
    position: relative;
}

.legal-content__body ul li::marker {
    color: #8b5cf6;
}

.legal-content__body ol li::marker {
    color: #8b5cf6;
    font-weight: 600;
}

.legal-content__body a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.legal-content__body a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.legal-content__body strong {
    color: #334155;
    font-weight: 600;
}

.legal-content__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.legal-content__body table th,
.legal-content__body table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.legal-content__body table th {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    color: #1e293b;
    font-weight: 600;
}

.legal-content__body table tr:nth-child(even) {
    background: #fafafa;
}

/* Info Cards */
.legal-info-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(6, 182, 212, 0.03) 100%);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid #8b5cf6;
}

.legal-info-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-info-card__text {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
}

/* Contact Info Box */
.legal-contact-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.legal-contact-box__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-contact-box__title i {
    color: #8b5cf6;
}

.legal-contact-box__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-contact-box__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.legal-contact-box__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.legal-contact-box__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.legal-contact-box__label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.125rem;
}

.legal-contact-box__value {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
}

/* Footer with update date */
.legal-content__footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-content__update {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.legal-content__update i {
    color: #8b5cf6;
}

.legal-content__actions {
    display: flex;
    gap: 0.75rem;
}

.legal-content__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.legal-content__btn--print {
    background: #f1f5f9;
    color: #64748b;
}

.legal-content__btn--print:hover {
    background: #e2e8f0;
    color: #475569;
    text-decoration: none;
}

.legal-content__btn--download {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
}

.legal-content__btn--download:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    text-decoration: none;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablet */
@media (min-width: 768px) {
    .legal-page {
        padding: 7rem 2rem 4rem;
    }

    .legal-sidebar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .legal-sidebar__header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .legal-sidebar__nav {
        flex-direction: row;
        margin-bottom: 0;
    }

    .legal-sidebar__contact {
        padding-top: 0;
        border-top: none;
    }

    .legal-sidebar__contact p {
        display: none;
    }

    .legal-content {
        padding: 4rem 5rem;
        margin: 2rem auto;
    }

    .legal-content__title {
        font-size: 2rem;
    }

    .legal-content__body h2 {
        font-size: 1.375rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .legal-page {
        padding: 8rem 2rem 4rem;
    }

    .legal-page__container {
        flex-direction: column;
        max-width: 1100px;
        align-items: center;
    }

    .legal-sidebar {
        display: none;
    }

    .legal-content {
        width: 100%;
        max-width: 1100px;
        min-height: auto;
        padding: 0;
        margin: 0 auto;
    }

    .legal-content #formato-hoja .hoja-datos {
        max-width: 1000px;
        width: 95%;
    }

    .legal-content__title {
        font-size: 2.25rem;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .legal-page__container {
        max-width: 1200px;
    }

    .legal-content {
        padding: 0;
        max-width: 1200px;
        width: 100%;
    }

    .legal-content #formato-hoja .hoja-datos {
        max-width: 1100px;
        width: 95%;
    }
}

/* Mobile - sin restricción de altura mínima */
@media (max-width: 767px) {
    .legal-content {
        padding: 2rem 1.5rem;
        min-height: auto;
        margin: 1rem auto;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.06),
            0 2px 8px rgba(0, 0, 0, 0.08),
            0 8px 16px rgba(0, 0, 0, 0.06);
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .legal-page {
        padding: 0;
        background: #fff;
    }

    .legal-page__decor,
    .legal-sidebar,
    .legal-content__actions {
        display: none !important;
    }

    .legal-content {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .legal-content__body h2 {
        break-after: avoid;
    }

    .legal-content__body p,
    .legal-content__body li {
        orphans: 3;
        widows: 3;
    }
}
