/* ============================================
   MONTEIRO & ASSOCIADOS - CHATBOT WIDGET
   ============================================ */

/* === VARIABLES === */
:root {
    --navy: #0f1b2d;
    --navy-light: #1a2940;
    --navy-mid: #243550;
    --gold: #ff5821;
    --gold-light: #fc845c;
    --gold-muted: rgba(201,168,76,0.15);
    --cream: #f8f6f1;
    --cream-dark: #edeae3;
    --white: #ffffff;
    --text: #2c2c2c;
    --text-light: #6b6b6b;
    --text-on-dark: #d4d0c8;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --shadow-chat: 0 12px 48px rgba(15,27,45,0.25);
    --radius: 6px;
    --radius-lg: 12px;
}

/* === CHAT TOGGLE BUTTON === */
.chat-toggle {
    position: fixed;
    bottom: 85px;
    right: 24px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: var(--gold);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-chat);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    animation: chatPopIn 0.5s ease 1s both;
}

@keyframes chatPopIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.chat-toggle:hover {
    transform: scale(1.08);
    background: var(--gold-light);
}

.chat-toggle svg {
    width: 26px;
    height: 26px;
    fill: var(--navy);
    transition: transform 0.3s;
}

.chat-toggle.active svg {
    transform: rotate(90deg);
}

/* === NOTIFICATION BADGE === */
.chat-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    font-size: 0.65rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === CHAT WINDOW === */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-chat);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* === CHAT HEADER === */
.chat-header {
    background: var(--navy);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--gold-muted);
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.chat-header-info h4 {
    color: var(--cream);
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chat-header-info span {
    color: rgb(3, 226, 3);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chat-header-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
}

.chat-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.chat-close svg {
    fill: var(--cream);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-close:hover svg {
    opacity: 1;
}

/* === MESSAGES CONTAINER === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(15,27,45,0.15);
    border-radius: 4px;
}

/* === MESSAGE BUBBLES === */
.msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.55;
    animation: chatMsgIn 0.3s ease;
}

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

.msg.bot {
    background: var(--cream);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg.user {
    background: var(--navy);
    color: var(--cream);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg.bot strong {
    color: var(--navy);
}

/* === TYPING INDICATOR === */
.msg-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    align-self: flex-start;
    background: var(--cream);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.msg-typing span {
    width: 7px;
    height: 7px;
    background: var(--navy-mid);
    border-radius: 50%;
    animation: chatTyping 1.2s infinite;
}

.msg-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.msg-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

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

/* === QUICK REPLIES === */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 1.25rem 0.75rem;
    animation: chatMsgIn 0.3s ease;
}

.quick-reply {
    background: var(--white);
    border: 1px solid rgba(15,27,45,0.12);
    color: var(--navy);
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--sans);
}

.quick-reply:hover {
    background: var(--navy);
    color: var(--cream);
    border-color: var(--navy);
}

/* === INPUT AREA === */
.chat-input-area {
    border-top: 1px solid rgba(15,27,45,0.08);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    background: var(--white);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--sans);
    font-size: 0.88rem;
    color: var(--text);
    background: transparent;
    padding: 0.5rem 0;
}

.chat-input::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

.chat-send {
    width: 36px;
    height: 36px;
    background: var(--gold);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send:hover {
    background: var(--gold-light);
    transform: scale(1.05);
}

.chat-send svg {
    width: 16px;
    height: 16px;
    fill: var(--navy);
}

/* === DISCLAIMER === */
.chat-disclaimer {
    text-align: center;
    padding: 0.4rem 1rem 0.6rem;
    font-size: 0.65rem;
    color: var(--text-light);
    opacity: 0.6;
    background: var(--white);
    flex-shrink: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 88px;
        height: calc(100vh - 120px);
    }
    
    .chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}