/**
 * IBPM - Estilos do Formulário Conversacional com IA
 */

/* =====================================================
   CONTAINER CONVERSACIONAL
   ===================================================== */
.chat-container {
    max-width: 700px;
    margin: 0 auto;
}

.chat-card {
    background: white;
    border-radius: var(--raio-xl);
    box-shadow: var(--sombra-xl);
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-primaria-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.chat-header h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.chat-header p {
    opacity: 0.9;
    margin: 0;
}

.chat-body {
    padding: 2rem;
}

/* =====================================================
   TEXTAREA CONVERSACIONAL
   ===================================================== */
.chat-input-wrapper {
    position: relative;
}

.chat-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    border: 2px solid var(--cor-borda);
    border-radius: var(--raio-lg);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s ease;
    font-family: var(--fonte-principal);
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 4px rgba(var(--cor-primaria-rgb), 0.1);
}

.chat-textarea::placeholder {
    color: var(--cor-texto-muted);
}

.char-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    color: var(--cor-texto-muted);
}

/* =====================================================
   SUGESTÕES
   ===================================================== */
.sugestoes {
    margin-top: 1.5rem;
}

.sugestoes-label {
    font-size: 0.875rem;
    color: var(--cor-texto-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.sugestoes-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sugestao-chip {
    background: var(--cor-fundo);
    border: 1px solid var(--cor-borda);
    padding: 0.5rem 1rem;
    border-radius: var(--raio-full);
    font-size: 0.875rem;
    color: var(--cor-texto);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sugestao-chip:hover {
    background: var(--cor-primaria);
    border-color: var(--cor-primaria);
    color: white;
    transform: translateY(-2px);
}

/* =====================================================
   BOTÃO ANALISAR
   ===================================================== */
.btn-analisar {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: var(--raio-lg);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-analisar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-analisar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-analisar .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.ia-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.ia-loading-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.ia-loading-icon::before,
.ia-loading-icon::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.ia-loading-icon::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-scale 1.5s ease-in-out infinite;
}

.ia-loading-icon::after {
    width: 30px;
    height: 30px;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.ia-loading-text {
    font-size: 1.125rem;
    color: var(--cor-texto);
    margin-bottom: 0.5rem;
}

.ia-loading-subtext {
    font-size: 0.875rem;
    color: var(--cor-texto-muted);
}

/* =====================================================
   RESULTADO COM TYPEWRITER
   ===================================================== */
.ia-resultado {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resultado-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--raio-xl);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    margin-bottom: 2rem;
}

.resultado-card h3 {
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resultado-card h3 i {
    font-size: 1.5rem;
}

/* Efeito Typewriter */
.typewriter {
    font-size: 1.125rem;
    line-height: 1.7;
    min-height: 80px;
}

.typewriter.typing::after {
    content: '|';
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* =====================================================
   DADOS EXTRAÍDOS
   ===================================================== */
.dados-extraidos {
    background: white;
    border-radius: var(--raio-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dados-extraidos h4 {
    font-size: 1rem;
    color: var(--cor-texto-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dados-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 576px) {
    .dados-grid {
        grid-template-columns: 1fr;
    }
}

.dado-item {
    padding: 0.75rem;
    background: var(--cor-fundo);
    border-radius: var(--raio-md);
}

.dado-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--cor-texto-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.dado-item .valor {
    font-weight: 600;
    color: var(--cor-texto);
}

.dado-item .valor.editavel {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: var(--raio-sm);
    transition: background 0.2s;
}

.dado-item .valor.editavel:hover {
    background: rgba(var(--cor-primaria-rgb), 0.1);
}

/* =====================================================
   CAMPOS FALTANTES
   ===================================================== */
.campos-faltantes {
    background: #fff8e6;
    border: 1px solid #ffd666;
    border-radius: var(--raio-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.campos-faltantes h5 {
    font-size: 0.875rem;
    color: #ad6800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campos-faltantes ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #ad6800;
    font-size: 0.875rem;
}

.campos-faltantes li {
    margin-bottom: 0.25rem;
}

/* =====================================================
   AÇÕES
   ===================================================== */
.resultado-acoes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-confirmar {
    flex: 1;
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--cor-secundaria);
    border: none;
    border-radius: var(--raio-lg);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-confirmar:hover {
    background: var(--cor-secundaria-dark);
    transform: translateY(-2px);
}

.btn-editar,
.btn-reescrever {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    border: 2px solid var(--cor-borda);
    border-radius: var(--raio-lg);
    color: var(--cor-texto);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-editar:hover,
.btn-reescrever:hover {
    border-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

/* =====================================================
   AVATAR DO USUÁRIO
   ===================================================== */
.user-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--cor-borda);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cor-primaria);
}

.user-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.user-info p {
    margin: 0;
    color: var(--cor-texto-muted);
    font-size: 0.9rem;
}

/* =====================================================
   INDICADOR DE CONFIANÇA
   ===================================================== */
.confianca-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--raio-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.confianca-alta {
    background: #d4edda;
    color: #155724;
}

.confianca-media {
    background: #fff3cd;
    color: #856404;
}

.confianca-baixa {
    background: #f8d7da;
    color: #721c24;
}

/* =====================================================
   RESPONSIVO
   ===================================================== */
@media (max-width: 767.98px) {
    .chat-header {
        padding: 1.5rem;
    }

    .chat-body {
        padding: 1.5rem;
    }

    .chat-textarea {
        min-height: 120px;
        padding: 1rem;
        font-size: 1rem;
    }

    .resultado-card {
        padding: 1.5rem;
    }

    .typewriter {
        font-size: 1rem;
    }

    .resultado-acoes {
        flex-direction: column;
    }

    .btn-confirmar,
    .btn-editar,
    .btn-reescrever {
        width: 100%;
    }
}
