@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Crimson+Pro:wght@400;600;700&display=swap');

:root {
    /* TEMA CARBONO (Dark - Puro Blanco y Negro) */
    --bg-main: #0A0A0A;
    --sidebar-bg: #111111;
    --topbar-bg: transparent;
    --accent: #FFFFFF;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --text-main: #FFFFFF;
    --text-muted: #777777;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);

    --font-modern: 'Inter', sans-serif;
    --font-legal: 'Crimson Pro', serif;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

/* TEMA CLARO - ALTO CONTRASTE */
body.theme-light {
    --bg-main: #FFFFFF;
    --sidebar-bg: #F7F7F7;
    --topbar-bg: transparent;
    --accent: #000000;
    --accent-glow: rgba(0, 0, 0, 0.1);
    --text-main: #000000;
    --text-muted: #1A1A1A;
    /* Mucho más oscuro para visibilidad */
    --border: #D1D5DB;
    --input-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-modern);
    height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition), color var(--transition);
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 40px 25px;
    z-index: 100;
    transition: var(--transition);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header .logo {
    font-family: var(--font-modern);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-main);
    margin-bottom: 50px;
    text-transform: uppercase;
}

.ia-highlight {
    color: var(--accent);
}

.sidebar-nav {
    flex-grow: 1;
}

.nav-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 16px 20px;
    text-align: left;
    font-family: var(--font-modern);
    font-size: 0.85rem;
    font-weight: 700;
    /* Más peso para visibilidad */
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.06);
}

body.theme-carbon .nav-item:hover,
body.theme-carbon .nav-item.active {
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    border-left: 4px solid var(--accent);
}

