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

:root {
    /* Colors (Light theme, using provided palette) */
    --investment-green: #3e910b; /* main brand green */
    --investment-orange: #e4710c; /* accent orange */
    --investment-dark: #2a2a2a; /* text dark */
    --white: #ffffff;

    --chat-bg: #ffffff; /* page background */
    --chat-bg-light: #f7f8fa; /* subtle panel background */
    --chat-border: #e6e6e6;

    --background: #ffffff;
    --foreground: #2a2a2a; /* primary text */
    --card: #ffffff; /* cards & user bubble base */
    --card-foreground: #2a2a2a;
    --secondary: #f6f7f8; /* assistant bubble */
    --secondary-foreground: #2a2a2a;
    --muted: #f0f1f3; /* muted surfaces */
    --muted-foreground: #6b7280; /* secondary text */
    --primary: var(--investment-green);
    --primary-foreground: var(--white);
    --accent: var(--investment-orange);
    --border: #e6e6e6;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff; /* Fondo blanco para las franjas laterales */
    color: var(--foreground);
    overflow: hidden;
    /* Prevent iOS bounce scroll */
    -webkit-overflow-scrolling: touch;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Animations */
@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.animate-fade-in {
    animation: fade-in 0.5s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.4s ease-out;
}

.animate-pulse-glow {
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--background);
    /* iOS safe area support */
    height: 100dvh; /* Dynamic viewport height */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    position: relative;
    overflow: hidden;
}

/* Background image only for initial state */
.chat-container::before {
    content: '';
    position: absolute;
    top: 80px; /* Below the header */
    left: 0;
    right: 0;
    bottom: 0;
    /* Solo la imagen, sin degradado */
    background-image: url('/assets/tree-grows-coin-glass-jar-with-copy-space 1.webp');
    background-position: right center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0; /* Detrás del contenido */
    /* Hide on mobile by default */
    display: none;
}

/* Gradient overlay on top of background image */
.chat-container::after {
    content: '';
    position: absolute;
    top: 80px; /* Same as ::before */
    left: 0;
    right: 0;
    bottom: 0;
    /* Solo el degradado como overlay */
    background-image: linear-gradient(to right, 
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.95) 30%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    background-repeat: no-repeat;
    background-size: 100% 100%; /* Cubrir toda la altura */
    background-position: left center;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0; /* Encima de ::before pero detrás del contenido */
    /* Hide on mobile by default */
    display: none;
}

/* Show background only on desktop (min-width: 769px) */
@media (min-width: 769px) {
    .chat-container::before {
        display: block;
        /* Extend image to cover full width, showing tree on right edge */
        background-size: cover;
        background-position: center -40px;
        /* Comenzar desde arriba para cubrir toda la imagen desplazada */
        top: 0;
    }
    
    .chat-container::after {
        display: block;
        /* El degradado también desde arriba */
        top: 0;
    }
    
    /* Make chat container use full width on desktop */
    .chat-container {
        max-width: 100vw;
        margin: 0;
    }
    
    /* Agregar margin left al initial state solo en desktop */
    .initial-state {
        margin-left: 40px;
    }
}

/* Hide background when conversation starts */
.chat-container.conversation-active::before,
.chat-container.conversation-active::after {
    opacity: 0;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    /* iOS safe area support for notch */
    padding-top: max(12px, env(safe-area-inset-top));
    background-color: var(--background);
    position: relative;
    z-index: 10;
}

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

.header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    position: relative;
}

.brand-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { display: block; height: 55px; width: auto; }

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--investment-dark);
}

.header-version {
    font-size: 14px;
    color: var(--muted-foreground);
}

/* Header Navigation Links (Desktop) - VISIBLES en desktop */
.header-nav {
    display: flex; /* Visibles en desktop */
    align-items: center;
    gap: 24px;
    margin-left: auto;
    margin-right: 16px;
}

.header-nav .nav-flag {
    height: 24px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-nav .nav-link {
    color: var(--foreground);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
    padding: 4px 0;
}

.header-nav .nav-link:hover {
    color: var(--primary);
}

.header-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.header-nav .nav-link:hover::after {
    width: 100%;
}

/* Primary Nav Link (CTA style) */
.header-nav .nav-link-primary {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.header-nav .nav-link-primary::after {
    display: none; /* No underline effect for button style */
}

.header-nav .nav-link-primary:hover {
    background: #357a0a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(62, 145, 11, 0.3);
}

/* Settings Button */
.settings-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.settings-btn:hover {
    background-color: var(--secondary);
    color: var(--foreground);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease-out;
}

.settings-btn.active svg {
    transform: rotate(90deg);
}

/* Settings Menu Dropdown */
.settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    animation: menuSlideIn 0.2s ease-out forwards;
    overflow: hidden;
}

@keyframes menuSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Menu Content */
.settings-menu-content {
    padding: 8px;
}

/* Auth Section in Settings */
.settings-auth-section {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

/* Navigation Section in Settings Menu (Mobile) */
.settings-nav-section {
    padding: 8px 0;
    display: none; /* Oculto por defecto en desktop */
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--foreground);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border-radius: 8px;
}

.settings-nav-link:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

.settings-nav-link svg {
    width: 18px;
    height: 18px;
    color: var(--muted-foreground);
    transition: var(--transition-smooth);
}

.settings-nav-link:hover svg {
    color: var(--primary);
}

.settings-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.settings-user-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-user-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.settings-user-email {
    font-size: 13px;
    color: var(--foreground);
    font-weight: 500;
    word-break: break-all;
    flex: 1;
}

/* Auth Button */
.auth-status-btn {
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    width: 100%;
}

.auth-status-btn:hover {
    background-color: var(--secondary);
    border-color: var(--border);
}

.auth-status-btn.login {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
    color: white;
}

.auth-status-btn.login:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}


