/* AXIA — inteligência operacional CALLINFO (identidade alinhada ao Site) */

:root {
    --axia-deep: #060b14;
    --axia-tech: #2b5c92;
    --axia-cyan: #00e5ff;
    --axia-accent: #059669;
    --axia-glow: rgba(0, 229, 255, 0.22);
    --axia-mark-bg: #060b14;
    --axia-z-orb: 2450;
    --axia-z-dock: 2500;
    --axia-z-welcome: 2550;
}

/* ——— Orb flutuante (telas sem barra) / inline na barra (hub e módulos) ——— */
.eq-axia-orb {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: var(--axia-z-orb);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 10px;
    border: 1px solid rgba(0, 229, 255, 0.28);
    border-radius: 999px;
    background: var(--axia-mark-bg);
    color: #f8fafc;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    max-width: min(280px, calc(100vw - 100px));
    text-align: left;
}

.eq-axia-orb.eq-axia-orb--barra {
    position: static;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
    margin: 0 8px 0 0;
    padding: 3px 8px 3px 4px;
    gap: 6px;
    max-width: min(168px, 26vw);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.eq-barra-sessao .eq-axia-orb--barra .eq-axia-orb-sub {
    display: none;
}

html.eq-inicio .eq-axia-orb:not(.eq-axia-orb--barra),
html.eq-win-mode .eq-axia-orb:not(.eq-axia-orb--barra) {
    display: none !important;
}

.eq-axia-orb:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 229, 255, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px var(--axia-glow);
}
.eq-axia-orb:focus-visible {
    outline: 2px solid var(--axia-cyan);
    outline-offset: 3px;
}
.eq-axia-orb.is-born {
    animation: axiaOrbBorn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eq-axia-orb.is-busy .eq-axia-orb-halo {
    animation: axiaPulse 1.4s ease-in-out infinite;
}
.eq-axia-orb.is-open {
    border-color: rgba(5, 150, 105, 0.5);
    box-shadow: 0 12px 32px rgba(11, 28, 53, 0.35), 0 0 20px rgba(5, 150, 105, 0.15);
}
.eq-axia-orb-halo {
    position: absolute;
    left: 9px;
    top: 50%;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}
.eq-axia-orb-mark-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--axia-mark-bg);
    display: grid;
    place-items: center;
}
.eq-axia-orb-mark {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--axia-mark-bg);
    filter: drop-shadow(0 2px 8px rgba(0, 229, 255, 0.24));
}
.eq-axia-orb-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.eq-axia-orb-name {
    font: 700 0.82rem Montserrat, Inter, sans-serif;
    letter-spacing: 0.06em;
    color: #f0fdfa;
}
.eq-axia-orb-sub {
    font: 500 0.62rem Inter, sans-serif;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.eq-axia-orb-status {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--axia-deep);
    color: #e2e8f0;
    font: 600 0.68rem Inter, sans-serif;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(8, 145, 178, 0.25);
}
@keyframes axiaOrbBorn {
    from { opacity: 0; transform: scale(0.85) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes axiaPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* ——— Boas-vindas ——— */
.eq-axia-welcome {
    position: fixed;
    inset: 0;
    z-index: var(--axia-z-welcome);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 11, 20, 0.72);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}
.eq-axia-welcome.is-visible { opacity: 1; }
.eq-axia-welcome.is-leaving {
    opacity: 0;
    transition-duration: 0.55s;
}
.eq-axia-welcome-card {
    text-align: center;
    max-width: 420px;
    padding: 28px 24px;
    border-radius: 16px;
    background: linear-gradient(165deg, #0f172a 0%, #0b1c35 100%);
    border: 1px solid rgba(8, 145, 178, 0.28);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    animation: axiaWelcomeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eq-axia-welcome.is-leaving .eq-axia-welcome-card {
    animation: axiaWelcomeOut 0.55s ease both;
}
.eq-axia-welcome-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 8px 24px rgba(8, 145, 178, 0.4));
}
.eq-axia-welcome-kicker {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8;
}
.eq-axia-welcome-title {
    margin: 6px 0 12px;
    font: 700 1.15rem Montserrat, Inter, sans-serif;
    color: #f8fafc;
    line-height: 1.35;
}
.eq-axia-welcome-body {
    margin: 0;
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.5;
}
.eq-axia-welcome-body strong { color: #5eead4; font-weight: 700; }
@keyframes axiaWelcomeIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes axiaWelcomeOut {
    to { opacity: 0; transform: scale(0.88) translateY(-20px); }
}

/* ——— Painel / drawer ——— */
.eq-cia-dock {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100dvh;
    z-index: var(--axia-z-dock);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-left: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: -12px 0 40px rgba(11, 28, 53, 0.12);
}
.eq-cia-dock[hidden] { display: none !important; }

.eq-cia-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--axia-deep) 0%, #132f52 100%);
    color: #fff;
    border-bottom: 1px solid rgba(8, 145, 178, 0.2);
}
.eq-axia-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.eq-axia-head-mark {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 2px 8px rgba(8, 145, 178, 0.35));
}
.eq-axia-brand-text h2 {
    margin: 0;
    font: 700 0.95rem Montserrat, Inter, sans-serif;
    letter-spacing: 0.05em;
    color: #f0fdfa;
    line-height: 1.2;
}
.eq-axia-brand-text small {
    display: block;
    font: 500 0.68rem Inter, sans-serif;
    color: #94a3b8;
    margin-top: 2px;
}
.eq-axia-mode-chip {
    flex-shrink: 0;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    font: 600 0.62rem Inter, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ecfeff;
    background: rgba(0, 229, 255, 0.16);
    border: 1px solid rgba(0, 229, 255, 0.35);
}
.eq-axia-mode-chip[data-mode="assistente"] {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.4);
}
.eq-axia-mode-chip[data-mode="operacional"] {
    color: #d1fae5;
    background: rgba(5, 150, 105, 0.28);
    border-color: rgba(52, 211, 153, 0.45);
}
.eq-cia-x {
    width: 34px;
    height: 34px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0;
}
.eq-cia-x:hover { background: rgba(255, 255, 255, 0.14); }
.eq-cia-x:focus-visible { outline: 2px solid var(--axia-cyan); outline-offset: 2px; }