.sidebar-footer {
    padding-top: 25px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tier-badge {
    align-self: flex-start;
    padding: 4px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.tier-badge.pro {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.status-label span {
    color: var(--text-main);
}

.status-bar {
    height: 6px;
    background: var(--input-bg);
    border-radius: 3px;
    overflow: hidden;
}

.status-progress {
    height: 100%;
    background: var(--accent);
    transition: width 0.5s ease;
}

.status-progress.highlight {
    background: #4A90E2;
}

.extras-info {
    font-size: 0.7rem;
    color: #4CAF50;
    font-weight: 600;
}

.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    border-radius: 10px;
    font-family: var(--font-modern);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.action-btn.primary {
    background: var(--accent);
    color: var(--bg-main);
}

.action-btn.secondary {
    background: transparent;
    color: var(--text-main);
}

.action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Top Bar - BOTONES ARRIBA (Más compacta) */
.top-bar {
    height: 40px;
    /* Reducido al mínimo */
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    z-index: 50;
    position: relative;
    margin-top: 10px;
    /* Pequeño margen desde arriba */
}


/* Logo en el sidebar - sobre la línea de footer */
.sidebar-logo-area {
    padding: 0 0 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    opacity: 1;
    transition: var(--transition);
    pointer-events: none;
}

body.theme-light .sidebar-logo {
    content: url('logo_bold.png');
}


.top-bar-left {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--sidebar-bg);
}

/* Fix visibilidad iconos toggle */
.theme-toggle span {
    filter: none !important;
}

body.theme-light .theme-toggle .light-icon {
    display: none;
}

body.theme-carbon .theme-toggle .dark-icon {
    display: none;
}

.login-btn-top {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--accent);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn-top:hover {
    background: var(--accent);
    color: var(--bg-main);
}

.google-btn-container {
    display: flex;
    align-items: center;
    position: relative;
}

.user-profile-container {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-trigger:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

#profile-email {
    font-size: 0.8rem;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-dropdown {
    position: fixed;
    top: 0;
    right: -320px; /* Hidden offscreen */
    width: 320px;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    display: block !important;
    transition: right 0.3s ease;
    padding: 30px 15px; /* Spacing */
    background: var(--sidebar-bg);
    border: none;
    border-left: 1px solid var(--border);
    z-index: 1000;
}

.profile-dropdown.active {
    right: 0;
    box-shadow: -4px 0 30px rgba(0,0,0,0.6);
}
.dropdown-header {
    padding: 8px 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.dropdown-status {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dd-status-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dd-status-item span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dd-progress-bg {
    height: 4px;
    background: var(--input-bg);
    border-radius: 2px;
    overflow: hidden;
}

.dd-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.5s ease;
}

.dd-progress-fill.highlight {
    background: #4A90E2;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: var(--input-bg);
    color: var(--accent);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.dropdown-item.logout {
    color: #FF4B2B;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
.content-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
    overflow-y: auto;
    width: 100%;
}

/* Contenedor interior centrado con max-width para no verse tan abierto */
.chat-section-inner {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.chat-header {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 20px;
}

.chat-header h1 {
    font-family: var(--font-modern);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Chat Input */
.input-container {
    padding: 20px 50px 50px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.input-wrapper {
    background: var(--input-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px 30px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
}

textarea {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-modern);
    font-size: 1.1rem;
    outline: none;
    resize: none;
    min-height: 28px;
    max-height: 200px;
    overflow-y: hidden;
    line-height: 1.6;
    align-self: flex-end;
}

textarea::-webkit-scrollbar {
    width: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

#send-btn {
    background: var(--accent);
    color: var(--bg-main);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.hidden {
    display: none !important;
}

.search-mode-bar {
    display: none; /* Old bar */
}

/* Chat Modes Toolbar */
.chat-modes-toolbar {
    display: flex;
    gap: 10px;
    padding: 0 10px 10px 10px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; transform: scale(0.98); }
    100% { opacity: 1; }
}

.chat-mode-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 6px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chat-mode-btn:hover {
    background: rgba(51, 109, 255, 0.05);
    color: var(--text-main);
}

.chat-mode-btn.active {
    background: rgba(51, 109, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(51, 109, 255, 0.3);
}

.mode-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-modern);
}

.mode-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.mode-btn.active {
    background: var(--accent);
    color: var(--bg-main);
    border-color: var(--accent);
    font-weight: 600;
}

.mode-label {
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    margin-left: 4px;
    transition: color 0.2s;
}

/* Superindices de citas legales */

.legal-ref {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 2px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
}

.legal-ref:hover {
    opacity: 1;
    transform: scale(1.1);
    text-decoration: underline dotted;
}

/* Anchor links inside superscripts */
.legal-ref .ref-anchor {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.legal-ref .ref-anchor:hover {
    text-decoration: underline;
}

/* Highlight flash when a reference card is scrolled-to */
.refs-list li.ref-highlight {
    border-color: var(--accent) !important;
    background: rgba(201, 168, 76, 0.12) !important;
    transition: border-color 0.3s, background 0.3s;
}

/* Citas legales largas (blockquote) */
.legal-cite {
    position: relative;
    border-left: 3px solid var(--accent, #c9a84c);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(201, 168, 76, 0.02));
    margin: 18px 0 18px 0;
    padding: 16px 20px 16px 24px;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(232, 232, 232, 0.78);
    border-radius: 0 10px 10px 0;
}

.legal-cite::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 8px;
    font-size: 2.8rem;
    font-family: Georgia, serif;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

/* Separador de sección */
.legal-hr {
    border: none;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    margin: 24px 0;
}

/* Callouts del agente */
.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 16px 0;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.65;
}

.callout-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout-body strong {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 4px;
}

/* ⚠️ ADVERTENCIA — ámbar */
.callout-warning {
    border-left: 3px solid #e0a842;
    background: linear-gradient(135deg, rgba(224, 168, 66, 0.1), rgba(224, 168, 66, 0.04));
}
.callout-warning .callout-body strong {
    color: #e0a842;
}

/* 📌 NOTA — azul neutro */
.callout-nota {
    border-left: 3px solid #5b9bd5;
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.1), rgba(91, 155, 213, 0.04));
}
.callout-nota .callout-body strong {
    color: #5b9bd5;
}

/* Clave de referencia [1], [S1] en la lista de referencias */
.ref-key {
    color: var(--accent, #c9a84c);
    font-weight: 700;
    font-size: 0.82rem;
    margin-right: 4px;
    opacity: 0.85;
}

/* Wrapper de mensajes */
.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.user-wrapper {
    align-items: flex-end;
}

.bot-wrapper {
    align-items: flex-start;
}

/* Barra de acciones debajo de cada respuesta del bot */
.bot-actions-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-top: 2px;
}

.bot-wrapper:hover .bot-actions-bar {
    opacity: 1;
}

.bot-actions-rating,
.bot-actions-premium {
    display: flex;
    align-items: center;
    gap: 2px;
}

.bot-actions-rating {
    margin-right: 8px;
    border-right: 1px solid var(--border);
    padding-right: 8px;
}

.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text-muted, #888);
    transition: background 0.15s, color 0.15s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-icon-btn:hover {
    background: var(--border);
    color: var(--text-main);
}

.action-icon-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-icon-btn.rated {
    color: var(--accent);
    opacity: 1;
}

.premium-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--accent);
    color: var(--bg-main);
    border-radius: 3px;
    padding: 1px 3px;
    letter-spacing: 0.03em;
}

.ref-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.75rem;
    opacity: 0.85;
    word-break: break-all;
}

.ref-link:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Sección de referencias legales */
.refs-section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.refs-section > strong {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.refs-list {
    margin: 12px 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.refs-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.5;
}

.refs-list li:hover {
    border-color: rgba(201, 168, 76, 0.35);
    background: rgba(201, 168, 76, 0.04);
}

.ref-checkbox {
    margin-top: 5px;
    accent-color: var(--accent);
    transform: scale(1.1);
    cursor: pointer;
}

.profundizar-float-btn {
    display: block;
    margin: 14px 0 0 0;
    padding: 10px 16px;
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.profundizar-float-btn:hover {
    background: var(--accent);
    color: var(--bg-main);
}

.ref-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.ref-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ref-key {
    color: var(--accent, #c9a84c);
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.ref-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.ref-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ref-dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.4;
}

.ref-fecha {
    opacity: 0.6;
    font-size: 0.75rem;
}

.nota-historica {
    margin-top: 10px;
    font-size: 0.78em;
    color: var(--text-muted, #999);
    border-left: 2px solid var(--border);
    padding-left: 8px;
}

/* Marketing Section fixes for high contrast */
.marketing-presentation h2 {
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.testimonial-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 20px;
    transition: var(--transition);
}

.testimonial-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* Chat Messages */
.message {
    margin-bottom: 20px;
    padding: 15px 25px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-self: flex-end;
    background: var(--accent);
    color: var(--bg-main);
    font-weight: 500;
}

.bot-message {
    align-self: flex-start;
    background: var(--input-bg);
    border: 1px solid var(--border);
    font-family: var(--font-modern);
    font-size: 0.95rem;
    text-align: justify;
    line-height: 1.78;
    padding: 28px 32px;
    border-radius: 16px;
    animation: slideUpFade 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bot-message p {
    margin-bottom: 1.25rem;
}

/* Formato estructurado para bloques de texto legal */
.bot-message blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.2rem;
    margin: 1.25rem 0;
    font-style: italic;
    color: var(--text-muted);
    background: rgba(51, 109, 255, 0.03);
    border-radius: 0 8px 8px 0;
    padding-top: 5px;
    padding-bottom: 5px;
}

.bot-message ol, .bot-message ul {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.bot-message li {
    margin-bottom: 0.6rem;
}

/* Jerarquía de listas ordenadas: I, 1, a */
.bot-message ol {
    list-style-type: upper-roman;
}
.bot-message ol ol {
    list-style-type: decimal;
}
.bot-message ol ol ol {
    list-style-type: lower-alpha;
}

.loading-msg {
    opacity: 0.9;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: row;
    align-items: center;
    background: transparent;
}

.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 1.25em;
    background-color: var(--accent);
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: blinkCursor 0.8s step-end infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-text {
    font-style: italic;
    color: var(--accent);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-box {
    display: flex;
    flex-direction: column;
}

.welcome-message {
    text-align: center;
    color: var(--text-muted);
    margin: 40px 0;
    font-style: italic;
}

/* Legal Article Styling (¿Qué es Sentent-IA?) */
.legal-article-container {
    padding: 20px 0;
    line-height: 1.8;
}

.legal-main-title {
    font-family: var(--font-modern);
    font-size: 3rem;
    margin-bottom: 10px;
    text-align: center;
}

.legal-slogan {
    font-family: var(--font-modern);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent);
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: 1px;
}

.legal-content section {
    margin-bottom: 50px;
}

.legal-content h2 {
    font-family: var(--font-modern);
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.legal-content p {
    font-family: var(--font-modern);
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-main);
    opacity: 0.9;
}

.legal-content ul {
    margin-bottom: 25px;
    padding-left: 20px;
}

.legal-content li {
    font-family: var(--font-modern);
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--text-main);
    opacity: 0.9;
}

.legal-content li strong {
    color: var(--accent);
    font-family: var(--font-modern);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-content a {
    color: var(--accent);
    text-decoration: underline;
}

.legal-footer {
    margin-top: 80px;
    padding: 40px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: center;
}

.legal-footer p {
    font-size: 1.4rem;
    margin-bottom: 0;
}

/* ============================================
   TIMELINE — ¿Qué es Sentent-IA?
   ============================================ */
.timeline-header {
    padding: 40px 0 50px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 50px;
}

.timeline-main-title {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.timeline-slogan {
    font-size: 1rem;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.timeline {
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
}

.timeline-item {
    display: flex;
    gap: 40px;
    min-height: 160px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 54px;
}

.timeline-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 1;
}

.timeline-item:hover .timeline-circle {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-main);
}

.timeline-circle-last {
    border-color: var(--accent);
    color: var(--accent);
}

.timeline-line {
    flex-grow: 1;
    width: 1px;
    background: var(--border);
    margin: 8px 0;
    min-height: 80px;
}

.timeline-content {
    padding: 10px 0 60px;
    flex-grow: 1;
}

.timeline-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.timeline-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.timeline-content p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-main);
    opacity: 0.85;
    margin-bottom: 16px;
    max-width: 680px;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-list li {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.85;
    padding-left: 0;
}

.timeline-list li strong {
    color: var(--text-main);
    opacity: 1;
}

/* Pill grid para features */
.timeline-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.timeline-pill {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.timeline-pill:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.pill-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
}

.pill-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.timeline-closing {
    margin-top: 30px;
    padding: 24px 30px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 1rem;
    font-style: italic;
    color: var(--text-muted);
    max-width: 600px;
}

.timeline-content a {
    color: var(--accent);
    text-decoration: underline;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* ============================================
   CONTACTO & COMUNIDAD
   ============================================ */
.contact-header {
    padding: 40px 0 50px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 50px;
}

.contact-main-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.contact-lead {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 720px;
}

/* Grid de 2 columnas */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.contact-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.contact-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.contact-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.contact-card-tagline {
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.contact-card-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-main);
    opacity: 0.85;
    margin: 0;
}

.contact-benefit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-benefit-list li {
    font-size: 0.92rem;
    line-height: 1.6;
    opacity: 0.85;
    padding-left: 16px;
    position: relative;
}

.contact-benefit-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Botones CTA */
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-modern);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.cta-btn-primary {
    background: var(--accent);
    color: var(--bg-main);
}

.cta-btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.cta-btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.cta-btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Email Pills */
.contact-email-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.contact-email-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.email-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.email-pill {
    display: inline-block;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
    width: fit-content;
}

.email-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Formulario */
.contact-form-section {
    border-top: 1px solid var(--border);
    padding-top: 50px;
    margin-bottom: 60px;
}

/* Muro de Honor */
.muro-honor-section {
    border-top: 1px solid var(--border);
    padding-top: 70px;
    padding-bottom: 30px;
    margin-top: 40px;
    text-align: left;
}

.muro-honor-section .contact-section-title {
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.muro-honor-section .contact-section-sub {
    margin: 0 0 30px 0;
    max-width: 600px;
}

.honor-board {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 14px;
    max-height: 200px;
    align-content: flex-start;
}

.honor-tag {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-block;
    width: fit-content;
    margin-right: 30px;
}

.honor-tag-purple {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.1);
}

.honor-tag-blue {
    background: rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.4);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.1);
}

.contact-section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.contact-section-sub {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 600px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 720px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-modern);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    resize: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group select option {
    background: var(--sidebar-bg);
}

.form-submit-btn {
    width: fit-content;
    padding: 14px 30px;
    font-size: 0.9rem;
}

/* Cita de cierre */
.contact-quote {
    border-top: 1px solid var(--border);
    padding-top: 40px;
    padding-bottom: 60px;
    text-align: center;
    color: var(--text-muted);
}

.contact-quote p {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 10px;
}

.contact-quote span {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Responsive: 1 columna en pantallas pequeñas */
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRICING & PLANS (Fase 3 - 4 Niveles)
   ============================================ */
.pricing-header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.pricing-header h1 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--accent);
}


.pricing-header p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.pricing-grid {
    display: grid;
    /* Grid de 2 o 4 columnas dependiendo de la pantalla, para 4 planes */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 0 auto 60px;
    max-width: 1300px;
    /* Ancho mayor para alojar 4 cards comodamente */
}

/* En pantallas muy grandes, forzar 4 columnas exactas */
@media (min-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pricing-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px 25px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pricing-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.pricing-card.featured {
    border-width: 2px;
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    transform: scale(1.02);
    z-index: 2;
}

body.theme-light .pricing-card.featured {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 100%);
}

.pricing-card.featured:hover {
    transform: scale(1.02) translateY(-8px);
}

.pricing-card.premium-card {
    background: linear-gradient(180deg, #111 0%, #000 100%);
    border-color: #333;
}

body.theme-light .pricing-card.premium-card {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    border-color: #ccc;
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-main);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.plan-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.pricing-card h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    text-align: center;
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-align: center;
}

.plan-price span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
}

.plan-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

.plan-features {
    list-style: none;
    margin-bottom: 40px;
    flex-grow: 1;
}

.plan-features li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.plan-features li::before {
    content: "✓";
    color: var(--accent);
    font-weight: 800;
    margin-top: 2px;
}

.plan-features li:last-child {
    border-bottom: none;
}

.cta-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    cursor: pointer;
    font-family: var(--font-modern);
}

.cta-btn-primary {
    background: var(--accent);
    color: var(--bg-main);
    border: none;
}

.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cta-btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.cta-btn-outline:hover {
    background: var(--accent);
    color: var(--bg-main);
}

/* Footer Quote - Pricing */
.pricing-footer-quote {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: center;
}

body.theme-light .pricing-footer-quote {
    background: rgba(0, 0, 0, 0.02);
}

.pricing-footer-quote h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.pricing-footer-quote p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.classic-quote {
    font-family: var(--font-legal);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-main);
    margin: 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.classic-quote small {
    display: block;
    font-family: var(--font-modern);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: normal;
    margin-top: 10px;
}

/* ============================================
   PRICING DOUBTS BLOCK
   ============================================ */
.pricing-doubts {
    max-width: 640px;
    margin: 70px auto 60px;
    text-align: center;
}

.pricing-doubts h2 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.pricing-doubts>p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.pricing-contact-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px 38px;
    text-align: left;
    transition: var(--transition);
}

