/*
 * =============================================
 * Chat Button & Lead Capture - Form Styles (v5.7.1)
 * Author: DropDesk (via Gemini Developer)
 * =============================================
 * Descrição: Estilos para o modo de Formulário de Captura de Lead.
 * Este arquivo contém uma base de estilos compartilhada e estilos
 * específicos para o formulário.
 * =============================================
 */

/* ============================================= */
/* [BASE] Animações Compartilhadas              */
/* ============================================= */

/* Animação de Pulsar para o botão flutuante */
@keyframes cblc_pulsate {
    from { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    to { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
}

/* Animação de Brilho para o botão flutuante */
@keyframes cblc_glow {
  0% { box-shadow: 0 0 5px var(--cblc-dynamic-color), 0 0 10px var(--cblc-dynamic-color), 0 0 15px #ffffff; }
  100% { box-shadow: 0 0 10px color-mix(in srgb, var(--cblc-dynamic-color) 80%, #fff), 0 0 20px color-mix(in srgb, var(--cblc-dynamic-color) 80%, #fff), 0 0 25px #ffffff; }
}

/* Animação de balanço para o botão flutuante */
@keyframes cblc_shake {
  0%, 100% { transform: rotate(0deg); }
  2%, 6% { transform: rotate(5deg); }
  4%, 8% { transform: rotate(-5deg); }
}

/* Animação de entrada do Modal */
@keyframes cblc_slideUp {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Animação de entrada dos gatilhos (Botão e Avatar) */
@keyframes cblc_trigger_entry {
    from { transform: translateY(40px); }
    to { transform: translateY(0); }
}

/* Animação dos pontos do indicador de digitação (para o avatar) */
@keyframes cblc_bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

@keyframes cblc_slide_in_and_fade {
    from {
        transform: translateY(120px); /* Começa totalmente fora da tela */
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================= */
/* [BASE] Gatilhos Flutuantes (Botão e Avatar)  */
/* ============================================= */

/* Estilo do Botão Flutuante Padrão */
#wa-float-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    /* A cor vem da variável --cblc-dynamic-color definida pelo PHP */
    background-color: var(--cblc-dynamic-color);
    color: white;
    border-radius: 50px;
    display: none; /* JS controla a visibilidade inicial */
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    cursor: pointer;
    z-index: 9999;
    transition: all .3s ease;
    gap: 8px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: cblc_pulsate 1.5s infinite alternate ease-in-out,
               cblc_glow 2s infinite alternate ease-in-out,
               cblc_shake 15s infinite ease-in-out 5s;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out 1s;
    animation-name: cblc_trigger_entry;
    animation-duration: 0.6s;
    animation-delay: 1s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
}
#wa-float-button:hover {
    transform: scale(1.1);
}

/* Estilo do Gatilho de Avatar */
.cblc-avatar-trigger-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex; /* JS controla a visibilidade inicial */
    align-items: flex-end;
    gap: 10px;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out 1s;
    animation-name: cblc_trigger_entry;
    animation-duration: 0.6s;
    animation-delay: 1s;
    animation-fill-mode: forwards;
    animation-name: cblc_slide_in_and_fade;
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); /* Curva suave */
    animation-delay: 1s;
}
.cblc-avatar-photo {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.cblc-avatar-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid white;
}
.cblc-avatar-message {
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 20px;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 250px;
    font-family: sans-serif;
    font-size: 15px;
    color: #333;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform-origin: bottom right;
}
.cblc-avatar-message.visible {
    opacity: 1;
    transform: scale(1);
}

/* Indicador "Online" (Bolinha Verde) para Avatar */
.cblc-avatar-photo::after,
.cblc-avatar-photo::after{
    content: '';
    position: absolute;
    z-index: 10;
    width: 15px;
    height: 15px;
    background-color: #25D366;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    bottom: 2px;
    right: 2px;
}

.cblc-avatar-photo::after { /* Bolinha do avatar flutuante (maior) */
    width: 15px;
    height: 15px;
    border: 2px solid white;
    bottom: 2px;
    right: 2px;
}
.cblc-agent-photo::after { /* Bolinha do avatar no header (menor) */
    width: 12px;
    height: 12px;
    border: 2px solid var(--cblc-dynamic-color);
    bottom: 0px;
    right: 0px;
}

/* Indicador de digitação para o Avatar */
#cblc-typing-indicator-bubble {
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 20px;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    transition: opacity 0.4s ease;
    position: absolute;
    bottom: 0;
    right: 75px;
}
#cblc-typing-indicator-bubble.hidden { opacity: 0; }
#cblc-typing-indicator-bubble span {
    height: 8px;
    width: 8px;
    background-color: #9E9E9E;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: cblc_bounce 1.4s infinite both;
}
#cblc-typing-indicator-bubble span:nth-child(2) { animation-delay: .2s; }
#cblc-typing-indicator-bubble span:nth-child(3) { animation-delay: .4s; }


/* ============================================= */
/* [ESPECÍFICO] Estilos do Modal de Formulário  */
/* ============================================= */

#wa-lead-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    font-family: sans-serif;
}
.wa-modal-content {
    position: absolute;
    bottom: 95px;
    right: 25px;
    width: 90%;
    max-width: 380px;
    background-color: #F0F2F5; /* Cor de fundo unificada */
    border-radius: 8px;
    box-shadow: 0 6px 20px 0 rgba(0,0,0,0.19);
    animation: cblc_slideUp .4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: bottom right;
    overflow: hidden; /* Garante que os cantos arredondados sejam respeitados */
}

/* Cabeçalho do Modal Unificado */
.wa-modal-header {
    padding: 10px 15px;
    background-color: var(--cblc-dynamic-color);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.wa-modal-header .cblc-agent-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    flex-shrink: 0;
    position: relative;
}

.wa-modal-header .cblc-agent-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
}

.wa-modal-header .cblc-agent-photo::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #25D366;
    border-radius: 50%;
    border: 2px solid var(--cblc-dynamic-color);
    bottom: 0px;
    right: 0px;
}
.cblc-agent-info {
    flex-grow: 1;
    text-align: left;
}
.cblc-agent-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}
.cblc-agent-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}
.wa-modal-header .close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: auto;
    padding: 0 5px;
}

/* Corpo do Modal com Formulário */
.wa-modal-body {
    padding: 20px;
    background-color: #FFF; /* Fundo branco para o formulário */
}
.wa-modal-body > p {
    color: #4a4a4a;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

#wa-lead-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#wa-lead-form input:focus {
    border-color: var(--cblc-dynamic-color);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cblc-dynamic-color) 30%, transparent);
}
#wa-lead-form button {
    width: 100%;
    background-color: var(--cblc-dynamic-color);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}
#wa-lead-form button:hover {
    background-color: color-mix(in srgb, var(--cblc-dynamic-color) 85%, #000);
}
#wa-lead-form button:disabled {
    background-color: #a0a0a0;
    cursor: wait;
}

/* Estilos de Validação */
.cblc-input-error {
    border-color: #d63638 !important;
}
.cblc-error-message {
    color: #d63638;
    font-size: 12px;
    margin-top: -8px;
    margin-bottom: 10px;
    text-align: left;
}


/* Marca d'água */
.cblc-branding {
    text-align: center;
    padding: 8px 0;
    font-size: 10px;
    background-color: #f0f2f5;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.cblc-branding a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s ease;
}
.cblc-branding a:hover {
    color: #333;
}