/* Fix header on mobile */
@media (max-width: 768px) {
    .header {
        position: static !important;
    }
    .header-menu-btn {
        display: none !important;
    }
    .header-menu-wrapper {
        display: none !important;
    }
    .header-buttons {
        display: flex !important;
        position: relative !important;
        z-index: 100 !important;
        pointer-events: auto !important;
    }
    .header-buttons .btn,
    .header-buttons .try-btn {
        font-size: 13px !important;
        padding: 10px 18px !important;
        white-space: nowrap !important;
        height: 40px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    .header-buttons .btn .btn--inner span {
        font-size: 13px !important;
    }
    .header-buttons {
        gap: 8px !important;
    }
}

/* Hero "Попробовать" button */
.try-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 100px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.try-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.try-btn--arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.try-btn:hover .try-btn--arrow {
    transform: translateX(3px);
}

@media (max-width: 575px) {
    .try-btn {
        font-size: 14px;
        padding: 10px 24px;
    }
}

.chat-section--subtitle {
    text-align: center;
    margin-bottom: 28px;
}

/* ANIMA Chat Widget — consistent with landing design */

.chat-section {
    padding: 60px 0 80px;
    background: #121319;
    position: relative;
}

.chat-section .container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

.chat-section--title {
    text-align: center;
    font-size: 3.125rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 40px;
    font-family: 'Manrope', sans-serif;
    line-height: 1.15;
}

@media (max-width: 575px) {
    .chat-section--title {
        font-size: 1.75rem;
    }
}

.chat-widget {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: 560px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Message row (avatar + bubble) */
.chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: msgFadeIn 0.35s ease-out;
}

.chat-msg--user {
    flex-direction: row-reverse;
}

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

/* Avatar */
.chat-msg--avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8a9c9 0%, #8b7aa8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Message bubble */
.chat-msg--bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.55;
    font-family: 'Manrope', sans-serif;
}

.chat-msg--user .chat-msg--bubble {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-right-radius: 6px;
}

.chat-msg--assistant .chat-msg--bubble {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Typing indicator */
.chat-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px 20px !important;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

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

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-4px); opacity: 0.8; }
}

/* Quick buttons */
.chat-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 24px 20px;
    transition: opacity 0.3s ease, max-height 0.4s ease;
    max-height: 200px;
    overflow: hidden;
}

.chat-quick-buttons.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.chat-quick-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.chat-quick-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.04);
}

/* Input area */
.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-input-area.disabled {
    display: none;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 18px;
    color: #fff;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.chat-input:focus {
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-send-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.7);
}

/* CTA block */
.chat-cta {
    padding: 28px 24px;
    text-align: center;
    animation: msgFadeIn 0.5s ease-out;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-cta-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.chat-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #2AABEE;
    color: #fff;
    padding: 13px 32px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.chat-cta-btn:hover {
    background: #229ED9;
    transform: translateY(-1px);
}

.chat-cta-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Mobile */
@media (max-width: 575px) {
    .chat-section {
        padding: 40px 0 60px;
    }

    .chat-widget {
        min-height: 400px;
        max-height: 480px;
        border-radius: 18px;
    }

    .chat-msg--bubble {
        max-width: 85%;
        font-size: 14px;
    }

    .chat-msg--avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

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

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

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

    .chat-cta {
        padding: 20px 16px;
    }
}
