/**
 * Seção IA + Atendimento humano - CINNDI
 * Demo animada: conversa de WhatsApp alimentando o CRM em tempo real
 */

.ia-cinndi {
    padding: 100px 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 0%, rgba(59, 130, 246, 0.14), transparent 65%),
        radial-gradient(ellipse 55% 55% at 90% 100%, rgba(16, 185, 129, 0.12), transparent 65%),
        #0b1120;
    overflow: hidden;
}

.ia-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Cabeçalho */
.ia-header {
    max-width: 720px;
    margin-bottom: 56px;
}

.ia-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #34d399;
    margin-bottom: 18px;
    position: relative;
    padding-left: 44px;
}

.ia-eyebrow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 32px;
    height: 2px;
    background: #34d399;
    transform: translateY(-50%);
}

.ia-titulo {
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
}

.ia-titulo span {
    background: linear-gradient(120deg, #34d399, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ia-subtitulo {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #94a3b8;
    margin: 0;
}

/* Palco da demonstração */
.ia-demo {
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

/* ---------- Celular / WhatsApp ---------- */
.ia-phone {
    width: 302px;
    background: #0b141a;
    border-radius: 38px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    position: relative;
    flex-shrink: 0;
}

.ia-phone::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 22px;
    background: #0b141a;
    border-radius: 0 0 14px 14px;
    z-index: 5;
}

.ia-phone-screen {
    border-radius: 30px;
    overflow: hidden;
    height: 566px;
    display: flex;
    flex-direction: column;
    background: #efeae2;
}

.ia-wa-header {
    background: #008069;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 26px 14px 12px;
    flex-shrink: 0;
}

.ia-wa-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.ia-wa-header-info {
    line-height: 1.2;
    min-width: 0;
}

.ia-wa-header-nome {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
}

.ia-wa-header-status {
    font-size: 10.5px;
    opacity: 0.85;
}

.ia-wa-chat {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: none;
    background-image: radial-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px);
    background-size: 18px 18px;
}

.ia-wa-chat::-webkit-scrollbar {
    display: none;
}

.ia-msg {
    max-width: 80%;
    padding: 7px 9px 5px;
    border-radius: 9px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #111b21;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.09);
    animation: iaMsgEntra 0.3s ease both;
}

@keyframes iaMsgEntra {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ia-msg--in {
    align-self: flex-start;
    background: #ffffff;
    border-top-left-radius: 2px;
}

.ia-msg--out {
    align-self: flex-end;
    background: #d9fdd3;
    border-top-right-radius: 2px;
}

.ia-msg-autor {
    display: block;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #008069;
    margin-bottom: 2px;
}

.ia-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 9.5px;
    color: #667781;
    margin-top: 3px;
}

.ia-msg-meta svg {
    width: 13px;
    height: 13px;
    color: #53bdeb;
}

.ia-msg--sistema {
    align-self: center;
    max-width: 88%;
    background: #fff3c7;
    color: #54656f;
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    animation: iaMsgEntra 0.3s ease both;
}

/* Indicador "digitando" */
.ia-digitando {
    align-self: flex-end;
    background: #d9fdd3;
    border-radius: 9px;
    border-top-right-radius: 2px;
    padding: 10px 12px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.09);
    animation: iaMsgEntra 0.25s ease both;
}

.ia-digitando--in {
    align-self: flex-start;
    background: #ffffff;
    border-top-right-radius: 9px;
    border-top-left-radius: 2px;
}

.ia-digitando span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8696a0;
    animation: iaDigitando 1.1s ease-in-out infinite;
}

.ia-digitando span:nth-child(2) { animation-delay: 0.15s; }
.ia-digitando span:nth-child(3) { animation-delay: 0.3s; }

@keyframes iaDigitando {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Conector ---------- */
.ia-conector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 150px;
}

.ia-conector-linha {
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg, #34d399 0 7px, transparent 7px 15px);
    animation: iaConectorFluxo 0.9s linear infinite;
}