.pricing-contact-card:hover {
    border-color: var(--accent);
}

.pricing-contact-card .contact-card-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
    display: block;
}

.pricing-contact-card .contact-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.pricing-contact-card .contact-card-tagline {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 28px;
    display: block;
}

.contact-info-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.contact-info-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

/* ============================================
   MIS DOCUMENTOS & MI CUENTA (Vistas Privadas)
   ============================================ */

/* Contenedores Principales */
.docs-container,
.account-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 25px;
}

.docs-header,
.account-header {
    text-align: left;
    margin-bottom: 40px;
}

.docs-header h1,
.account-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent);
}

.docs-header p,
.account-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Zona Dropzone */
.dropzone {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 50px 20px;
    background: var(--input-bg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

body.theme-light .dropzone:hover,
body.theme-light .dropzone.dragover {
    background: rgba(0, 0, 0, 0.03);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.dropzone-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.dropzone p {
    font-size: 1.2rem;
    color: var(--text-main);
}

.dropzone-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tabla de Documentos */
.docs-table-wrapper {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.docs-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

body.theme-light .docs-table th {
    background: rgba(0, 0, 0, 0.03);
}

.docs-table td {
    padding: 20px 25px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

.docs-table tbody tr {
    transition: var(--transition);
}

.docs-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

body.theme-light .docs-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Elementos de la tabla */
.doc-name-cell {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.doc-icon {
    font-size: 1.5rem;
}

.doc-size,
.doc-date {
    color: var(--text-muted);
}

.btn-delete {
    background: transparent;
    border: 1px solid rgba(255, 60, 60, 0.3);
    color: #ff4d4d;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: #ff4d4d;
    color: #fff;
    border-color: #ff4d4d;
}

.empty-docs {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-style: italic;
}

/* Mi Cuenta Cards */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.account-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px;
    display: flex;
    flex-direction: column;
}

.account-card h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
}

.plan-info {
    margin-bottom: 25px;
    flex-grow: 1;
}

.plan-name {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent);
    color: var(--bg-main);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.account-card p {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 25px;
}

.cta-link {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.cta-link:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg-main);
}

/* Modals */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--sidebar-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 440px;
    width: 95%;
    position: relative;
    color: var(--text-main);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-main);
}

/* ── Success / Thank-You Modal ────────────────────────────────── */
.success-modal-content {
    max-width: 460px;
    text-align: center;
    padding: 44px 36px 36px;
    overflow: hidden;
    position: relative;
}

.success-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
}
.success-confetti span {
    font-size: 1.4rem;
    animation: confettiFall 3s ease-out forwards;
    opacity: 0;
}
.success-confetti span:nth-child(1) { animation-delay: 0.1s; }
.success-confetti span:nth-child(2) { animation-delay: 0.3s; }
.success-confetti span:nth-child(3) { animation-delay: 0.5s; }
.success-confetti span:nth-child(4) { animation-delay: 0.7s; }
.success-confetti span:nth-child(5) { animation-delay: 0.9s; }

