:root {
    /* Paleta Minimalista Sofisticada */
    --primary: #1c1917;         /* Gris piedra oscuro (casi negro) */
    --primary-light: #44403c;   /* Gris intermedio */
    --secondary: #78716c;       /* Taupe / Gris cálido */
    --secondary-light: #a8a29e; /* Arena claro */
    --text: #292524;            /* Texto principal */
    --text-light: #78716c;      /* Texto secundario */
    --bg: #fafaf9;              /* Blanco roto cálido */
    --bg-alt: #f5f5f4;          /* Fondo alterno gris suave */
    --border: #e7e5e4;          /* Líneas divisorias sutiles */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Al saltar a una sección, su línea divisoria (15px, centrada en el borde) queda
       escondida justo detrás del borde del menú fijo: menú 83px - 9 = 74px. */
    scroll-padding-top: 74px;
}
@media (max-width: 768px) {
    html { scroll-padding-top: 55px; } /* menú de 64px en celular */
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--bg);
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Navegación */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    /* Fondo opaco: con transparencia, las líneas divisorias se veían a través del menú al hacer scroll */
    background: rgb(246, 239, 226);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    /* Firefox tiene un bug conocido: backdrop-filter en un elemento position:fixed
       puede fallar al componer su propia capa y el fondo (aunque sea rgba normal)
       no se pinta, dejándolo transparente. Forzar su propio contexto de
       composición con transform evita que dependa de ese cálculo con backdrop-filter. */
    transform: translateZ(0);
    z-index: 1000;
    border-bottom: 1px solid #dba05f;
}

.nav-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.logo { 
    font-family: 'Playfair Display', serif; 
    font-size: 1.3rem; 
    font-weight: 600; 
    color: var(--primary); 
    text-decoration: none; 
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.logo span { 
    font-weight: 300;
    color: var(--secondary); 
    font-style: italic;
    text-transform: lowercase;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.4rem 0.28rem;
    border-radius: 20px;
    white-space: nowrap;
    transition: color 0.3s, transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,.2);
}

/* "Inicio" lleva un subrayado dorado fijo, ya que es la sección por defecto del sitio */
.nav-links a.nav-apps-link {
    background: linear-gradient(135deg, #dba05f, #b97a3d);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(185, 122, 61, 0.35);
    animation: ley431Pulse 2.6s ease-in-out infinite;
}

.nav-links a.nav-apps-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #e6ac6e, #cf9152);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 22px rgba(185, 122, 61, 0.5);
}

@keyframes ley431Pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(185, 122, 61, 0.35); }
    50% { box-shadow: 0 4px 18px rgba(185, 122, 61, 0.65); }
}

/* Rótulo con la lista de apps disponibles al pasar el puntero sobre "Apps" */
.nav-links a.nav-apps-link {
    position: relative;
}

.nav-links a.nav-apps-link::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: var(--primary);
    color: #fafaf9;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.5;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    z-index: 500;
    white-space: normal;
}

.nav-links a.nav-apps-link:hover::after,
.nav-links a.nav-apps-link:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 1200px) {
    .nav-links a.nav-apps-link::after {
        left: 50%;
        right: auto;
        transform: translate(-50%, -6px);
        width: 200px;
    }
    .nav-links a.nav-apps-link:hover::after,
    .nav-links a.nav-apps-link:focus-visible::after {
        transform: translate(-50%, 0);
    }
}

.mobile-menu { 
    display: none; 
    font-size: 1.3rem; 
    cursor: pointer; 
    color: var(--primary);
    background: transparent;
    border: none;
}

@media (max-width: 1200px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary);
        padding: 0;
        max-height: 0; /* Cambio para animación fluida */
        overflow: hidden;
        box-shadow: 0 8px 20px rgba(0,0,0,0.25);
        border-bottom: 1px solid #3a352f;
        text-align: center;
        gap: 1.5rem;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    }
    .nav-links.active {
        /* En horizontal (landscape) la pantalla mide menos de 500px de alto:
           se limita a un % del viewport y se deja scrollear adentro, para
           que el menu nunca quede cortado sin forma de llegar a los enlaces
           de abajo. */
        max-height: min(500px, 80vh);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem 2rem;
    }
    /* Menú desplegado: fondo negro, texto dorado */
    .nav-links a {
        color: #cf9152;
    }
    .nav-links a:hover {
        color: #1c1917;
        background: #cf9152;
        box-shadow: none;
    }
    .nav-apps-link {
        display: inline-flex;
        margin: 0 auto;
    }
    .mobile-menu { display: block; }
}