.auth-status-btn svg {
    width: 16px;
    height: 16px;
}


/* Messages Wrapper */
.messages-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior: contain;
    position: relative;
    z-index: 1;
}

/* Initial State - Centered */
.initial-state {
    display: flex;
    flex-direction: column;
    /* align-items: center; */
    justify-content: center;
    height: 100%;
    padding: 0 16px;
    animation: fade-in 0.5s ease-out;
    position: relative;
    z-index: 2; /* Above background and gradient */
}

.main-title {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    /* text-align: center; */
    margin-bottom: 8px;
    color: var(--investment-dark);
}

.main-subtitle {
    font-size: clamp(16px, 3vw, 18px);
    font-weight: 400;
    color: var(--muted-foreground);
    margin-bottom: 32px;
}

/* Feature Cards */
.feature-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 768px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-card {
    flex: 1;
    min-width: 200px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(62, 145, 11, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #54BD95 0%, #6DD130 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    text-align: center;
    margin: 0;
}

/* Chat Form */
.chat-form {
    width: 100%;
    max-width: 768px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-left {
    position: absolute;
    left: 16px;
    z-index: 1;
}

.chat-input {
    flex: 1;
    background-color: var(--card);
    border: 5px solid var(--primary);
    border-radius: 28px;
    padding: 14px 20px;
    color: var(--foreground);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition-smooth);
}

.chat-input::placeholder {
    color: var(--muted-foreground);
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(62,145,11,0.15);
}

.input-actions {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--foreground);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.send-btn {
    padding: 12px;
    background-color: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.send-btn:hover:not(:disabled) {
    background-color: #5CB71F; /* Verde más claro en hover */
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Conversation State */
.conversation-state {
    max-width: 768px;
    margin: 0 auto;
    padding: 24px 16px;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Suggestions (bubbles) */
.suggestions-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0 0 0;
    max-width: 768px;
    animation: slideInUp 0.4s ease-out;
    justify-content: center;
}

/* Mobile: Carrusel horizontal sin scroll visible */
@media (max-width: 768px) {
    .suggestions-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        gap: 12px;
        padding: 0 16px 0 0; /* Sin padding izquierdo para empezar desde el borde */
        max-width: 100%;
        position: relative;
        /* Ocultar scrollbar */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .suggestions-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    /* Smooth scroll behavior */
    .suggestions-container {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Suggestions en el estado inicial (debajo del input) */
.initial-state .suggestions-container {
    margin: 24px 0 0 0;
    justify-content: flex-start; /* Alinear a la izquierda */
}

/* Suggestions específicas para el input bar (conversación iniciada) */
.input-bar-inner .suggestions-container {
    margin: 0 0 12px 0;
    padding: 0;
    justify-content: flex-start;
}

.suggestion-bubble {
    background: linear-gradient(135deg, rgba(62,145,11,0.08) 0%, rgba(228,113,12,0.06) 100%);
    border: 1px solid var(--border);
    color: var(--investment-dark);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(16,24,40,0.04);
    white-space: nowrap; /* Evita que el texto se rompa en mobile */
    flex-shrink: 0; /* Evita que las burbujas se compriman */
}

.suggestion-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62,145,11,0.12);
    background: linear-gradient(135deg, rgba(62,145,11,0.12) 0%, rgba(228,113,12,0.08) 100%);
    border-color: var(--primary);
}

.suggestion-bubble:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(16,24,40,0.06);
}

.suggestion-bubble.small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Message Bubbles */
.message {
    display: flex;
    animation: slide-up 0.4s ease-out;
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 85%;
    border-radius: 16px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}

.message.user .message-bubble {
    background-color: var(--primary);
    color: var(--primary-foreground);
    /* make user bubble stand out */
    box-shadow: 0 6px 18px rgba(62,145,11,0.08);
}

.message.assistant .message-bubble {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.message-content {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* color: var(--investment-dark); */
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fade-in 0.3s ease-out;
}

.typing-status-text {
    font-size: 13px;
    color: var(--muted-foreground);
    font-weight: 500;
    padding-left: 4px;
    transition: opacity 0.3s ease-in-out;
}

.typing-indicator .message-bubble {
    background-color: var(--secondary);
    padding: 12px 20px;
}

.typing-dots {
    display: flex;
    gap: 8px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--muted-foreground);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input Bar - Fixed at bottom */
.input-bar {
    border-top: 1px solid var(--border);
    background-color: var(--background);
    /* iOS safe area support for home indicator */
    padding-bottom: env(safe-area-inset-bottom);
}

.input-bar-inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 16px;
}

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

/* Portfolio Component Styles */
.portfolio-component {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(62,145,11,0.06) 0%, rgba(228,113,12,0.04) 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    animation: slideInUp 0.5s ease-out;
    color: var(--investment-dark);
}

.portfolio-message {
    font-size: 14px;
    color: var(--foreground);
    margin-bottom: 12px;
    line-height: 1.5;
}

.portfolio-button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.portfolio-button.primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.portfolio-button.primary:hover {
    background-color: hsl(92, 83%, 28%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 183, 31, 0.3);
}

.portfolio-button.primary-urgent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--primary-foreground);
    animation: pulse-glow 2s ease-in-out infinite;
}

