/* =============================================
   FIIs NA MÃO — DAN INVEST
   Design System & Styles
   ============================================= */

:root {
    --primary: #00C37A;
    --primary-dark: #00A366;
    --primary-light: #00E58A;
    --primary-glow: rgba(0, 195, 122, 0.15);
    --bg-main: #0D0F14;
    --bg-card: #141820;
    --bg-surface: #1A1F2E;
    --bg-input: #1E2435;
    --bg-user-msg: #00C37A;
    --bg-bot-msg: #1A1F2E;
    --text-primary: #F0F2F5;
    --text-secondary: #8A92A8;
    --text-muted: #5A6278;
    --border: rgba(255,255,255,0.07);
    --border-active: rgba(0, 195, 122, 0.4);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --font: 'Inter', -apple-system, sans-serif;
    --header-h: 70px;
    --footer-h: 110px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-primary);
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background subtle pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(0,195,122,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0,195,122,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   APP CONTAINER
   ============================================= */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* =============================================
   HEADER
   ============================================= */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: var(--header-h);
    background: rgba(20, 24, 32, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.assistant-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #00C37A 0%, #005C3A 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0,195,122,0.2);
    animation: pulse-avatar 3s ease-in-out infinite;
}

@keyframes pulse-avatar {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0,195,122,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(0,195,122,0.1); }
}

.assistant-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.assistant-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-counter {
    background: rgba(0,195,122,0.1);
    border: 1px solid rgba(0,195,122,0.25);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.3s ease;
}

.message-counter.warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
    color: #FFAA00;
}

.message-counter.danger {
    background: rgba(255, 70, 70, 0.1);
    border-color: rgba(255, 70, 70, 0.3);
    color: #FF4646;
    animation: pulse-danger 1s ease-in-out infinite;
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.reset-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--bg-input);
    color: var(--primary);
    border-color: var(--border-active);
}

/* =============================================
   CHAT MESSAGES AREA
   ============================================= */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 4px; }

/* Date divider */
.chat-date-divider {
    text-align: center;
    margin-bottom: 16px;
}

.chat-date-divider span {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

/* Message wrapper */
.message-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-wrapper.user {
    flex-direction: row-reverse;
}

/* Avatar in message */
.msg-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00C37A 0%, #005C3A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    align-self: flex-end;
}

.message-wrapper.user .msg-avatar {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    font-size: 14px;
}

/* Message bubble */
.message-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
}

.message-wrapper.bot .message-bubble {
    background: var(--bg-bot-msg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.message-wrapper.user .message-bubble {
    background: var(--bg-user-msg);
    border-bottom-right-radius: 4px;
    color: #fff;
    font-weight: 500;
}

/* Message timestamp */
.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.message-wrapper.bot .message-time {
    text-align: left;
}

/* Markdown-like formatting in bot messages */
.message-bubble strong, .message-bubble b {
    color: var(--primary-light);
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
    color: var(--text-secondary);
}

.message-bubble ul, .message-bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.message-bubble th {
    background: rgba(0,195,122,0.1);
    color: var(--primary);
    padding: 6px 10px;
    text-align: left;
    border: 1px solid var(--border);
    font-weight: 600;
}

.message-bubble td {
    padding: 6px 10px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.message-bubble tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

/* Disclaimer highlight */
.disclaimer-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* =============================================
   TYPING INDICATOR
   ============================================= */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 10px;
    animation: fadeInUp 0.3s ease;
}

.typing-indicator.hidden { display: none; }

.assistant-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00C37A 0%, #005C3A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.typing-bubble {
    background: var(--bg-bot-msg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-bubble span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing-dots 1.4s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dots {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* =============================================
   QUICK REPLIES
   ============================================= */
.quick-replies {
    display: flex;
    gap: 8px;
    padding: 0 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.quick-replies::-webkit-scrollbar { display: none; }

.quick-replies.hidden { display: none; }

.quick-reply-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    padding: 7px 14px;
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.quick-reply-btn:hover {
    border-color: var(--border-active);
    color: var(--primary);
    background: var(--primary-glow);
}

/* =============================================
   INPUT AREA
   ============================================= */
.chat-input-area {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    background: rgba(20, 24, 32, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 10px 10px 16px;
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(0,195,122,0.08);
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    min-height: 24px;
}

#message-input::placeholder { color: var(--text-muted); }

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.input-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* =============================================
   PAYWALL OVERLAY
   ============================================= */
.paywall-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.4s ease;
}

.paywall-overlay.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.paywall-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(0,195,122,0.1);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.paywall-card::-webkit-scrollbar { width: 3px; }
.paywall-card::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.paywall-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 70, 70, 0.1);
    border: 1px solid rgba(255, 70, 70, 0.25);
    color: #FF6B6B;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.paywall-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.paywall-logo .logo-icon {
    font-size: 32px;
}

.paywall-logo .logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.paywall-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.paywall-title .highlight {
    color: var(--primary);
}

.paywall-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.paywall-benefits {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.benefit-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.benefit-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.paywall-cta-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 20px rgba(0,195,122,0.3);
    margin-bottom: 20px;
}

.paywall-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,195,122,0.4);
}

.paywall-cta-btn:active {
    transform: translateY(0);
}

.paywall-divider {
    position: relative;
    text-align: center;
    margin-bottom: 16px;
}

.paywall-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.paywall-divider span {
    background: var(--bg-card);
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-muted);
    position: relative;
}