/* Sección con QR para instalar la app desde el celular mientras se navega
   desde la computadora — en celular no aporta nada (ya está el link directo
   en el menú), así que se oculta ahí. */
.qr-section {
    padding: 4rem 0;
    background-color: #f9ecde;
}
.qr-block {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}
.qr-image {
    flex-shrink: 0;
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(28,25,23,0.12);
}
.qr-image svg {
    display: block;
    width: 180px;
    height: 180px;
}
.qr-info { flex: 1; min-width: 280px; }
.qr-info .eyebrow-tag {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}
.qr-info h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}
.qr-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 46em;
}

/* Sección "Apps": cuadrícula de tarjetas, una por app instalable (Ley 431,
   Registros 698) — reemplaza la vieja sección de un solo QR. */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
}

.app-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.25rem 1.75rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(28, 25, 23, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-card .qr-image {
    margin-bottom: 1.25rem;
    padding: 0.85rem;
}

.app-card .qr-image svg {
    width: 140px;
    height: 140px;
}

.app-card .eyebrow-tag { margin-bottom: 0.5rem; }

.app-card h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.app-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* En celular el QR no aporta nada (ya estás en el dispositivo que lo
   instalaría) — se oculta el código pero la tarjeta y el botón se quedan,
   a diferencia de la vieja .qr-section que ocultaba todo el bloque entero. */
@media (max-width: 768px) {
    .apps-section .qr-image { display: none; }
}

/* Hero */
.hero {
    position: relative;
    /* La portada llena toda la pantalla y un poco más (8px = media línea divisoria),
       para que la línea de la sección siguiente quede justo bajo el borde inferior. */
    min-height: calc(100vh + 8px);
    min-height: calc(100lvh + 8px);
    background-color: var(--bg);
    background-image: url('fondo-hero.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 180px !important; /* ¡Aumentado para que el menú no tape el texto al presionar Inicio! */
    border-bottom: 1px solid var(--border);
}


/* Y ajustamos también para que en teléfonos móviles se vea perfecto sin tanto espacio */
@media (max-width: 768px) {
    .hero {
        padding-top: 140px !important;
        /* En pantallas angostas, "center" mostraba solo el hueco vacío entre
           la balanza (izquierda) y la foto (derecha) del fondo. Se reposiciona
           para encuadrar la foto. */
        background-position: 90% center;
    }
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hero-text h1 {
    font-size: 3.2rem;
    color: var(--primary);
    margin-bottom: 1.4rem;
    line-height: 1.15;
    font-weight: 400;
}

.hero-text h1 span {
    font-style: italic;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 auto 1.6rem;
    max-width: 260px;
}
.hero-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #b97a3d, transparent);
}
.hero-divider i {
    color: #b97a3d;
    font-size: 0.95rem;
}

.hero-text p { 
    font-size: 1.15rem; 
    color: var(--text-light); 
    margin-bottom: 3rem; 
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}
.btn { 
    padding: 0.8rem 2rem; 
    text-decoration: none; 
    font-weight: 500; 
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block; 
    border: 1px solid transparent; 
    border-radius: 6px; /* Bordes suaves */
    cursor: pointer; 
    transition: all 0.3s ease; 
}

.btn-primary { 
    background: var(--primary); 
    color: var(--bg); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:hover { 
    background: var(--primary-light); 
    color: var(--bg);
    transform: translateY(-2px); /* Se eleva */
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: var(--bg);
    color: var(--primary);
    border: 1px solid var(--border);
    margin-left: 1rem;
}

.btn-secondary:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Secciones Generales */
section { padding: 6rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4.5rem; }
.section-header h2 { font-size: 2.2rem; color: var(--primary); margin-bottom: 1.2rem; font-weight: 400;}
.section-header p { color: var(--text-light); max-width: 600px; margin: 0 auto; font-size: 1rem; font-weight: 300;}
.bg-alt { background: var(--bg-alt); }

#servicios {
    background-image: url('fondo-servicios.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Tono crema liso para dar continuidad entre secciones */
#perfil {
    position: relative;
    background-color: #f9ecde;
}

#servicios, .qr-section {
    position: relative;
}

#contacto {
    position: relative;
    background-color: #f9ecde;
    background-image: url('fondo-contacto.webp');
    background-size: 640px auto;
    background-position: center top;
    background-repeat: repeat;
}

/* Separador de secciones: línea de lado a lado sobre la costura, con el icono
   al centro; se desvanece hacia los bordes de la pantalla. */
.section-seam {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    width: 100%;
    z-index: 2;
}
.section-seam span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #b97a3d);
}
.section-seam span:last-child {
    background: linear-gradient(90deg, #b97a3d, transparent);
}
.section-seam i {
    color: #b97a3d;
    font-size: 0.95rem;
}

#publicaciones {
    position: relative;
    background-color: #f5ddbc;
    background-image: url('fondo-publicaciones.webp');
    background-size: 1536px auto;
    background-position: center;
    background-repeat: no-repeat;
}