@keyframes iaConectorFluxo {
    from { background-position: 0 0; }
    to { background-position: 15px 0; }
}

.ia-conector-texto {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #34d399;
    text-align: center;
    line-height: 1.5;
}

/* ---------- Painel CRM ---------- */
.ia-crm {
    width: 350px;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.ia-crm-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.ia-crm-chrome i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.ia-crm-chrome i:nth-child(1) { background: #fca5a5; }
.ia-crm-chrome i:nth-child(2) { background: #fcd34d; }
.ia-crm-chrome i:nth-child(3) { background: #86efac; }

.ia-crm-chrome span {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.ia-crm-body {
    padding: 18px 20px 20px;
}

.ia-crm-contato {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ia-crm-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ia-crm-nome {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.ia-crm-canal {
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
}

/* Funil */
.ia-crm-funil {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}

.ia-crm-etapa {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.ia-crm-etapa::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    transition: background 0.4s ease;
}

.ia-crm-etapa:first-child::before {
    display: none;
}

.ia-crm-etapa i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #e2e8f0;
    position: relative;
    z-index: 1;
    transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.ia-crm-etapa span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #94a3b8;
    text-align: center;
    transition: color 0.4s ease;
}

.ia-crm-etapa.ativa i,
.ia-crm-etapa.feita i {
    background: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

.ia-crm-etapa.ativa i {
    transform: scale(1.35);
    box-shadow: 0 0 0 1px #10b981, 0 0 12px rgba(16, 185, 129, 0.7);
}

.ia-crm-etapa.ativa span {
    color: #059669;
}

.ia-crm-etapa.feita::before,
.ia-crm-etapa.ativa::before {
    background: #10b981;
}

/* Campos */
.ia-crm-campos {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0 0 16px;
}

.ia-crm-campo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 12.5px;
}

.ia-crm-campo dt {
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.ia-crm-campo dd {
    margin: 0;
    color: #cbd5e1;
    font-weight: 600;
    text-align: right;
}

.ia-crm-campo dd.preenchido {
    color: #0f172a;
    font-weight: 700;
    border-radius: 4px;
    animation: iaCampoFlash 1s ease;
}

@keyframes iaCampoFlash {
    0% { background: rgba(16, 185, 129, 0.35); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35); }
    100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

/* Tags */
.ia-crm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
    margin-bottom: 12px;
}

.ia-crm-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    background: #eef2ff;
    color: #4f46e5;
    animation: iaTagPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ia-crm-tag--verde {
    background: #dcfce7;
    color: #16a34a;
}

.ia-crm-tag--ambar {
    background: #fef3c7;
    color: #b45309;
}

@keyframes iaTagPop {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

/* Oportunidade criada */
.ia-crm-oportunidade {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 12.5px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.ia-crm-oportunidade.visivel {
    opacity: 1;
    transform: translateY(0);
}

.ia-crm-oportunidade svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- Papéis (rodapé editorial) ---------- */
.ia-papeis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 72px;
}

.ia-papel {
    border-top: 2px solid var(--papel-cor, #34d399);
    padding-top: 18px;
}

.ia-papel--ia { --papel-cor: #34d399; }
.ia-papel--crm { --papel-cor: #60a5fa; }
.ia-papel--time { --papel-cor: #a78bfa; }

.ia-papel strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.ia-papel p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #94a3b8;
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ia-conector-linha,
    .ia-digitando span {
        animation: none;
    }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
    .ia-demo {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 22px;
    }

    .ia-conector {
        width: auto;
        flex-direction: row;
        gap: 14px;
    }

    .ia-conector-linha {
        width: 44px;
    }

    .ia-crm {
        width: 100%;
        max-width: 380px;
    }
}

/* Seção visível apenas no desktop */
@media (max-width: 900px) {
    .ia-cinndi {
        display: none;
    }
}
