/* --- Variables de Diseño y Paleta de Colores --- */
:root {
    --primary-dark: #0f172a;       /* Azul oscuro profundo */
    --text-main: #1e293b;          /* Azul grisáceo para textos principales */
    --text-muted: #64748b;         /* Texto secundario/explicativo */
    --accent-blue: #38bdf8;        /* Celeste brillante para bordes y interacciones */
    --bg-badge: #e0f2fe;           /* Fondo celeste claro del badge */
    --bg-light: #ffffff;           /* Fondo blanco puro */
    --border-color: #cbd5e1;       /* Gris claro para bordes */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

/* --- Estilos Generales --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Cabecera / Navbar FIJO --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #f1f5f9;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* Empuja el contenido para que el navbar no tape el inicio */
.main-wrapper {
    margin-top: 80px; 
}

.navbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-dark);
    text-decoration: none;
    line-height: 1;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-email {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-login {
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.btn-login:hover {
    color: var(--accent-blue);
}

/* --- BOTÓN DE MANUAL DE USUARIO --- */
.btn-manual {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.btn-manual:hover {
    color: var(--accent-blue);
}

/* --- BOTÓN DE SUSCRIPCIÓN --- */
.btn-subscription {
    text-decoration: none;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-subscription:hover {
    background-color: #1d4ed8;
    transform: scale(1.02);
}

/* --- Botón del Chatbot dentro del Navbar (Adaptado a tu Foto/Logo) --- */
.chatbot-nav-btn {
    background-color: var(--primary-dark);
    border: none;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
    overflow: hidden !important;   /* Recorta cualquier exceso de la foto */
    padding: 0 !important;
    flex-shrink: 0;
}

.chatbot-nav-btn:hover {
    transform: scale(1.08);
}

.chatbot-nav-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;  /* Rellena el círculo sin deformar */
    border-radius: 50% !important;
    display: block !important;
}

/* --- Sección Hero --- */
.hero-section {
    max-width: 800px;
    margin: 4rem auto 2rem auto;
    text-align: center;
    padding: 0 1.5rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- CONTADOR ESTILO PUNTICO VERDE EN VIVO --- */
.visitor-counter-box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-light);
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.live-dot-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #d1fae5;
    border-radius: 50%;
}

.live-dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
}

.live-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #10b981;
    border-radius: 50%;
    opacity: 0.4;
    animation: livePulseAnim 2s infinite ease-in-out;
}

@keyframes livePulseAnim {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

.visitor-counter-box mark {
    background: none;
    color: #2563eb;
    font-weight: 800;
}

/* --- Sección del Ecosistema Soma IA (PWA) --- */
.pwa-section {
    background-color: #f8fafc; 
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 5rem 1.5rem;
    text-align: center;
}

.pwa-badge {
    display: inline-block;
    background-color: var(--bg-badge);
    color: #0369a1;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.pwa-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 3rem;
}

/* --- ESTRUCTURA DE TARJETAS EN COLUMNAS SOMA --- */
.soma-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 950px;
    margin: 0 auto 3rem auto;
    text-align: left;
}

.soma-card {
    background-color: var(--bg-light);
    border: 1px solid #e2e8f0;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.soma-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: #3b82f6;
}

.soma-card-icon {
    width: 38px;
    height: 38px;
    background-color: #eff6ff;
    color: #2563eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}

.soma-card-icon.purple-variant {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.soma-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.soma-card p {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.6;
}

.card-tag {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
}

.card-tag.purple-text { color: #7c3aed; }
.card-tag.orange-text { color: #f59e0b; }

.pwa-intro-text {
    max-width: 800px;
    margin: 0 auto 4rem auto;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Grid de Características PWA */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background-color: var(--bg-light);
    border: 1px solid #e2e8f0;
    padding: 2.5rem 2rem;
    border-radius: 20px; 
    text-align: left;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card.hover-orange:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: #f59e0b; }
.feature-card.hover-purple:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: #7c3aed; }
.feature-card.hover-blue:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: #2563eb; }

.feature-icon {
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    font-weight: normal;
}

.feature-icon.orange { background-color: #fefbeb; color: #f59e0b; }
.feature-icon.purple { background-color: #faf5ff; color: #a78bfa; }
.feature-icon.blue { background-color: #eff6ff; color: #3b82f6; }

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Ventana Flotante del Chatbot --- */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-action-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 85%;
    align-self: flex-start;
    margin-top: 2px;
}

.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 500px;
    background-color: var(--bg-light);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chatbot-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chatbot-header {
    background-color: #7dd3fc;
    color: var(--primary-dark);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* --- BLINDAJE IMAGEN DENTRO DE LA VENTANA CHATBOT --- */
.chatbot-header-img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0;
}

.chatbot-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
    line-height: 1;
}

.chatbot-body {
    flex: 1;
    padding: 1rem;
    background-color: #f8fafc;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-action-chat {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-action-blue {
    background-color: #ffffff;
    border: 1px solid #38bdf8;
    color: #0284c7;
}

.btn-action-blue:hover {
    background-color: #f0f9ff;
    transform: translateX(2px);
}

.btn-action-red {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    text-align: center;
    margin-top: 4px;
}

.btn-action-red:hover {
    background-color: #fecaca;
}        

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message {
    background-color: #e2e8f0;
    color: var(--text-main);
    align-self: flex-start;
    border-top-left-radius: 4px;
}

.user-message {
    background-color: var(--primary-dark);
    color: #ffffff;
    align-self: flex-end;
    border-top-right-radius: 4px;
}

.chatbot-footer {
    padding: 0.8rem;
    background-color: var(--bg-light);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.chat-input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.chat-send-btn {
    background-color: var(--primary-dark);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.chat-send-btn:disabled {
    background-color: #cbd5e1 !important;
    cursor: not-allowed !important;
}

.chat-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 85%;
    align-self: flex-start;
    margin-top: 2px;
}

.chat-option-btn {
    background-color: #ffffff;
    border: 1px solid #38bdf8;
    color: #0284c7;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: left;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
}

.chat-option-btn:hover {
    background-color: #f0f9ff;
    transform: translateX(2px);
}

/* --- ESTILO DEL PIE DE PÁGINA OSCURO CORPORATIVO --- */
.footer {
    background-color: #0c1524; 
    color: #a0aec0;
    text-align: center;
    padding: 2.2rem 1.5rem;
    font-size: 0.85rem;
    border-top: 1px solid #1a2638;
    margin-top: auto;
}

.footer p {
    margin: 0;
    letter-spacing: 0.025em;
}

/* --- Responsividad --- */
@media (max-width: 900px) {
    .navbar {
        position: relative; 
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .main-wrapper {
        margin-top: 0;
    }
    .navbar-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    .soma-cards-grid {
        grid-template-columns: 1fr;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .chatbot-window {
        width: calc(100% - 40px);
        bottom: 10px;
        right: 20px;
    }
}