/**
 * RiFortuna - Estilos para Documentos Legales
 * Términos y Condiciones, Políticas de Privacidad, etc.
 */

/* Variables */
:root {
    --primary-color: #00D190;
    --secondary-color: #09152D;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-section: #ffffff;
}

/* Contenedor principal del documento */
.legal-document {
    background: var(--bg-light);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Header del documento */
.legal-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a3a5c 100%);
    color: #fff;
    padding: 60px 0 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.legal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300D190' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.legal-header .container {
    position: relative;
    z-index: 1;
}

.legal-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.legal-header h1 i {
    color: var(--primary-color);
    margin-right: 15px;
}

.legal-header .last-update {
    font-size: 0.95rem;
    opacity: 0.8;
}

.legal-header .last-update i {
    margin-right: 8px;
}

/* Navegación del documento (Tabla de contenidos) */
.legal-toc {
    background: #fff;
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.legal-toc h3 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.legal-toc h3 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.legal-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 2;
    column-gap: 30px;
}

.legal-toc ul li {
    margin-bottom: 10px;
    break-inside: avoid;
}

.legal-toc ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
}

.legal-toc ul li a:hover {
    color: var(--primary-color);
    background: rgba(0, 209, 144, 0.08);
}

.legal-toc ul li a i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 0.8rem;
}

/* Contenedor principal del contenido */
.legal-content {
    background: #fff;
    border-radius: 15px;
    padding: 40px 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

/* Introducción destacada */
.legal-intro {
    background: linear-gradient(135deg, rgba(0, 209, 144, 0.08) 0%, rgba(9, 21, 45, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 25px 30px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 35px;
}

.legal-intro p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
}

.legal-intro p:not(:last-child) {
    margin-bottom: 15px;
}

/* Secciones principales */
.legal-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Títulos de sección */
.legal-section-title {
    display: flex;
    align-items: center;
    color: var(--secondary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(9, 21, 45, 0.03) 0%, rgba(0, 209, 144, 0.05) 100%);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.legal-section-title i {
    color: var(--primary-color);
    margin-right: 15px;
    font-size: 1.2rem;
}

/* Subtítulos */
.legal-subsection-title {
    color: var(--secondary-color);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(0, 209, 144, 0.3);
}

/* Párrafos */
.legal-content p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

/* Listas */
.legal-content ul,
.legal-content ol {
    margin: 15px 0 20px 20px;
    padding: 0;
}

.legal-content ul li,
.legal-content ol li {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 10px;
}

.legal-content ul {
    list-style: none;
}

.legal-content ul li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.legal-content ol {
    counter-reset: legal-counter;
    list-style: none;
}

.legal-content ol li {
    counter-increment: legal-counter;
}

.legal-content ol li::before {
    content: counter(legal-counter) ".";
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    width: 1.5em;
    margin-left: -1.5em;
}

/* Listas de definiciones (Glosario) */
.legal-definitions {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px 30px;
    margin: 20px 0;
}

.legal-definitions dt {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.legal-definitions dt::before {
    content: '◆';
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 0.7rem;
}

.legal-definitions dd {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 20px 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.legal-definitions dd:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Destacados y advertencias */
.legal-highlight {
    background: rgba(0, 209, 144, 0.1);
    border: 1px solid rgba(0, 209, 144, 0.3);
    padding: 20px 25px;
    border-radius: 10px;
    margin: 20px 0;
}

.legal-highlight p {
    margin: 0;
    color: var(--secondary-color);
    font-weight: 500;
}

.legal-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 20px 25px;
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
}

.legal-warning p {
    margin: 0;
    color: #856404;
}

/* Información de contacto */
.legal-contact {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a3a5c 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-top: 40px;
}

.legal-contact h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.legal-contact p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.legal-contact a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-contact a:hover {
    text-decoration: underline;
}

/* Badge de versión */
.legal-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 209, 144, 0.15);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 15px;
}

/* Links dentro del documento */
.legal-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.legal-content a:hover {
    color: #00b87a;
    text-decoration: underline;
}

/* Scroll to top button */
.legal-scroll-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 209, 144, 0.4);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.legal-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.legal-scroll-top:hover {
    transform: translateY(-5px);
    background: #00b87a;
}

/* Responsive */
@media (max-width: 991px) {
    .legal-toc ul {
        column-count: 1;
    }

    .legal-content {
        padding: 30px 25px;
    }

    .legal-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 767px) {
    .legal-header {
        padding: 40px 0 30px;
    }

    .legal-header h1 {
        font-size: 1.5rem;
    }

    .legal-header h1 i {
        display: block;
        margin-bottom: 10px;
        margin-right: 0;
    }

    .legal-content {
        padding: 25px 20px;
        border-radius: 10px;
    }

    .legal-section-title {
        font-size: 1.15rem;
        padding: 12px 15px;
    }

    .legal-toc {
        padding: 20px;
    }

    .legal-intro {
        padding: 20px;
    }

    .legal-badge {
        display: block;
        margin-left: 0;
        margin-top: 10px;
        width: fit-content;
    }
}

/* Animaciones sutiles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-section {
    animation: fadeIn 0.5s ease forwards;
}

/* Print styles */
@media print {
    .legal-header {
        background: #fff !important;
        color: #000 !important;
        padding: 20px 0;
    }

    .legal-toc,
    .legal-scroll-top,
    #header-container,
    #footer-container,
    #whatsapp-container {
        display: none !important;
    }

    .legal-content {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .legal-section {
        break-inside: avoid;
    }
}