@keyframes confettiFall {
    0%   { opacity: 1; transform: translateY(-30px) rotate(0deg) scale(0.6); }
    50%  { opacity: 1; transform: translateY(20px) rotate(180deg) scale(1.2); }
    100% { opacity: 0; transform: translateY(60px) rotate(360deg) scale(0.8); }
}

.success-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
@keyframes successPop {
    0%   { opacity: 0; transform: scale(0.3); }
    100% { opacity: 1; transform: scale(1); }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.success-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.success-message-box {
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.success-message-box p {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
    margin: 0;
}

.success-quote {
    margin-bottom: 24px;
    padding: 0 10px;
}
.success-quote p {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}
.success-quote span {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
}

.success-btn-primary {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.success-btn-outline {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
}

/* ==========================================================
   Mi Cuenta — Layout con Tabs
   ========================================================== */
.acct-layout {
    display: block;
    min-height: calc(100vh - 60px);
    overflow: visible;
}

/* --- Sidebar de tabs --- */
.acct-tabs {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0 24px;
    overflow-y: auto;
}

.acct-tabs-header {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.acct-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.acct-user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acct-plan-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--bg-main);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.acct-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 12px 20px;
    font-size: 0.88rem;
    font-family: var(--font-modern);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    width: 100%;
}

.acct-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.acct-tab.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* --- Área de paneles --- */
.acct-panels {
    overflow-y: auto;
    padding: 40px 50px; max-width: 900px; margin: 0 auto;
    background: var(--bg-main);
}

.acct-panel {
    display: none;
}

.acct-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.acct-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.acct-panel-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}
/* ==========================================================
   Mi Cuenta  Panel Mi Plan
   ========================================================== */
.plan-status-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 8px;
}