.eq-axia-status {
    flex-shrink: 0;
    min-height: 0;
    padding: 0 16px 8px;
    font: 600 0.72rem Inter, sans-serif;
    color: var(--axia-cyan);
    background: linear-gradient(135deg, var(--axia-deep) 0%, #132f52 100%);
}
.eq-axia-status:empty { display: none; padding: 0; }

.eq-cia-ctx {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    background: #eef4fb;
    border-bottom: 1px solid #dbe4ef;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.eq-cia-ctx span { white-space: nowrap; }
.eq-cia-ctx strong { color: var(--axia-deep); font-weight: 700; }

.eq-cia-log {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}
.eq-cia-entry { font-size: 0.84rem; line-height: 1.5; color: #334155; }
.eq-cia-reply { white-space: pre-wrap; margin-top: 4px; }
.eq-cia-entry.user { color: var(--axia-deep); font-weight: 600; }
.eq-cia-entry.err { color: #b91c1c; }

.eq-axia-intro-msg {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #115e59;
    font-size: 0.82rem;
    line-height: 1.45;
}
.eq-axia-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
}
.eq-axia-thinking img { animation: axiaPulse 1.2s ease-in-out infinite; }
.eq-axia-reply-block { line-height: 1.5; }
.eq-axia-reply-block.err { color: #b91c1c; }

.eq-cia-steps {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
}
.eq-cia-steps li { color: #64748b; }
.eq-cia-steps li.ok { color: var(--axia-accent); }
.eq-cia-steps li.warn { color: #b45309; }
.eq-cia-steps li.err { color: #b91c1c; }

.eq-cia-post-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.eq-cia-post-prompt {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}
.eq-cia-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.eq-cia-actions button,
.eq-cia-post-actions button {
    border: 1px solid #cbd5e1;
    background: var(--axia-deep);
    color: #fff;
    border-radius: 8px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.eq-cia-actions button:hover,
.eq-cia-post-actions button:hover { background: var(--axia-tech); }
.eq-cia-actions button.ghost,
.eq-cia-post-actions button.ghost {
    background: #fff;
    color: #334155;
}
.eq-cia-actions button[data-cia-kind="guia"] {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    color: var(--axia-deep);
    border: 1px solid #cbd5e1;
}

.eq-cia-form {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    padding: 12px 14px 14px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.eq-cia-form textarea {
    flex: 1;
    min-height: 46px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    padding: 11px 12px;
    font: 400 0.88rem Inter, sans-serif;
    background: #fff;
    color: #0f172a;
}
.eq-cia-mic {
    border: 1px solid #cbd5e1;
    border-left: 0;
    border-right: 0;
    background: #fff;
    min-width: 44px;
    color: var(--axia-tech);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.eq-cia-mic.is-on {
    background: #fee2e2;
    color: #b91c1c;
}
.eq-axia-orb.is-listening {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}
.eq-cia-form textarea::placeholder { color: #64748b; }
.eq-cia-form textarea:focus {
    outline: none;
    border-color: var(--axia-cyan);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15);
}
.eq-cia-form button[type="submit"] {
    border: 0;
    background: var(--axia-tech);
    color: #fff;
    padding: 0 16px;
    min-width: 48px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0 10px 10px 0;
    transition: background 0.15s ease;
}
.eq-cia-form button[type="submit"]:hover { background: var(--axia-cyan); }
.eq-cia-form button[type="submit"]:focus-visible {
    outline: 2px solid var(--axia-cyan);
    outline-offset: 2px;
}

/* Header launch removido — legado oculto */
.eq-cia-launch { display: none !important; }

/* OZ oculta quando AXIA ativa */
body.eq-axia-ativa .eq-ia-fab,
body.eq-axia-ativa .eq-ia-painel,
body.eq-axia-ativa #eqIaOptInModal { display: none !important; visibility: hidden !important; }

/* Drawer aberto — ajuda não sobrepõe */
body.eq-axia-aberta .eq-man-fab {
    right: auto;
    left: 18px;
    bottom: 18px;
}

@media (max-width: 640px) {
    .eq-cia-dock { width: 100vw; }
    .eq-axia-orb {
        right: 12px;
        bottom: 14px;
        padding: 8px 12px 8px 8px;
        gap: 8px;
    }
    .eq-axia-orb-sub { display: none; }
    .eq-axia-orb-mark-wrap { width: 20px; height: 20px; }
    .eq-axia-orb-mark { width: 100%; height: 100%; }
    .eq-axia-welcome-title { font-size: 1rem; }
    body.eq-axia-aberta .eq-axia-orb {
        z-index: calc(var(--axia-z-dock) + 2);
        bottom: 14px;
        right: 12px;
        transform: scale(0.88);
        padding: 6px 10px 6px 6px;
    }
    body.eq-axia-aberta .eq-axia-orb-name { font-size: 0.75rem; }
}