.unlock-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.unlock-input {
    flex: 1;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.unlock-input:focus {
    border-color: var(--border-active);
}

.unlock-input::placeholder { color: var(--text-muted); }

.unlock-btn {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.unlock-btn:hover {
    background: var(--primary-glow);
    border-color: var(--border-active);
}

.paywall-footer-note {
    font-size: 12px;
    color: var(--text-muted);
}

/* =============================================
   UNLOCK TOAST
   ============================================= */
.unlock-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease;
}

.unlock-toast.hidden { display: none; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =============================================
   CONFIG MODAL
   ============================================= */
.config-modal {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.config-modal.hidden { display: none; }

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.config-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.config-logo span {
    font-size: 36px;
}

.config-logo h2 {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.config-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.config-form {
    text-align: left;
    margin-bottom: 20px;
}

.config-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    padding: 12px 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.config-input:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(0,195,122,0.08);
}

.config-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,195,122,0.3);
}

.config-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,195,122,0.4);
}

.config-note {
    font-size: 12px;
    color: var(--text-muted);
}

/* =============================================
   LANGUAGE SELECTOR
   ============================================= */
.language-selector {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 10px 0 16px;
    animation: fadeInUp 0.4s ease;
}

.lang-header {
    text-align: center;
    margin-bottom: 20px;
}

.lang-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.lang-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.lang-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.lang-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 15px;
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.lang-btn:hover {
    border-color: var(--border-active);
    color: var(--primary);
    background: var(--primary-glow);
    transform: translateX(4px);
}

.lang-btn.default {
    border-color: rgba(0,195,122,0.3);
}

.lang-flag {
    font-size: 22px;
    flex-shrink: 0;
}

.lang-name {
    flex: 1;
    font-weight: 500;
}

