/* ── Reset ────────────────────────────────────────────────── */
#aa-widget * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
#aa-widget a { text-decoration: none; }

/* ════════════════════════════════════════════════════════════
   LÍNGUA / TAB BUTTON
   ════════════════════════════════════════════════════════════ */
#aa-tab {
    position: fixed;
    right: 0;
    bottom: 220px;
    z-index: 99998;
    cursor: pointer;
    border-radius: 10px 0 0 10px;
    padding: 16px 10px;
    width: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: -3px 2px 18px rgba(0,0,0,.28);
    transition: width .22s ease, box-shadow .22s ease, padding .22s ease;
    overflow: hidden;
    user-select: none;
}
#aa-tab:hover,
#aa-tab.aa-tab-open {
    width: 68px;
    box-shadow: -5px 3px 26px rgba(0,0,0,.36);
    padding: 16px 14px;
}

#aa-tab-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid rgba(255,255,255,.5);
    flex-shrink: 0;
    animation: aa-pulse 2.5s infinite;
}
@keyframes aa-pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.7} }

#aa-tab-icon {
    font-size: 20px;
    flex-shrink: 0;
}

#aa-tab-label {
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   CHAT WINDOW
   ════════════════════════════════════════════════════════════ */
#aa-window {
    position: fixed;
    bottom: 24px;
    right: 70px;
    width: 360px;
    max-height: 540px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 99997;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
#aa-window[hidden] { display: none; }

@media (max-width: 480px) {
    #aa-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
        max-height: 85vh;
    }
    #aa-tab { bottom: 160px; }
}

/* ── Header ───────────────────────────────────────────────── */
#aa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    flex-shrink: 0;
}
#aa-header-info { display: flex; align-items: center; gap: 10px; }
#aa-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; flex-shrink: 0;
}
#aa-name   { font-weight: 600; font-size: 14px; }
#aa-status { font-size: 11px; opacity: .65; margin-top: 1px; }
#aa-close  { background: none; border: none; font-size: 22px; cursor: pointer; line-height: 1; opacity: .55; transition: opacity .15s; }
#aa-close:hover { opacity: 1; }

/* ── Messages ─────────────────────────────────────────────── */
#aa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
#aa-messages::-webkit-scrollbar { width: 4px; }
#aa-messages::-webkit-scrollbar-thumb { border-radius: 4px; }

.aa-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.aa-msg-user      { align-self: flex-end;   border-bottom-right-radius: 4px; }
.aa-msg-assistant { align-self: flex-start; border-bottom-left-radius:  4px; }

/* Typing */
.aa-typing { display: flex !important; align-items: center; gap: 5px; padding: 12px 16px; }
.aa-typing span { width: 7px; height: 7px; border-radius: 50%; display: block; animation: aa-bounce .9s infinite; }
.aa-typing span:nth-child(2) { animation-delay: .15s; }
.aa-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes aa-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