.plan-status-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-status-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.plan-status-renewal {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.plan-status-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.plan-quota-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.plan-progress-bg {
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.plan-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.6s ease;
    width: 0%;
}

/* Cards de planes */
.plan-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.plan-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}

.plan-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.plan-card-featured {
    border-color: var(--accent);
    background: linear-gradient(160deg, rgba(99,102,241,0.12), var(--input-bg) 60%);
}

.plan-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-main);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 12px;
    border-radius: 99px;
    white-space: nowrap;
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.plan-card-name {
    font-weight: 700;
    font-size: 1rem;
}

.plan-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
}

.plan-card-price small {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.plan-card-btn {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-modern);
}

.plan-card-btn-current {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    cursor: default;
}

.plan-card-btn-primary {
    background: var(--accent);
    color: #fff;
}

.plan-card-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.plan-card-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.plan-card-btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================
   Mi Asistente
   ========================================================== */
.asst-form { display: flex; flex-direction: column; gap: 24px; max-width: 680px; }
.asst-field { display: flex; flex-direction: column; gap: 6px; }
.asst-label { font-weight: 700; font-size: 0.9rem; color: var(--text-main); }
.asst-hint  { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.asst-textarea {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-modern);
    font-size: 0.9rem;
    resize: vertical;
    transition: var(--transition);
    outline: none;
}
.asst-textarea:focus { border-color: var(--accent); }
.asst-tip {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================
   Referidos
   ========================================================== */
.referral-box { display: flex; flex-direction: column; gap: 28px; max-width: 640px; }
.referral-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 16px;
}
.referral-stat {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    display: flex; flex-direction: column; gap: 6px;
}
.referral-stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.referral-stat-label { font-size: 0.75rem; color: var(--text-muted); }