.lang-badge {
    background: rgba(0,195,122,0.1);
    border: 1px solid rgba(0,195,122,0.25);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   OPTION BUTTONS (clickable choices)
   ============================================= */
.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    animation: fadeInUp 0.3s ease;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--border-active);
    color: var(--primary);
    background: var(--primary-glow);
    transform: translateX(4px);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-num {
    width: 26px;
    height: 26px;
    background: rgba(0,195,122,0.1);
    border: 1px solid rgba(0,195,122,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* =============================================
   ERROR MESSAGE
   ============================================= */
.message-bubble.error {
    background: rgba(255, 70, 70, 0.1);
    border-color: rgba(255, 70, 70, 0.25);
    color: #FF8A8A;
}

/* =============================================
   WELCOME MESSAGE
   ============================================= */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease;
}

.welcome-emoji {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.welcome-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto 24px;
}

.welcome-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.welcome-tag {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 480px) {
    .message-bubble {
        max-width: 88%;
        font-size: 14px;
    }

    .paywall-card {
        padding: 24px 20px;
    }

    .paywall-title {
        font-size: 18px;
    }

    .paywall-cta-btn {
        font-size: 15px;
        padding: 14px;
    }

    .chat-header {
        padding: 10px 12px;
    }

    .chat-messages {
        padding: 16px 12px;
    }

    .chat-input-area {
        padding: 8px 12px 12px;
    }

    .quick-replies {
        padding: 0 12px 8px;
    }
}

@media (min-width: 800px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* =============================================
   SCROLLBAR for paywall card on mobile
   ============================================= */
@media (max-height: 700px) {
    .paywall-card {
        padding: 20px 16px;
        max-height: 95vh;
    }

    .paywall-benefits {
        gap: 7px;
        padding: 12px;
    }

    .benefit-item {
        font-size: 13px;
    }
}

/* =============================================
   GRÁFICO DE BARRAS — VISUAL CHART
   ============================================= */
.dan-chart {
    background: #1A1F2E;
    border: 1px solid rgba(0,195,122,0.15);
    border-radius: 14px;
    padding: 16px;
    margin: 10px 0;
    overflow: hidden;
}

.dan-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dan-chart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dan-chart-label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.dan-chart-bar-wrap {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.dan-chart-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
    min-width: 4px;
    position: relative;
}

.dan-chart-bar.warning {
    background: linear-gradient(90deg, #F5A623, #F7C35A);
}

.dan-chart-bar.danger {
    background: linear-gradient(90deg, #E53935, #FF6B6B);
}

.dan-chart-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 44px;
    text-align: left;
    flex-shrink: 0;
}

/* =============================================
   CARD DE FII — INDICADORES VISUAIS
   ============================================= */
.fii-card {
    background: #1A1F2E;
    border: 1px solid rgba(0,195,122,0.2);
    border-radius: 16px;
    padding: 16px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.fii-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
}

.fii-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.fii-card-ticker {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.fii-card-type {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,195,122,0.1);
    border: 1px solid rgba(0,195,122,0.25);
    color: var(--primary);
}

.fii-card-type.papel {
    background: rgba(100,130,255,0.1);
    border-color: rgba(100,130,255,0.25);
    color: #8299FF;
}

.fii-card-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    margin-top: -10px;
}

.fii-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.fii-indicator {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
}

.fii-indicator-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.fii-indicator-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.fii-indicator-value.good { color: var(--primary); }
.fii-indicator-value.warn { color: #F5A623; }
.fii-indicator-value.bad  { color: #FF6B6B; }

.fii-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 10px;
    margin-top: 4px;
}

.fii-card-footer a {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.fii-card-footer a:hover { opacity: 0.75; }

.fii-card-status {
    font-size: 11px;
    color: var(--text-muted);
}

/* =============================================
   CARD DE IMÓVEL (FII TIJOLO)
   ============================================= */
.property-card {
    background: #1A1F2E;
    border: 1px solid rgba(212,160,23,0.2);
    border-radius: 16px;
    overflow: hidden;
    margin: 10px 0;
}

.property-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.property-card-img-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1E2A1A 0%, #0D1F10 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex-direction: column;
    gap: 6px;
}

.property-card-img-placeholder span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-card-body {
    padding: 14px;
}

.property-card-tag {
    font-size: 10px;
    font-weight: 700;
    color: #D4A017;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.property-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.property-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.property-card-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.property-stat {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-stat strong {
    color: var(--primary);
    font-weight: 700;
}

/* =============================================
   LINK CARD — DADOS EXTERNOS
   ============================================= */
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1A1F2E;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 6px 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: rgba(0,195,122,0.3);
    background: rgba(0,195,122,0.05);
    transform: translateY(-1px);
}

.link-card-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.link-card-info {
    flex: 1;
    min-width: 0;
}

.link-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.link-card-arrow {
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

/* =============================================
   COMPARATIVO DE FIIs — TABELA VISUAL
   ============================================= */
.fii-compare {
    background: #1A1F2E;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
    margin: 10px 0;
}

.fii-compare-title {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,195,122,0.05);
}

.fii-compare table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.fii-compare th {
    padding: 8px 10px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.fii-compare td {
    padding: 9px 10px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.fii-compare tr:last-child td { border-bottom: none; }

.fii-compare td.good { color: var(--primary); font-weight: 700; }
.fii-compare td.warn { color: #F5A623; font-weight: 700; }
.fii-compare td.bad  { color: #FF6B6B; font-weight: 700; }