/* Perfil Profesional */
.profile-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 5rem;
    align-items: center;
}

.profile-image-area { display: flex; justify-content: center; }

.profile-frame {
    width: 100%;
    max-width: 380px;
    height: 460px;
    overflow: hidden;
    background: #f9ecde;
}

.profile-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    filter: grayscale(20%);
}

.profile-info-area h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.profile-info-area .subtitle {
    font-weight: 400;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    font-size: 0.8rem;
}

.profile-info-area p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 300;
    text-align: justify;
}

.credentials-list {
    list-style: none;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.credentials-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    color: var(--text);
    font-size: 0.95rem;
}

.credentials-list i {
    color: var(--secondary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Estilos para el logo universitario integrado */
.uni-credential {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.uni-logo-wrapper {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.uni-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.75;
}

@media (max-width: 992px) {
    .profile-wrapper { grid-template-columns: 1fr; gap: 4rem; }
    .profile-frame { height: 400px; }
}

/* Áreas de Práctica */
.services-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 3rem; 
}

.service-card { 
    background: transparent; 
    padding: 2rem 0; 
    border-top: 1px solid var(--border); 
    transition: all 0.3s ease;
}

.service-card:hover { border-top-color: var(--primary); }

.service-icon { 
    font-size: 1.8rem; 
    color: var(--secondary); 
    margin-bottom: 1.5rem; 
    display: block;
}

.service-card h3 { 
    color: var(--primary); 
    margin-bottom: 1rem; 
    font-size: 1.4rem;
    font-weight: 400;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 300;
    text-align: justify;
}

/* Publicaciones Jurídicas */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 4rem;
}

.blog-post {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2.5rem;
    transition: border-bottom-color 0.3s ease;
}

.blog-post:hover { border-bottom-color: var(--primary); }

.blog-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
}

.blog-post h3 {
    font-size: 1.6rem;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 400;
}

.blog-post h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-post h3 a:hover { color: var(--secondary); }

.blog-post p {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.read-more {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.read-more:hover { gap: 0.8rem; color: var(--secondary); }

/* Testimonios */
.testimonials-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 3rem; 
}

.testimonial-card {
    background: transparent; 
    position: relative;
}

.testimonial-text { 
    font-family: 'Playfair Display', serif;
    font-style: italic; 
    color: var(--primary); 
    font-size: 1.1rem;
    margin-bottom: 1.5rem; 
    line-height: 1.5;
}

.testimonial-author { 
    font-weight: 400; 
    color: var(--text-light); 
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* FAQ */
.faq-item {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.8rem 0;
    background: none;
    border: none;
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 300;
}

.faq-item.active .faq-answer { padding-bottom: 1.8rem; max-height: 300px; }
.faq-item.active .faq-question { color: var(--secondary); }
.faq-question i { font-size: 0.9rem; transition: transform 0.3s; color: var(--text-light); }
.faq-item.active .faq-question i { transform: rotate(45deg); }

/* Formulario de Contacto Minimalista */
.contact-section {
    padding: 6rem 2rem;
}

.contact-form-container {
    max-width: 650px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.9rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--primary);
    transition: border-bottom-color 0.3s;
    border-radius: 0;
}

.form-control:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

select.form-control {
    cursor: pointer;
    padding-bottom: 0.6rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-submit-area {
    margin-top: 2.5rem;
    text-align: center;
}

.form-submit-area .btn {
    width: 100%;
    padding: 1rem;
}

/* WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 55px;
    height: 55px;
    bottom: 40px;
    right: 40px;
    background-color: var(--primary);
    color: var(--bg);
    border-radius: 50%;
    text-align: center;
    font-size: 1.4rem;
    border: 1px solid var(--border);
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.05);
    background-color: var(--secondary);
}

/* Footer */
footer { 
    background: var(--primary); 
    color: var(--bg); 
    padding: 6rem 2rem; 
    text-align: center; 
    border-top: 1px solid var(--primary-light);
}

footer h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--bg);
    font-weight: 400;
}