.referral-link-section {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.referral-link-row {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 10px 14px;
}
.referral-link-text {
    flex: 1; font-size: 0.82rem; color: #a0aff0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.referral-copy-btn {
    background: rgba(139,92,246,0.3);
    border: 1px solid rgba(139,92,246,0.5);
    color: #c4b5fd;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: var(--transition);
}
.referral-copy-btn:hover { background: rgba(139,92,246,0.5); }

.referral-how { background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.referral-how h4 { margin-bottom: 12px; font-size: 0.9rem; }
.referral-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.referral-steps li { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ==========================================================
   Comprar Extras
   ========================================================== */
.extras-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; max-width: 580px; }
.extras-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex; flex-direction: column; gap: 8px;
    transition: var(--transition);
}
.extras-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-2px); }
.extras-card-featured { border-color: var(--accent); background: linear-gradient(160deg,rgba(99,102,241,0.12),var(--input-bg)); }
.extras-icon  { font-size: 2rem; }
.extras-name  { font-weight: 700; font-size: 1rem; }
.extras-amount { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.extras-validity { font-size: 0.78rem; color: var(--text-muted); }
.extras-price { font-size: 1.1rem; font-weight: 700; margin: 6px 0 10px; }
.extras-price small { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.extras-current {
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.85rem;
    color: #fbbf24;
    margin-top: 12px;
    max-width: 580px;
}

/* ==========================================================
   Facturacin
   ========================================================== */
.billing-info-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.billing-info-card {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.billing-info-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.billing-info-value { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.billing-status-active { color: #4ade80; }

.billing-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.billing-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.billing-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* ==========================================================
   Mi Plan  Caja de upgrade simplificada
   ========================================================== */
.plan-upgrade-box {
    margin-top: 28px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.06));
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.plan-upgrade-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.plan-upgrade-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.plan-upgrade-info strong {
    font-size: 1rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
}

.plan-upgrade-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.plan-upgrade-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.plan-upgrade-btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-modern);
    transition: var(--transition);
    white-space: nowrap;
}

.plan-upgrade-btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.plan-upgrade-btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 11px 24px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-modern);
    transition: var(--transition);
    white-space: nowrap;
}

.plan-upgrade-btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ==========================================================
   Mi Asistente  correcciones de layout
   ========================================================== */
.asst-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 100%;
}

.asst-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.asst-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-modern);
    font-size: 0.88rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 110px;
    transition: var(--transition);
    outline: none;
}

