/* ========================================
   PRE-FORM CHAT - Estilo WhatsApp
   Palmilhas CAPPES
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e5ddd5 0%, #d4ccc4 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
.chat-header {
    background: linear-gradient(135deg, #3d2817 0%, #5a3d28 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 6px;
    flex-shrink: 0;
}

.chat-header-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}

.chat-header-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #25d366;
    border-radius: 50%;
}

/* ========================================
   CHAT CONTAINER
   ======================================== */
.chat-container {
    flex: 1;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23d4ccc4" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    background-color: #e5ddd5;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   MENSAGENS
   ======================================== */
.message {
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-content {
    padding: 10px 14px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
    font-size: 14px;
}

.message.bot .message-content {
    background: #fff;
    border-bottom-left-radius: 0;
    color: #1a1816;
}

.message.user .message-content {
    background: #dcf8c6;
    border-bottom-right-radius: 0;
    color: #1a1816;
}

.message-time {
    font-size: 11px;
    color: #8a8886;
    margin-top: 4px;
    align-self: flex-end;
}

/* Formatação de texto nas mensagens */
.message-content strong {
    font-weight: 600;
}

.message-content .highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.message-content .price {
    font-size: 20px;
    font-weight: 700;
    color: #2D7A4F;
    display: block;
    margin: 8px 0;
}

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

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

.message-content .check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
}

.message-content .check-item::before {
    content: '✅';
    flex-shrink: 0;
}

/* ========================================
   TYPING INDICATOR
   ======================================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    border-bottom-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 70px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #8a8886;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* ========================================
   BOTÕES DE RESPOSTA (INLINE)
   ======================================== */
.chat-buttons-inline {
    margin-top: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUp 0.3s ease-out;
}

/* Estilo antigo para compatibilidade */
.chat-buttons {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e8e6e3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.chat-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.chat-btn.primary {
    background: linear-gradient(135deg, #3d2817 0%, #8B6F47 50%, #C9A962 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(61, 40, 23, 0.3);
}

.chat-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(61, 40, 23, 0.4);
}

.chat-btn.primary:active {
    transform: translateY(0);
}

.chat-btn.secondary {
    background: #fff;
    color: #3d2817;
    border: 2px solid #3d2817;
}

.chat-btn.secondary:hover {
    background: #faf8f5;
    border-color: #8B6F47;
}

.chat-btn.success {
    background: linear-gradient(135deg, #2D7A4F, #25a35a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(45, 122, 79, 0.3);
}

.chat-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 122, 79, 0.4);
}

.chat-btn.outline {
    background: rgba(255, 255, 255, 0.9);
    color: #5a5856;
    border: 2px solid #d4d2cf;
}

.chat-btn.outline:hover {
    border-color: #8a8886;
    background: #faf8f5;
}

.chat-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Botões lado a lado */
.chat-buttons.row,
.chat-buttons-inline.row {
    flex-direction: row;
    flex-wrap: wrap;
}

.chat-buttons.row .chat-btn,
.chat-buttons-inline.row .chat-btn {
    flex: 1;
    min-width: 140px;
}

/* ========================================
   CARD DE INVESTIMENTO
   ======================================== */
.investment-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    border-left: 4px solid #D4AF37;
}

.investment-card .price-tag {
    font-size: 28px;
    font-weight: 800;
    color: #3d2817;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.investment-card .price-tag small {
    font-size: 14px;
    font-weight: 500;
    color: #5a5856;
}

.investment-card .benefits {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.investment-card .benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #433f3d;
}

.investment-card .benefit-item .icon {
    width: 20px;
    height: 20px;
    background: #2D7A4F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

/* ========================================
   CARD DE PROCESSO
   ======================================== */
.process-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    border: 1px solid #e8e6e3;
}

.process-step {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f3f0;
}

.process-step:last-child {
    border-bottom: none;
}

.process-step .step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3d2817, #8B6F47);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.process-step .step-content {
    flex: 1;
}

.process-step .step-title {
    font-weight: 600;
    font-size: 14px;
    color: #2d2a28;
    margin-bottom: 2px;
}

.process-step .step-desc {
    font-size: 12px;
    color: #8a8886;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */
@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

/* ========================================
   HIDDEN STATE
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVO
   ======================================== */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 16px;
    }

    .chat-header-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-messages {
        padding: 16px;
    }

    .message {
        max-width: 90%;
    }

    .message-content {
        font-size: 14px;
        padding: 10px 12px;
    }

    .chat-buttons,
    .chat-buttons-inline {
        padding: 12px 0;
    }

    .chat-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .chat-buttons.row .chat-btn,
    .chat-buttons-inline.row .chat-btn {
        min-width: 120px;
    }

    .investment-card .price-tag {
        font-size: 24px;
    }
}

/* ========================================
   SCROLLBAR
   ======================================== */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #b8b6b3;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #8a8886;
}

/* ========================================
   GARANTIA BADGE
   ======================================== */
.guarantee-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    margin-top: 8px;
}

.guarantee-badge .icon {
    font-size: 16px;
}

/* ========================================
   LINK WHATSAPP
   ======================================== */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
}

.whatsapp-link:hover {
    text-decoration: underline;
}