footer p {
    color: var(--secondary-light);
    font-weight: 300;
    font-size: 0.95rem;
}

.footer-btn { margin: 2.5rem 0; display: inline-block; }

.footer-btn .btn-contact { 
    border: 1px solid var(--secondary-light); 
    color: var(--primary); 
    background: var(--secondary-light);
}

.footer-btn .btn-contact:hover { 
    background: transparent; 
    color: var(--bg); 
    border-color: var(--bg);
}

.footer-btn .btn-contact i {
    margin-right: 0.5rem;
}

/* ==========================================================================
   CONFIGURACIÓN FINAL DEL LOGO (CON NUEVO SELLO NEGRO TRANSPARENTE)
   ========================================================================== */

/* 1. Contenedor principal: Sello y texto uno al lado del otro (formato horizontal ultra-elegante) */
.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-decoration: none;
}

.logo-tagline {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.68rem;
    color: var(--secondary);
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1.15;
    max-width: 210px;
    white-space: normal;
}
@media (max-width: 768px) {
    .logo-tagline { display: none; }
}

/* 2. Ajuste del NUEVO sello negro (prominente y elegante) */
.logo-seal {
    width: 110px;         /* Tamaño destacado para presencia de marca */
    height: auto;
    /* mix-blend-mode: multiply; -> ¡ELIMINADO! Ya no es necesario */
    /* filter: contrast(1.1);    -> ¡ELIMINADO! Ya no es necesario */
    animation: sealSlideIn 0.4s ease-out;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover .logo-seal {
    transform: scale(1.08);
    filter: drop-shadow(0 8px 6px rgba(0,0,0,.55));
}

/* El sello entra desde la izquierda y se detiene junto al texto "Despacho legal" */
@keyframes sealSlideIn {
    from {
        transform: translateX(-90px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 3. Mantenemos la tipografía y los colores originales del texto */
.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--primary); /* Variable correcta de tu proyecto */
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
}

/* Estilo para la palabra 'legal' en dorado e itálica */
.logo-text span {
    font-weight: 300;
    color: var(--secondary); /* Variable dorada/taupe de tu proyecto */
    font-style: italic;
    text-transform: lowercase;
}

/* --- Ajuste optimizado para teléfonos móviles --- */
@media (max-width: 768px) {
    .logo {
        gap: 8px;
    }
    .logo-seal {
        width: 40px; /* Sello un poco más pequeño en celulares */
    }
    .logo-text {
        font-size: 1.1rem;
    }
}

@media(max-width:768px){
    .whatsapp-float{
        width:50px;
        height:50px;
        right:20px;
        bottom:20px;
    }
}

@media(max-width:480px){
    .whatsapp-float{
        right:16px;
        bottom:16px;
    }
}

/* ===== Asistente virtual (chat) =====
   El botón reusa la clase .whatsapp-float para su posición y su
   comportamiento responsive; .chat-launcher solo cambia su apariencia. */
.chat-launcher{
    background: linear-gradient(135deg, #dba05f, #b97a3d);
    border: 1px solid #000;
    padding: 0;
}
.chat-launcher:hover{
    background: linear-gradient(135deg, #e6ac6e, #cf9152);
}
#chat-widget.is-open .chat-launcher{
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.chat-panel{
    position: fixed;
    right: 40px;
    bottom: 105px;
    width: 480px;
    max-width: calc(100vw - 32px);
    height: min(560px, calc(100vh - 140px));
    background: rgba(26, 22, 20, 0.82);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid #000;
    border-radius: 14px;
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(.98);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 1001;
}
#chat-widget.is-open .chat-panel{
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-panel-head{
    background: rgba(0, 0, 0, 0.4);
    color: #fafaf9;
    padding: 0.95rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-avatar{
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dba05f, #b97a3d);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-who{ flex: 1; min-width: 0; }
.chat-name{
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
}
.chat-status{
    font-size: 0.7rem;
    color: var(--secondary-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
}
.chat-status::before{
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6fae7f;
    display: inline-block;
}
.chat-icon-btn{
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #dba05f;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chat-icon-btn:hover{ color: #e6ac6e; background: rgba(219,160,95,0.16); border-color: rgba(219,160,95,0.4); }
.chat-icon-btn:focus-visible{ outline: 2px solid #dba05f; outline-offset: 2px; }

.chat-body{
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: transparent;
    scrollbar-color: #b97a3d transparent;
    scrollbar-width: thin;
}
.chat-body::-webkit-scrollbar{ width: 8px; }
.chat-body::-webkit-scrollbar-track{ background: transparent; }
.chat-body::-webkit-scrollbar-thumb{
    background: linear-gradient(180deg, #dba05f, #b97a3d);
    border-radius: 999px;
}
.chat-body::-webkit-scrollbar-thumb:hover{ background: #e6ac6e; }
.chat-msg{
    max-width: 90%;
    font-size: 0.77rem;
    line-height: 1.55;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1.5px solid rgba(0,0,0,0.6);
}
.chat-msg-bot{
    align-self: flex-start;
    background: rgba(58, 53, 49, 0.78);
    color: #f2ede6;
    border-bottom-left-radius: 3px;
}
.chat-msg-user{
    align-self: flex-end;
    background: rgba(87, 80, 74, 0.82);
    color: #fdfaf6;
    border-bottom-right-radius: 3px;
}
.chat-typing{
    align-self: flex-start;
    display: flex;
    gap: 4px;
    background: rgba(58, 53, 49, 0.78);
    border: 1.5px solid rgba(0,0,0,0.6);
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border-bottom-left-radius: 3px;
}
.chat-typing span{
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary-light);
    animation: chatBounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2){ animation-delay: .15s; }
.chat-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes chatBounce{
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-disclaimer{
    font-size: 0.68rem;
    color: var(--secondary-light);
    text-align: center;
    padding: 0.4rem 1rem 0;
    line-height: 1.4;
}

.chat-foot{
    padding: 0.7rem 0.8rem 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.chat-composer{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1.5px solid rgba(0,0,0,0.6);
    border-radius: 999px;
    padding: 0.3rem 0.3rem 0.3rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
}
.chat-whatsapp-link{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    font-size: 0.74rem;
    font-weight: 600;
    color: #dba05f;
    text-decoration: none;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(219,160,95,0.35);
    background: rgba(219,160,95,0.08);
    transition: background .15s ease, color .15s ease;
}
.chat-whatsapp-link i{ font-size: 0.95rem; }
.chat-msg-aviso p{ margin: 0 0 0.55rem; font-weight: 600; }
.chat-aviso-whatsapp{
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #1f1b17;
    background: #dba05f;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
}
.chat-aviso-whatsapp:hover{ background: #e6ac6e; }
.chat-whatsapp-link:hover{ color: #e6ac6e; background: rgba(219,160,95,0.16); }
.chat-composer input{
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    background: transparent;
    color: #f2ede6;
}
.chat-composer input::placeholder{ color: var(--secondary-light); }
.chat-send{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #dba05f, #b97a3d);
    color: #1c1917;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter .15s ease;
}
.chat-send:hover{ filter: brightness(1.06); }
.chat-send:focus-visible{ outline: 2px solid #dba05f; outline-offset: 2px; }

.chat-lead-card{
    align-self: stretch;
    max-width: 100%;
    background: rgba(58, 53, 49, 0.78);
    border: 1.5px solid rgba(0,0,0,0.6);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.chat-lead-card p{
    margin: 0;
    font-size: 0.77rem;
    line-height: 1.55;
    color: #f2ede6;
}
.chat-lead-card input{
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid rgba(0,0,0,0.6);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    background: rgba(255,255,255,0.06);
    color: #f2ede6;
    font-family: 'Inter', sans-serif;
    font-size: 0.77rem;
    outline: none;
}
.chat-lead-card input::placeholder{ color: var(--secondary-light); }
.chat-lead-card button{
    align-self: flex-start;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, #dba05f, #b97a3d);
    color: #1c1917;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.chat-lead-card button:hover{ filter: brightness(1.06); }
.chat-lead-card button:disabled{ opacity: 0.6; cursor: default; }
.chat-lead-card .chat-lead-note{
    font-size: 0.68rem;
    color: var(--secondary-light);
    margin: 0;
}

@media(max-width:768px){
    .chat-panel{ right: 20px; bottom: 80px; }
}
@media(max-width:480px){
    .chat-panel{ right: 16px; bottom: 76px; }
}