.asst-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.asst-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-style: italic;
}

.asst-save-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.asst-saved-msg {
    font-size: 0.88rem;
    color: #4ade80;
    display: none;
}

/* ==========================================================
   CORRECCIN GLOBAL  botones primarios visibles en dark mode
   Problema: en tema carbono --accent=#FFF, haciendo texto+fondo blancos
   Solucin: colores fijos independientes del tema
   ========================================================== */
.plan-upgrade-btn-primary,
.plan-upgrade-btn-secondary,
.plan-card-btn-primary,
.plan-card-btn-outline,
.plan-card-btn-current,
.referral-copy-btn,
.extras-card .plan-card-btn-primary,
.extras-card .plan-card-btn-outline {
    /* Forzar fuente correcta */
    font-family: var(--font-modern, sans-serif);
}

.plan-upgrade-btn-primary,
.plan-card-btn-primary {
    background: #6366f1 !important;
    color: #ffffff !important;
    border: none !important;
}

.plan-upgrade-btn-primary:hover,
.plan-card-btn-primary:hover {
    background: #4f46e5 !important;
    opacity: 1 !important;
}

.plan-upgrade-btn-secondary {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: var(--text-main) !important;
}

.plan-upgrade-btn-secondary:hover {
    border-color: #6366f1 !important;
    color: #6366f1 !important;
}

.plan-card-btn-outline {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: var(--text-main) !important;
}

.plan-card-btn-outline:hover {
    border-color: #6366f1 !important;
    color: #6366f1 !important;
}

.plan-card-btn-current {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-muted) !important;
    border: none !important;
}

/* En modo claro, ajustar borde del botn secundario */
body.theme-juris .plan-upgrade-btn-secondary,
body.theme-juris .plan-card-btn-outline {
    border-color: rgba(0,0,0,0.15) !important;
}

/* ==========================================================
   Comprar Extras  cards expandidas
   ========================================================== */
.extras-grid-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
}

.extras-card-full {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
}

.extras-card-full:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.extras-card-full.extras-card-featured {
    border-color: #6366f1;
    background: linear-gradient(160deg, rgba(99,102,241,0.1), var(--input-bg) 65%);
}

.extras-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.extras-big-icon { font-size: 2.6rem; line-height: 1; }

.extras-card-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 99px;
    background: #6366f1;
    color: #fff;
}

.extras-badge-free {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
}

.extras-card-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.extras-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

.extras-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.extras-card-list li {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.extras-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.extras-big-price {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.extras-big-price span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .extras-grid-full { grid-template-columns: 1fr; }
}

/* ==========================================================
   Mi Plan  stack de dos planes
   ========================================================== */
.plan-upgrade-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
}

.plan-upgrade-featured {
    border-color: #6366f1 !important;
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.05)) !important;
}

.plan-upgrade-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: #6366f1;
    color: #fff;
    padding: 2px 9px;
    border-radius: 99px;
    vertical-align: middle;
    margin-left: 8px;
    position: relative;
    top: -1px;
}

/* Extras  descripcion de cards */
.extras-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 6px 0 10px;
}

/* ==========================================================
   Radar Doctrinal  newsletter block
   ========================================================== */
.radar-doctrinal-box {
    margin-top: 36px;
    background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(139,92,246,0.06));
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 16px;
    padding: 28px 28px 24px;
}

.radar-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.radar-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.radar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px;
}

.radar-sub {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

.radar-field {
    margin-bottom: 18px;
}

.radar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.radar-note {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    opacity: 0.8;
}

/* ==========================================================
   Radar Doctrinal  Tags seleccionables
   ========================================================== */
.radar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.radar-tag {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.radar-tag:hover {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.08);
    color: var(--text-main);
}

.radar-tag.selected {
    background: rgba(139,92,246,0.2);
    border-color: #8b5cf6;
    color: #c4b5fd;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(139,92,246,0.15);
}

.radar-tag.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.radar-counter {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 6px;
}

/* ==========================================================
   Radar Doctrinal  Chip Input
   ========================================================== */
.radar-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    margin-bottom: 12px;
}

.radar-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(139,92,246,0.18);
    border: 1px solid rgba(139,92,246,0.4);
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 500;
    animation: chipIn 0.2s ease;
}

@keyframes chipIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.radar-chip-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.radar-chip-remove:hover { opacity: 1; }

.radar-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.radar-input {
    flex: 1;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.radar-input:focus {
    border-color: rgba(139,92,246,0.5);
}
.radar-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.radar-add-btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid rgba(139,92,246,0.4);
    background: rgba(139,92,246,0.12);
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
}
.radar-add-btn:hover {
    background: rgba(139,92,246,0.25);
    border-color: #8b5cf6;
}

