/* ============================================
   NEUROAPP ASSISTANT — chat widget
   ============================================ */

#na-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1050;
    transition: transform 0.25s ease;
    animation: naLauncherBob 2.6s ease-in-out infinite;
}

#na-chat-launcher img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

#na-chat-launcher:hover {
    transform: translateY(-3px) scale(1.05);
}

#na-chat-launcher.na-active {
    animation: none;
}

@keyframes naLauncherBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

#na-chat-launcher .na-launcher-dot {
    position: absolute;
    top: 10px;
    right: 6px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #34d399;
    border: 2px solid #060d1a;
}

/* ── Proactive CTA callout bubble ── */
.na-callout {
    position: fixed;
    right: 18px;
    bottom: 100px;
    max-width: 240px;
    background: #0c1628;
    border: 1px solid rgba(0, 82, 255, 0.3);
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    padding: 0.75rem 0.9rem;
    color: #e2e8f0;
    font-size: 0.82rem;
    line-height: 1.45;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
    z-index: 1049;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.na-callout.na-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.na-callout img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 1px;
}

.na-callout-close {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#na-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 102px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 130px));
    background: #0c1628;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1050;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    font-family: 'Inter', sans-serif;
}

#na-chat-panel.na-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.na-chat-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.na-chat-header img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 82, 255, 0.14);
    padding: 3px;
    flex-shrink: 0;
    object-fit: contain;
}

.na-chat-header-text {
    flex: 1;
    min-width: 0;
}

.na-chat-header-text .na-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
}

.na-chat-header-text .na-subtitle {
    color: #34d399;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.na-chat-header-text .na-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
}

.na-chat-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.na-chat-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.na-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.na-chat-body::-webkit-scrollbar {
    width: 6px;
}

.na-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.na-msg {
    max-width: 84%;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.na-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border-bottom-left-radius: 4px;
}

.na-msg-user {
    align-self: flex-end;
    background: #0052FF;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.na-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 0.65rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.na-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    animation: naTypingBounce 1.2s infinite ease-in-out;
}

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

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

@keyframes naTypingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ── Quick-suggestion CTA chips (shown when no question has been asked yet) ── */
.na-suggestions {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-width: 92%;
}

.na-suggestion-chip {
    background: rgba(0, 82, 255, 0.1);
    border: 1px solid rgba(0, 82, 255, 0.3);
    color: #7db4ff;
    border-radius: 20px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.na-suggestion-chip:hover {
    background: #0052FF;
    color: #fff;
}

/* ── Inline contact-form widget (AI tool-call driven) ── */
.na-form-card {
    align-self: stretch;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 82, 255, 0.25);
    border-radius: 14px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.na-form-card label {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    display: block;
}

.na-form-card input,
.na-form-card textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.na-form-card input:focus,
.na-form-card textarea:focus {
    border-color: rgba(0, 82, 255, 0.6);
}

.na-form-card textarea {
    resize: vertical;
    min-height: 56px;
}

.na-form-submit {
    background: #0052FF;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.na-form-submit:hover {
    background: #003cc7;
}

.na-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.na-form-error {
    color: #f87171;
    font-size: 0.75rem;
    display: none;
}

.na-form-success {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
}

.na-chat-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.na-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 90px;
    transition: border-color 0.2s ease;
}

.na-chat-input:focus {
    border-color: rgba(0, 82, 255, 0.5);
}

.na-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #0052FF;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.na-chat-send:hover {
    background: #003cc7;
}

.na-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    #na-chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 96px;
    }

    #na-chat-launcher {
        right: 12px;
        bottom: 12px;
    }

    .na-callout {
        right: 12px;
        bottom: 94px;
    }
}