.portfolio-button.primary-urgent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 183, 31, 0.4);
}

.portfolio-button.secondary {
    background-color: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.portfolio-button.secondary:hover {
    background-color: var(--muted);
    transform: translateY(-2px);
}

/* Loading Indicator */
.loading-animation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.loading-text {
    color: var(--muted-foreground);
    font-size: 14px;
}

/* Typing Cursor Effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

/* Scrollbar Styles */
.messages-wrapper::-webkit-scrollbar {
    width: 8px;
}

.messages-wrapper::-webkit-scrollbar-track {
    background: var(--background);
}

.messages-wrapper::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 4px;
}

.messages-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--chat-border);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 24px;
        margin-bottom: 8px;
        padding: 0 8px;
        text-align: center;
    }
    
    .main-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
        padding: 0 8px;
        text-align: center;
    }
    
    /* Feature cards en mobile - HORIZONTAL scroll */
    .feature-cards {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 24px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        padding: 0 16px;
        /* margin-left: -16px; */
        margin-right: -16px;
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .feature-cards::-webkit-scrollbar {
        display: none;
    }
    
    .feature-card {
        min-width: 200px;
        width: 200px;
        flex-shrink: 0;
        flex-direction: column;
        padding: 20px 16px;
        gap: 12px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .feature-text {
        text-align: center;
        flex: unset;
    }
    
    /* Mobile: botón send fuera del input */
    .input-container {
        gap: 8px;
    }
    
    .chat-input {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 24px;
        flex: 1;
    }
    
    .input-actions {
        position: static;
        display: flex;
        align-items: center;
    }
    
    .send-btn {
        flex-shrink: 0;
        padding: 12px;
        width: 48px;
        height: 48px;
    }
    
    .send-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .conversation-state {
        padding: 16px 12px 80px 12px; /* Extra padding bottom for fixed input bar */
    }
    
    /* Bajar la barra de input en mobile */
    .initial-state {
        justify-content: flex-end;
        padding-bottom: 60px;
    }
    
    /* Mobile: Orden correcto - Preguntas arriba, input abajo */
    .initial-state {
        display: flex;
        flex-direction: column;
    }
    
    .initial-content {
        order: 1; /* Título y feature cards primero */
    }
    
    #initialSuggestions {
        order: 2; /* Sugerencias después del contenido */
    }
    
    .chat-form {
        order: 3; /* Input al final (debajo de sugerencias) */
    }
    
    /* Ajustar sugerencias en estado inicial para mobile */
    .initial-state .suggestions-container {
        margin:  20px 0 0 0 0;
        padding: 0 16px;
    }
    
    .input-bar-inner {
        padding: 12px;
    }
    
    /* Sugerencias en conversación activa */
    .input-bar-inner .suggestions-container {
        margin: 0 0 12px 0;
        padding: 0 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .suggestions-container {
        gap: 6px;
        margin-bottom: 12px;
        justify-content: center;
    }
    
    .suggestion-bubble {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .portfolio-component {
        padding: 12px;
        margin-top: 12px;
    }
    
    .portfolio-button {
        padding: 11px 20px;
        font-size: 14px;
    }
    
    /* Header mobile: mostrar navegación y ajustar layout */
    .chat-header {
        padding: 10px 12px;
        flex-wrap: wrap;
    }
    
    .header-left {
        flex: 0 0 auto;
    }
    
    .header-right {
        flex: 0 0 auto;
        margin-left: auto;
    }
    
    .header-title {
        font-size: 17px;
    }
    
    /* Mostrar navegación en el header mobile */
    .header-nav {
        display: flex;
        flex: 1 1 100%;
        order: 3;
        margin: 8px 0 0 0;
        gap: 8px;
        justify-content: flex-start; /* Alinear a la izquierda */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 12px 4px 0; /* Sin padding izquierdo para empezar desde el borde */
    }
    
    .header-nav::-webkit-scrollbar {
        display: none;
    }
    
    .header-nav .nav-flag {
        display: none; /* Ocultar bandera del nav en mobile */
    }
    
    .header-nav .nav-link {
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .header-nav .nav-link-primary {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Mover bandera argentina al header-right en mobile */
    .header-right::before {
        content: '';
        display: block;
        width: 20px;
        height: 20px;
        background-image: url('/assets/Argentina.webp');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        border-radius: 3px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        margin-right: 8px;
    }
    
    /* Ocultar navegación del modal de configuración en mobile */
    .settings-nav-section {
        display: none;
    }
}

/* Tablets (landscape phones to small tablets) */
@media (min-width: 481px) and (max-width: 768px) {
    .main-title {
        font-size: 30px;
        margin-bottom: 8px;
    }
    
    .main-subtitle {
        font-size: 16px;
        margin-bottom: 24px;
    }
    
    .feature-cards {
        gap: 14px;
        margin-bottom: 28px;
    }
    
    .feature-card {
        min-width: 180px;
    }
    
    .message-bubble {
        max-width: 80%;
    }
    
    .chat-input {
        padding: 14px 60px 14px 20px;
        font-size: 15px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .header-title {
        font-size: 16px;
    }
    
    .header-version {
        font-size: 12px;
    }

    /* Auth button mobile responsiveness */
    .auth-status-btn {
        padding: 6px 10px;
        font-size: 13px;
        gap: 4px;
    }

    .auth-status-btn svg {
        width: 14px;
        height: 14px;
    }

    .settings-menu {
        right: -8px;
        min-width: 240px;
    }

    .main-title {
        font-size: 22px;
        margin-bottom: 6px;
        line-height: 1.3;
    }
    
    .main-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .feature-cards {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .feature-card {
        padding: 6px;
        gap: 12px;
        min-width: 0px;
    }
    
    .feature-icon {
        width: 36px;
        height: 36px;
    }
    
    .feature-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .feature-text {
        font-size: 13px;
    }
    
    .chat-input {
        padding: 12px 56px 12px 16px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .send-btn {
        padding: 6px;
    }
    
    .send-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .message-bubble {
        max-width: 92%;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 14px;
    }
    
    .message-content {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .portfolio-component {
        padding: 10px;
        margin-top: 10px;
    }
    
    .portfolio-message {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .portfolio-button {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .conversation-state {
        padding: 12px 8px 80px 8px;
    }
    
    .input-bar-inner {
        padding: 10px 8px;
    }
    
    .disclaimer {
        font-size: 11px;
        margin-top: 8px;
    }
    
    .suggestions-container {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .suggestion-bubble {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .typing-indicator .message-bubble {
        padding: 10px 16px;
    }
    
    .typing-dot {
        width: 6px;
        height: 6px;
    }
}

/* Large screens (desktops) */
@media (min-width: 1024px) {
    .chat-container {
        max-width: 100vw; /* Full width para que la imagen llegue al borde */
        margin: 0;
    }
    
    .main-title {
        font-size: 52px;
        margin-bottom: 56px;
    }
    
    .conversation-state {
        padding: 32px 24px 100px 24px;
    }
    
    .messages-container {
        gap: 28px;
    }
    
    .message-bubble {
        max-width: 75%;
        padding: 14px 22px;
        font-size: 15px;
    }
    
    .input-bar-inner {
        padding: 20px 24px;
    }
    
    .suggestions-container {
        gap: 10px;
        margin-bottom: 18px;
        justify-content: center;
    }
    
    .suggestion-bubble {
        padding: 9px 16px;
        font-size: 14px;
    }
}

/* Extra large screens */
@media (min-width: 1440px) {
    .chat-container {
        max-width: 100vw; /* Full width para que la imagen llegue al borde */
    }
    
    .main-title {
        font-size: 56px;
    }
}

/* Landscape orientation on phones */
@media (max-height: 600px) and (orientation: landscape) {
    .main-title {
        font-size: 46px;
        margin-bottom: 16px;
    }
    
    .initial-state {
        padding: 0 12px;
    }
    
    .conversation-state {
        padding: 12px 12px 70px 12px;
    }
    
    .input-bar-inner {
        padding: 8px 12px;
    }
    
    .disclaimer {
        display: none; /* Hide disclaimer in landscape to save space */
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .send-btn,
    .icon-btn,
    .settings-btn,
    .suggestion-bubble,
    .portfolio-button {
        /* Increase tap target size for touch */
        min-height: 44px;
        min-width: 44px;
    }
    
    .suggestion-bubble {
        padding: 10px 14px;
    }
    
    .chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Markdown content styling in messages */
.message-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    color: var(--investment-dark);
}

.message-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 6px 0;
    color: var(--investment-dark);
}

.message-content p {
    margin: 8px 0;
}

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

.message-content li {
    margin: 4px 0;
}

.message-content strong {
    font-weight: 600;
    color: var(--investment-dark);
}

.message-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    overflow-x: auto;
    display: block;
}

.message-content thead {
    background-color: rgba(62, 145, 11, 0.08);
}

.message-content th,
.message-content td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid var(--border);
}

.message-content th {
    font-weight: 600;
    color: var(--investment-dark);
}

/* Mobile table improvements */
@media (max-width: 640px) {
    .message-content table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .message-content th,
    .message-content td {
        padding: 6px 8px;
    }
    
    .message-content h2 {
        font-size: 16px;
    }
    
    .message-content h3 {
        font-size: 14px;
    }
}

/* ============================================
   AUTH MODAL STYLES
============================================ */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.show {
    display: flex;
    opacity: 1;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #eee;
}

.auth-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-modal-body {
    padding: 24px;
}

.auth-modal-message {
    font-size: 16px;
    color: #333;
    margin: 0 0 8px 0;
    text-align: center;
}

.auth-modal-submessage {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    padding: 14px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
}

.auth-input:focus {
    border-color: var(--investment-green);
    box-shadow: 0 0 0 3px rgba(62, 145, 11, 0.1);
}

.auth-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--investment-green) 0%, #2e7008 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(62, 145, 11, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-disclaimer {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 16px 0 0 0;
}

.auth-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.auth-success {
    text-align: center;
    padding: 20px 0;
}

.auth-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.auth-success h4 {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.auth-success p {
    font-size: 15px;
    color: #666;
    margin: 8px 0;
}

.auth-success-message {
    font-size: 14px;
    color: #999;
    margin: 16px 0 24px 0 !important;
}

/* ============================================
   QUESTION COUNTER
============================================ */
.question-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    margin-bottom: 12px;
    animation: slideDown 0.3s ease;
}

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

.question-counter.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.counter-icon {
    font-size: 16px;
}

.counter-text {
    flex: 1;
}

/* ============================================
   AUTH PENDING BANNER
============================================ */
.auth-pending-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

.banner-icon {
    font-size: 20px;
}

.banner-text {
    color: #92400e;
    font-size: 14px;
    flex: 1;
    text-align: center;
}

.banner-text strong {
    color: #78350f;
}

.banner-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #92400e;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.banner-close:hover {
    background: rgba(146, 64, 14, 0.1);
}

/* Mobile auth modal adjustments */
@media (max-width: 640px) {
    .auth-modal-content {
        max-width: 95%;
        margin: 0 10px;
    }
    
    .auth-modal-header h3 {
        font-size: 18px;
    }
    
    .auth-modal-message {
        font-size: 15px;
    }
    
    .auth-success-icon {
        font-size: 48px;
    }
    
    .auth-success h4 {
        font-size: 20px;
    }
    
    .auth-pending-banner {
        padding: 10px 16px;
    }
    
    .banner-text {
        font-size: 13px;
    }
}

/* ============================================================== 
     # Portfolio Modal & Formulario
=================================================================== */

/* Modal overlay */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.portfolio-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Main container */
.portfolio-container {
    max-width: none;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    /* width: 80%; */
    height: auto;
    background: white;
    /* padding: 20px 20px; */
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
    z-index: 10001;
    border-radius: 40px;
}

/* Card container */
.portfolio-card {
    overflow: hidden;
    width: 100%;
    max-width: 1050px;
    background: linear-gradient(180deg,
        rgba(134, 222, 190, 0.322) 0%,
        rgba(110, 209, 48, 0.123) 100%);
    border-radius: 40px;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.4s ease-out;
}

/* Close button */
.close-portfolio-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #2a2a2a;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-portfolio-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.close-portfolio-modal svg {
    width: 24px;
    height: 24px;
}

/* Header section */
.portfolio-header {
    margin-bottom: 48px;
}

.portfolio-title {
    font-family: "Inter", sans-serif;
    font-size: 38px;
    font-weight: 600;
    color: #2a2a2a;
    margin-bottom: 24px;
}

.portfolio-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #2a2a2a;
    line-height: 32px;
    display: block;
}

/* Content section */
.portfolio-content {
    font-size: 15px;
    color: #2a2a2a;
    margin-bottom: 48px;
    line-height: 1.8;
    font-family: "Inter", sans-serif;
}

.highlight {
    color: #53af1b;
}

.highlight-long {
    color: #53af1b;
}

/* Footer section */
.portfolio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.portfolio-button {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: white;
    background-color: #e4710c;
    padding: 14px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex: 1;
}

.portfolio-button:hover {
    background-color: #d26200;
}

.portfolio-button-back {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #e4710c;
    background-color: transparent;
    padding: 12px 20px;
    border: 2px solid #e4710c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
}

.portfolio-button-back.show {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-button-back:hover {
    background-color: #e4710c;
    color: white;
}

.portfolio-button-back svg {
    width: 16px;
    height: 16px;
}

.portfolio-button-next {
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: white;
    background-color: #e4710c;
    padding: 14px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
}

.portfolio-button-next.show {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-button-next:hover {
    background-color: #d26200;
}

.portfolio-button-next:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.portfolio-button-next svg {
    width: 16px;
    height: 16px;
}

/* Decorative SVG elements */
.decoration-right,
.decoration-left {
    position: absolute;
    z-index: 0;
}

.svg-right {
    position: absolute;
    top: 79px;
    left: 174px;
    width: 350px;
    height: 80px;
    z-index: 10000;
    clip-path: polygon(0 0, 102% 0, 97% 90%, 90% 95%, 0 100%);
}

.svg-left {
    position: absolute;
    top: 79px;
    right: 174px;
    width: 350px;
    height: 80px;
    z-index: 10000;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 10% 95%, 3% 90%, -2% 0);
}

#simple-questionnaire-form>div.form-group.active>p>span {
    font-size: 1.4rem;
    font-weight: 300;
}

/* Clases para el formulario dinámico */
form {
    margin-top: 24px;
}

.form-group {
    display: none;
    margin-bottom: 32px;
    transition: all 0.4s ease;
}

.form-group.active {
    display: block;
    animation: fadeInUp 0.5s ease-out forwards;
}

.form-group span.label {
    font-size: 14px;
    color: #2a2a2a;
}

/* Ocultar texto en pasos no activos para evitar flash antes del typing */
.form-group.hidden p > span {
    visibility: hidden;
}

.form-group.active p > span {
    visibility: visible;
}

/* Typing animation cursor */
.typing-text {
    position: relative;
}

.typing-text::after {
    content: '|';
    position: absolute;
    right: -4px;
    animation: blink 0.7s infinite;
    color: #49b66b;
}

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

.form-group input,
.form-group select {
    font-size: 24px;
    color: #53af1b;
    background: transparent;
    border: none;
    border-bottom: 2px solid #53af1b;
    padding: 4px 8px;
    margin: 0 4px;
    min-width: 80px;
}

.form-submit {
    display: none;
    margin-top: 24px;
}

.form-submit.active {
    display: inline-block;
}

/* Aplica a inputs y selects dentro de la sección de contenido */
.portfolio-content input,
.portfolio-content select {
    font-family: "Inter", sans-serif;
    font-size: 1.8rem;
    color: #49b66b;
    background: transparent;
    border: none;
    border-bottom: 2px solid #49b66b;
    padding: 0.2em 0.3em;
    margin: 0 0.2em;
    min-width: 4ch;
    display: inline-block;
    vertical-align: baseline;
    appearance: none;
}

/* Ajuste específico para select: flecha externa y padding */
.portfolio-content select {
    padding-right: 1.5em;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%2349b66b' d='M2 0L0 2h4L2 0zM2 5L0 3h4l-2 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5em center;
    background-size: 0.65em auto;
}

/* Quita el outline por defecto en foco y dibuja tu propio indicador */
.portfolio-content input:focus,
.portfolio-content select:focus {
    outline: none;
    border-bottom-color: #333343;
}

/* animación para mostrar */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Modal de email */
.email-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.email-modal-content {
    background: linear-gradient(180deg, #ffffff 0%, rgb(185, 209, 170) 100%);
    border-radius: 40px;
    margin: 10% auto;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: "Inter", sans-serif;
}

.email-modal-content h2 {
    font-size: 32px;
    font-weight: 500;
    color: #2a2a2a;
    margin-bottom: 20px;
}

.email-modal-content p {
    font-size: 18px;
    color: #4a4a4a;
    margin-bottom: 24px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.email-form input {
    padding: 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.email-form .portfolio-button {
    display: block;
    background-color: #e4710c;
    color: white;
    border: none;
    margin: 0 auto;
}

.close-email-modal {
    color: #2a2a2a;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.hidden {
    display: none;
}

.show {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Form field styles */
.simple-questionnaire-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.simple-questionnaire-form .form-group label {
    display: block;
    font-weight: bold;
}

.simple-questionnaire-form .form-group span {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 1.4rem;
}

.simple-questionnaire-form .form-group input,
.simple-questionnaire-form .form-group select {
    width: auto;
    border: none;
    border-bottom: 2px solid #49b66b;
    background: none;
    box-shadow: none;
    outline: none;
    font-size: 16px;
    display: inline-block;
}

.simple-questionnaire-form .form-group input:focus,
.simple-questionnaire-form .form-group select:focus {
    border-bottom-color: #333343;
}

#ageField {
    width: 65px;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#investmentTime {
    width: 15rem;
    height: 4.5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#savingsPercentEstimateSelectField {
    width: 150px;
    height: 5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#riskPerception {
    width: 250px;
    height: 5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#investmentExperience {
    width: 220px;
    height: 4.5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    margin-bottom: 20px;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#investmentObjective {
    height: 5rem;
    width: auto;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#investmentAmount {
    width: 180px;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#marketReaction {
    width: 220px;
    height: 5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

#gender {
    width: 150px;
    height: 5rem;
    color: #49b66b;
    font-weight: 400;
    font-size: 1.4rem;
    font-family: "Inter", sans-serif;
    border-bottom: 2px dashed #6dd130;
    box-sizing: border-box;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ============================================================== 
   # Form Glow Effect (Mejorado) - Sin cambios de tamaño
=================================================================== */

/* Keyframes para el efecto de glow pulsante - SOLO BRILLO */
@keyframes formGlowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(84, 189, 149, 0.8);
        border-color: rgba(84, 189, 149, 0.6);
    }
    20% {
        box-shadow: 0 0 0 6px rgba(84, 189, 149, 0.5), 
                    0 0 15px 2px rgba(109, 209, 48, 0.4),
                    0 0 25px 4px rgba(84, 189, 149, 0.2);
        border-color: rgba(84, 189, 149, 0.9);
    }
    40% {
        box-shadow: 0 0 0 10px rgba(84, 189, 149, 0.3), 
                    0 0 25px 4px rgba(109, 209, 48, 0.35),
                    0 0 35px 8px rgba(84, 189, 149, 0.15);
        border-color: rgba(109, 209, 48, 0.8);
    }
    60% {
        box-shadow: 0 0 0 8px rgba(109, 209, 48, 0.4), 
                    0 0 20px 3px rgba(84, 189, 149, 0.4),
                    0 0 30px 6px rgba(109, 209, 48, 0.2);
        border-color: rgba(109, 209, 48, 0.9);
    }
    80% {
        box-shadow: 0 0 0 6px rgba(84, 189, 149, 0.5), 
                    0 0 15px 2px rgba(109, 209, 48, 0.4),
                    0 0 25px 4px rgba(84, 189, 149, 0.2);
        border-color: rgba(84, 189, 149, 0.9);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(84, 189, 149, 0.8);
        border-color: rgba(84, 189, 149, 0.6);
    }
}

/* Animación para el brillo de fondo - SIN SCALE */
@keyframes glowBackgroundPulse {
    0%, 100% {
        opacity: 0.4;
        background: linear-gradient(135deg, 
            rgba(84, 189, 149, 0.08), 
            rgba(109, 209, 48, 0.08), 
            rgba(84, 189, 149, 0.08));
    }
    25% {
        opacity: 0.6;
        background: linear-gradient(135deg, 
            rgba(84, 189, 149, 0.12), 
            rgba(109, 209, 48, 0.12), 
            rgba(84, 189, 149, 0.12));
    }
    50% {
        opacity: 0.8;
        background: linear-gradient(135deg, 
            rgba(109, 209, 48, 0.15), 
            rgba(84, 189, 149, 0.15), 
            rgba(109, 209, 48, 0.15));
    }
    75% {
        opacity: 0.6;
        background: linear-gradient(135deg, 
            rgba(84, 189, 149, 0.12), 
            rgba(109, 209, 48, 0.12), 
            rgba(84, 189, 149, 0.12));
    }
}

/* Clase para activar el glow - SIN CAMBIOS DE TAMAÑO */
.portfolio-card.glow-active {
    animation: formGlowPulse 3s ease-in-out infinite;
    border: 2px solid rgba(84, 189, 149, 0.7);
    border-radius: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 5;
}

/* Efecto adicional de resplandor de fondo - SIN SCALE */
.portfolio-card.glow-active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(135deg, 
        rgba(84, 189, 149, 0.08), 
        rgba(109, 209, 48, 0.08), 
        rgba(84, 189, 149, 0.08));
    border-radius: 46px;
    z-index: -1;
    animation: glowBackgroundPulse 3s ease-in-out infinite;
    filter: blur(1px);
}

/* Sutil brillo interno - SIN CAMBIOS */
.portfolio-card.glow-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%,
        rgba(84, 189, 149, 0.03) 50%,
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 40px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    animation: innerGlow 3s ease-in-out infinite;
}

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

/* Asegurar que el contenido del portfolio-card mantenga su z-index */
.portfolio-card.glow-active .portfolio-content,
.portfolio-card.glow-active .portfolio-header,
.portfolio-card.glow-active .portfolio-footer {
    position: relative;
    z-index: 2;
}

/* Efecto de fade out más suave al terminar */
.portfolio-card.glow-fadeout {
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: transparent;
    box-shadow: none;
    animation: none;
}

.portfolio-card.glow-fadeout::before,
.portfolio-card.glow-fadeout::after {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: none;
}

/* Responsive adjustments para formulario */
@media (max-width: 991px) {
    .portfolio-card {
        padding: 20px;
    }

    .portfolio-title {
        font-size: 32px;
    }

    .portfolio-subtitle {
        font-size: 16px;
    }

    .portfolio-content {
        font-size: 20px;
    }

    .portfolio-button {
        font-size: 16px;
    }
    
    .portfolio-card.glow-active {
        border-radius: 30px;
    }
    
    .portfolio-card.glow-active::before {
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
        border-radius: 34px;
    }
    
    .portfolio-card.glow-active::after {
        border-radius: 30px;
    }
}

@media (max-width: 640px) {
    .portfolio-card {
        padding: 16px;
        border-radius: 30px;
    }

    .portfolio-title {
        font-size: 28px;
    }

    .portfolio-subtitle {
        font-size: 14px;
    }

    .portfolio-content {
        font-size: 18px;
    }

    .portfolio-button {
        font-size: 14px;
        width: 100%;
    }
    
    .portfolio-footer {
        flex-direction: column;
    }
    
    .portfolio-button-back {
        width: 100%;
        justify-content: center;
        font-size: 14px;
    }
    
    .portfolio-button-next {
        width: 100%;
        font-size: 14px;
    }

    .svg-right,
    .svg-left {
        width: 300px;
        height: 250px;
        display: none;
    }
    
    .email-modal-content {
        padding: 25px;
        margin: 20% auto;
    }
    
    .email-modal-content h2 {
        font-size: 24px;
    }
    
    .email-modal-content p {
        font-size: 16px;
    }
    
    .close-portfolio-modal {
        top: 10px;
        right: 10px;
    }
    
    .portfolio-container {
        padding: 10px;
        max-height: 95vh;
    }
    
    .portfolio-card.glow-active {
        border-radius: 24px;
    }
    
    .portfolio-card.glow-active::before {
        border-radius: 28px;
    }
    
    .portfolio-card.glow-active::after {
        border-radius: 24px;
    }
}

@media (max-width: 480px) {
    #simple-questionnaire-form>div.form-group.active>p>span {
        font-size: 1.2rem;
    }
    
    .portfolio-content input,
    .portfolio-content select {
        font-size: 1.4rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* ============================================================================
   FEATURE MODALS - Información sobre características
============================================================================ */

/* Modal overlay and container */
.feature-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow-y: auto;
    padding: 20px;
}

.feature-modal.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Back button */
.feature-modal-back {
    position: absolute;
    top: 90px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-modal-back:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateX(-4px);
}

.feature-modal-back svg {
    width: 20px;
    height: 20px;
}

/* Modal content */
.feature-modal-content {
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    padding: 70px 20px 40px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    margin-top: 15vh;
}

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

/* Modal icon */
.feature-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out 0.3s both;
    box-shadow: 0 8px 24px rgba(62, 145, 11, 0.2);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feature-modal-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
    stroke-width: 2.5;
}

/* Modal title */
.feature-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--foreground);
    text-align: center;
    margin-bottom: 18px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Modal text content */
.feature-modal-text {
    color: var(--foreground);
    line-height: 1.7;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.feature-modal-text > p:first-child {
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--muted-foreground);
}

.feature-modal-text ul {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
}

.feature-modal-text li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    font-size: 14px;
    opacity: 0;
    animation: slideInLeft 0.4s ease-out forwards;
}

.feature-modal-text li:nth-child(1) {
    animation-delay: 0.6s;
}

.feature-modal-text li:nth-child(2) {
    animation-delay: 0.7s;
}

.feature-modal-text li:nth-child(3) {
    animation-delay: 0.8s;
}

.feature-modal-text li:nth-child(4) {
    animation-delay: 0.9s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feature-modal-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Highlight box */
.feature-modal-highlight {
    background: linear-gradient(135deg, rgba(62, 145, 11, 0.08), rgba(228, 113, 12, 0.08));
    border-left: 4px solid var(--primary);
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    animation: fadeInUp 0.6s ease-out 1s both;
}

.feature-modal-highlight svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Hide initial content when modal is active */
.initial-content {
    transition: all 0.3s ease-out;
}

.initial-content.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feature-modal {
        padding: 16px;
    }

    .feature-modal-back {
        top: 20px;
        left: 16px;
        width: 40px;
        height: 40px;
    }

    .feature-modal-content {
        padding: 60px 16px 30px;
        margin-top: 12vh;
    }

    .feature-modal-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .feature-modal-icon svg {
        width: 28px;
        height: 28px;
    }

    .feature-modal-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .feature-modal-text > p:first-child {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .feature-modal-text ul {
        margin-bottom: 14px;
    }

    .feature-modal-text li {
        font-size: 13px;
        padding-left: 26px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .feature-modal-text li::before {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .feature-modal-highlight {
        font-size: 12px;
        padding: 10px 12px;
        margin-top: 14px;
    }

    .feature-modal-highlight svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .feature-modal {
        padding: 12px;
    }

    .feature-modal-back {
        top: 16px;
        left: 12px;
        width: 36px;
        height: 36px;
    }

    .feature-modal-back svg {
        width: 18px;
        height: 18px;
    }

    .feature-modal-content {
        padding: 50px 12px 24px;
        margin-top: 25vh;
    }

    .feature-modal-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }

    .feature-modal-icon svg {
        width: 24px;
        height: 24px;
    }

    .feature-modal-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .feature-modal-text > p:first-child {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .feature-modal-text ul {
        margin-bottom: 12px;
    }

    .feature-modal-text li {
        font-size: 12px;
        padding-left: 24px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .feature-modal-text li::before {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    .feature-modal-highlight {
        font-size: 11px;
        padding: 8px 10px;
        margin-top: 12px;
    }

    .feature-modal-highlight svg {
        width: 14px;
        height: 14px;
    }
}