/* ==========================================================
   RESPONSIVE  Smartphone (< 768px)
   ========================================================== */
@media (max-width: 768px) {
    /* Sidebar se oculta por defecto en movil */
    .sidebar {
        position: fixed;
        left: -300px;
        width: 280px;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .app-container {
        flex-direction: column;
    }

    /* Top bar ajustes */
    .top-bar {
        padding: 10px 16px;
    }

    /* Chat header */
    .chat-header h1 {
        font-size: 1.6rem;
    }

    /* Mi Cuenta  layout apilado */
    .acct-layout {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .acct-tabs {
        width: 100% !important;
        min-width: unset !important;
        flex-direction: row !important;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 12px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }
    .acct-tabs-header {
        display: none;
    }
    .acct-tab {
        white-space: nowrap;
        font-size: 0.72rem;
        padding: 8px 12px !important;
        flex-shrink: 0;
    }
    .acct-panels {
        padding: 20px 16px !important;
    }

    /* Plan cards */
    .plan-upgrade-box {
        flex-direction: column !important;
        gap: 12px;
    }
    .plan-upgrade-actions {
        flex-direction: column;
        gap: 8px;
    }
    .plan-upgrade-actions button {
        width: 100%;
    }

    /* Extras cards */
    .extras-grid { grid-template-columns: 1fr !important; }

    /* Radar */
    .radar-doctrinal-box {
        padding: 20px 16px;
    }
    .radar-input-row {
        flex-direction: column;
    }
    .radar-add-btn {
        width: 100%;
    }

    /* Pricing */
    .pricing-header h1 { font-size: 1.8rem; }
    .pricing-grid { grid-template-columns: 1fr !important; }

    /* Referral */
    .referral-stats {
        flex-direction: column;
        gap: 12px;
    }
}

/* Boton hamburguesa  solo visible en movil */
.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-main);
    font-size: 1.3rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
}

/* ==========================================================
   MOBILE overrides for User Menu / Profile Dropdown
   ========================================================== */
@media (max-width: 768px) {
    /* El dropdown del usuario se vuelve un slide-out lateral */
    .mobile-close-btn {
        display: block !important;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.5rem;
        cursor: pointer;
    }
}

.mobile-close-btn {
    display: none; /* Desktop default: hidden */
}

/* ==========================================================
   MOBILE overrides for Chat Input Position
   ========================================================== */
@media (max-width: 768px) {
    .chat-box {
        flex-grow: 1;
    }
    .input-container {
        margin-top: auto;
        padding-bottom: 20px; /* Adjust padding for mobile */
    }
}

/* ========================================= */
/* ESTILOS DEL HISTORIAL DE CHATS            */
/* ========================================= */

.chat-history-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.chat-clock-btn {
    /* Set overriden in floating-widget at end of file */
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-clock-btn:hover {
    background: var(--bg-main);
}

.chats-dropdown {
    position: absolute;
    bottom: 50px; 
    left: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpFade 0.3s ease;
}

.chats-dropdown.hidden {
    display: none;
}

.chats-dropdown-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
}

.chats-dropdown-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.new-chat-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
}

.new-chat-btn:hover {
    background: var(--accent);
    color: var(--bg-main);
}

.chats-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
}

.dropdown-chat-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-chat-item .chat-title-span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-chat-item:hover {
    background: var(--hover-color);
}

.dropdown-chat-item.active {
    background: rgba(169, 143, 85, 0.15); /* Accent con opacidad */
    border-left: 3px solid var(--accent);
}

.chats-dropdown-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg-main);
}

.chats-dropdown-footer a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s;
}

.chats-dropdown-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Administrador de Historial (Pestaña "Mi Cuenta") */
.chat-manager-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.chat-manager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
    cursor: grab;
}

.chat-manager-row:active {
    cursor: grabbing;
}

.chat-manager-row.over {
    border-top: 2px solid var(--accent);
    background: var(--hover-color);
}

.chat-manager-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 5px;
    user-select: none;
}
.drag-handle:active {
    cursor: grabbing;
}

.chat-m-title {
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-manager-actions {
    display: flex;
    gap: 10px;
}

.chat-manager-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.2s;
}

.chat-manager-actions button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chat-manager-actions .delete-btn:hover {
    color: #ff4c4c;
}


.chat-history-floating-widget {
    transition: left 0.3s ease;
}

@media (max-width: 768px) {
    .chat-history-floating-widget {
        left: 20px !important;
        bottom: 120px !important;
    }
}

.chat-clock-btn {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: 0;
    width: auto;
    height: auto;
}
.chat-clock-btn:hover {
    border-color: var(--accent);
    background: var(--sidebar-bg);
}
.chat-history-dropdown-container-floating .chats-dropdown {
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 280px;
}