/* ── Actions ──────────────────────────────────────────────── */
#aa-actions { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.aa-action-btn {
    display: block; text-align: center;
    padding: 10px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none;
    transition: filter .15s; text-decoration: none;
}
.aa-action-btn:hover { filter: brightness(1.09); }
.aa-lead-form  { display: flex; flex-direction: column; gap: 7px; }
.aa-lead-title { font-size: 12px; font-weight: 600; line-height: 1.4; }
.aa-lead-input { padding: 8px 10px; border-radius: 8px; font-size: 13px; border: 1px solid rgba(0,0,0,.12); outline: none; }
.aa-gdpr-label { font-size: 11px; display: flex; gap: 6px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.aa-gdpr-label input { margin-top: 2px; flex-shrink: 0; }
.aa-lead-note  { font-size: 12px; margin-top: 4px; }
.aa-lead-note-error { color: #e74c3c; }
.aa-lead-success { font-size: 13px; padding: 10px; border-radius: 8px; }

/* ── Input ────────────────────────────────────────────────── */
#aa-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; flex-shrink: 0;
    border-top: 1px solid rgba(0,0,0,.07);
}
#aa-input { flex: 1; padding: 9px 12px; border-radius: 10px; border: none; font-size: 14px; outline: none; }
#aa-send  { background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 6px; opacity: .75; transition: opacity .15s, transform .15s; }
#aa-send:hover { opacity: 1; transform: translateX(2px); }

/* ── GDPR footer ──────────────────────────────────────────── */
#aa-gdpr-note { font-size: 10px; text-align: center; padding: 5px 12px 9px; opacity: .4; flex-shrink: 0; }
#aa-gdpr-note a { text-decoration: underline; }


/* ════════════════════════════════════════════════════════════
   T H E M E S
   ════════════════════════════════════════════════════════════ */

/* ── hipno — azul HIPNOPORTO + fundo branco/cinza (NOVO) ─── */
.aa-theme-hipno #aa-tab          { background: #1B3D6F; color: #fff; }
.aa-theme-hipno #aa-window       { background: #f5f7fa; color: #1a1a1a; border: 1px solid #dce3ef; }
.aa-theme-hipno #aa-header       { background: #1B3D6F; }
.aa-theme-hipno #aa-avatar       { background: #ffffff33; color: #fff; }
.aa-theme-hipno #aa-name         { color: #fff; }
.aa-theme-hipno #aa-status       { color: rgba(255,255,255,.7); }
.aa-theme-hipno #aa-close        { color: rgba(255,255,255,.8); }
.aa-theme-hipno .aa-msg-user     { background: #1B3D6F; color: #fff; }
.aa-theme-hipno .aa-msg-assistant{ background: #fff; color: #1a1a1a; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.aa-theme-hipno .aa-typing span  { background: #1B3D6F; }
.aa-theme-hipno #aa-messages::-webkit-scrollbar-thumb { background: #1B3D6F44; }
.aa-theme-hipno .aa-action-btn   { background: #1B3D6F; color: #fff; }
.aa-theme-hipno .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-hipno .aa-lead-input   { background: #fff; color: #1a1a1a; border-color: #ccd6e8; }
.aa-theme-hipno .aa-lead-success { background: #eaf0f9; color: #1B3D6F; }
.aa-theme-hipno #aa-input-wrap   { border-top: 1px solid #dce3ef; background: #f0f3f8; }
.aa-theme-hipno #aa-input        { background: #fff; color: #1a1a1a; border: 1px solid #ccd6e8; }
.aa-theme-hipno #aa-send         { color: #1B3D6F; }
.aa-theme-hipno #aa-gdpr-note    { color: #555; }
.aa-theme-hipno .aa-lead-title   { color: #1B3D6F; }

/* ── midnight — navy + dourado ───────────────────────────── */
.aa-theme-midnight #aa-tab          { background: #1a1f35; color: #c9a84c; }
.aa-theme-midnight #aa-window       { background: #12172b; color: #e8e8e8; }
.aa-theme-midnight #aa-header       { background: #1a1f35; }
.aa-theme-midnight #aa-avatar       { background: #c9a84c; color: #12172b; }
.aa-theme-midnight #aa-name         { color: #fff; }
.aa-theme-midnight #aa-close        { color: #c9a84c; }
.aa-theme-midnight .aa-msg-user     { background: #c9a84c; color: #12172b; }
.aa-theme-midnight .aa-msg-assistant{ background: #1e2540; color: #e8e8e8; }
.aa-theme-midnight .aa-typing span  { background: #c9a84c; }
.aa-theme-midnight #aa-messages::-webkit-scrollbar-thumb { background: #c9a84c44; }
.aa-theme-midnight .aa-action-btn   { background: #c9a84c; color: #12172b; }
.aa-theme-midnight .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-midnight .aa-lead-input   { background: #1e2540; color: #e8e8e8; border-color: #2d3660; }
.aa-theme-midnight .aa-lead-success { background: #1e2540; color: #c9a84c; }
.aa-theme-midnight #aa-input-wrap   { background: #0e1220; }
.aa-theme-midnight #aa-input        { background: #1e2540; color: #e8e8e8; }
.aa-theme-midnight #aa-send         { color: #c9a84c; }

/* ── dark — escuro + verde ───────────────────────────────── */
.aa-theme-dark #aa-tab          { background: #1a1a1a; color: #4ade80; }
.aa-theme-dark #aa-window       { background: #111; color: #e0e0e0; }
.aa-theme-dark #aa-header       { background: #1a1a1a; }
.aa-theme-dark #aa-avatar       { background: #2d6a4f; color: #fff; }
.aa-theme-dark #aa-name         { color: #fff; }
.aa-theme-dark #aa-close        { color: #4ade80; }
.aa-theme-dark .aa-msg-user     { background: #2d6a4f; color: #fff; }
.aa-theme-dark .aa-msg-assistant{ background: #1e1e1e; color: #e0e0e0; }
.aa-theme-dark .aa-typing span  { background: #4ade80; }
.aa-theme-dark #aa-messages::-webkit-scrollbar-thumb { background: #2d6a4f88; }
.aa-theme-dark .aa-action-btn   { background: #2d6a4f; color: #fff; }
.aa-theme-dark .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-dark .aa-lead-input   { background: #1e1e1e; color: #e0e0e0; border-color: #333; }
.aa-theme-dark .aa-lead-success { background: #1e1e1e; color: #4ade80; }
.aa-theme-dark #aa-input-wrap   { background: #0a0a0a; }
.aa-theme-dark #aa-input        { background: #1e1e1e; color: #e0e0e0; }
.aa-theme-dark #aa-send         { color: #4ade80; }

/* ── light — branco + verde escuro ──────────────────────── */
.aa-theme-light #aa-tab          { background: #2d6a4f; color: #fff; }
.aa-theme-light #aa-window       { background: #fff; color: #111; border: 1px solid #e0e0e0; }
.aa-theme-light #aa-header       { background: #2d6a4f; }
.aa-theme-light #aa-avatar       { background: #ffffff33; color: #fff; }
.aa-theme-light #aa-name         { color: #fff; }
.aa-theme-light #aa-status       { color: rgba(255,255,255,.75); }
.aa-theme-light #aa-close        { color: rgba(255,255,255,.8); }
.aa-theme-light .aa-msg-user     { background: #2d6a4f; color: #fff; }
.aa-theme-light .aa-msg-assistant{ background: #f2f2f2; color: #111; }
.aa-theme-light .aa-typing span  { background: #2d6a4f; }
.aa-theme-light #aa-messages::-webkit-scrollbar-thumb { background: #2d6a4f55; }
.aa-theme-light .aa-action-btn   { background: #2d6a4f; color: #fff; }
.aa-theme-light .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-light .aa-lead-input   { background: #f9f9f9; color: #111; border-color: #ddd; }
.aa-theme-light .aa-lead-success { background: #f0faf5; color: #2d6a4f; }
.aa-theme-light #aa-input-wrap   { background: #f5f5f5; }
.aa-theme-light #aa-input        { background: #fff; color: #111; border: 1px solid #ddd; }
.aa-theme-light #aa-send         { color: #2d6a4f; }
.aa-theme-light #aa-gdpr-note    { color: #666; }

/* ── slate — azulado + azul ──────────────────────────────── */
.aa-theme-slate #aa-tab          { background: #1e2533; color: #60a5fa; }
.aa-theme-slate #aa-window       { background: #151c28; color: #d1d5db; }
.aa-theme-slate #aa-header       { background: #1e2533; }
.aa-theme-slate #aa-avatar       { background: #2563eb; color: #fff; }
.aa-theme-slate #aa-name         { color: #f1f5f9; }
.aa-theme-slate #aa-close        { color: #60a5fa; }
.aa-theme-slate .aa-msg-user     { background: #2563eb; color: #fff; }
.aa-theme-slate .aa-msg-assistant{ background: #1e2533; color: #d1d5db; }
.aa-theme-slate .aa-typing span  { background: #60a5fa; }
.aa-theme-slate #aa-messages::-webkit-scrollbar-thumb { background: #2563eb55; }
.aa-theme-slate .aa-action-btn   { background: #2563eb; color: #fff; }
.aa-theme-slate .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-slate .aa-lead-input   { background: #1e2533; color: #d1d5db; border-color: #2d3748; }
.aa-theme-slate .aa-lead-success { background: #1e2533; color: #60a5fa; }
.aa-theme-slate #aa-input-wrap   { background: #0f1520; }
.aa-theme-slate #aa-input        { background: #1e2533; color: #d1d5db; }
.aa-theme-slate #aa-send         { color: #60a5fa; }

/* ── minimal — branco + preto ────────────────────────────── */
.aa-theme-minimal #aa-tab          { background: #111; color: #fff; }
.aa-theme-minimal #aa-window       { background: #fff; color: #111; border: 1.5px solid #111; }
.aa-theme-minimal #aa-header       { background: #111; }
.aa-theme-minimal #aa-avatar       { background: rgba(255,255,255,.15); color: #fff; }
.aa-theme-minimal #aa-name         { color: #fff; }
.aa-theme-minimal #aa-status       { color: rgba(255,255,255,.6); }
.aa-theme-minimal #aa-close        { color: rgba(255,255,255,.8); }
.aa-theme-minimal .aa-msg-user     { background: #111; color: #fff; }
.aa-theme-minimal .aa-msg-assistant{ background: #f4f4f4; color: #111; }
.aa-theme-minimal .aa-typing span  { background: #111; }
.aa-theme-minimal #aa-messages::-webkit-scrollbar-thumb { background: #bbb; }
.aa-theme-minimal .aa-action-btn   { background: #111; color: #fff; }
.aa-theme-minimal .aa-action-wa    { background: #25d366; color: #fff; }
.aa-theme-minimal .aa-lead-input   { background: #f9f9f9; color: #111; border-color: #ddd; }
.aa-theme-minimal .aa-lead-success { background: #f4f4f4; color: #111; }
.aa-theme-minimal #aa-input-wrap   { background: #f5f5f5; border-top: 1px solid #e0e0e0; }
.aa-theme-minimal #aa-input        { background: #fff; color: #111; border: 1px solid #ddd; }
.aa-theme-minimal #aa-send         { color: #111; }
.aa-theme-minimal #aa-gdpr-note    { color: #888; }
