/* --- CONFIGURAÇÕES GERAIS E TIPOGRAFIA --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Permite scroll em telas pequenas */
    min-height: 100vh;
    margin: 0;
    padding: 20px 15px; /* Padding reduzido para mobile */
    box-sizing: border-box;
}

/* --- CONTAINER PRINCIPAL --- */
.container {
    background: #ffffff;
    width: 100%;
    max-width: 600px; /* Limite confortável para leitura */
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #0f172a;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 25px 0;
}

/* --- FORMULÁRIO --- */
.form-group {
    margin-bottom: 20px;
}

/* Flexbox para alinhar Label e Ícone de Ajuda */
.label-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-right: 8px;
}

/* --- INPUTS E SELECTS FLUIDOS --- */
input, select {
    width: 100%;
    padding: 14px; /* Área de toque confortável */
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem; /* 16px previne zoom automático no iOS */
    color: #1e293b;
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none; /* Remove estilo nativo (iOS/Android) */
    -webkit-appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Seta customizada para Select (funciona melhor em todos navegadores) */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* --- TOOLTIPS (AJUDA INTERATIVA) --- */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    background-color: #e2e8f0;
    color: #64748b;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.tooltip-icon:hover, .tooltip-container.active .tooltip-icon {
    background-color: #2563eb;
    color: white;
}

.tooltip-content {
    display: none; /* Oculto por padrão */
    position: absolute;
    bottom: 135%; /* Aparece acima do ícone */
    left: 50%;
    transform: translateX(-50%);
    width: 260px; /* Largura para caber o exemplo */
    max-width: 85vw; /* Nunca estoura a tela no mobile */
    background-color: #1e293b; /* Azul muito escuro */
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    text-align: left;
}

/* Triângulo do balão */
.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.tooltip-content p {
    margin: 0 0 8px 0;
}
.tooltip-content p:last-child {
    margin-bottom: 0;
}
.tooltip-content strong {
    color: #93c5fd; /* Azul claro para destacar "Exemplo" */
}

.tooltip-container.active .tooltip-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- BOTÃO DE AÇÃO --- */
button {
    width: 100%;
    padding: 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: scale(0.98);
}

button:hover {
    background-color: #1d4ed8;
}

button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* --- RESULTADOS & RELATÓRIO IA --- */
.hidden { display: none; }

#result-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #0f172a;
}

/* Estilo do Relatório Gerado */
/* ... MANTENHA O CSS ATÉ A LINHA .ai-content ... */

.ai-content {
    background-color: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 24px;
    border-radius: 4px 8px 8px 4px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    word-wrap: break-word;
}

/* Remove margens extras do container gerado pela IA */
.ai-content .report-container {
    margin: 0;
    padding: 0;
}

.ai-content h3 {
    color: #1e3a8a;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.ai-content h3:first-child {
    margin-top: 0;
}

.ai-content p {
    margin-bottom: 12px;
    text-align: justify;
}

/* Destaque para o Veredito */
.ai-content .verdict {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    background-color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.ai-content ul {
    margin: 12px 0;
    padding-left: 20px;
    background: #fff;
    padding: 15px 15px 15px 35px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ai-content li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.ai-content strong {
    color: #1e40af;
    font-weight: 700;
}

/* ... MANTENHA AS MEDIA QUERIES ... */

/* Mensagem de Carregamento */
.loading {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* Animação de Entrada do Resultado */
.fade-in {
    animation: fadeInResult 0.5s ease-in-out;
}

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

/* --- MEDIA QUERIES (MOBILE) --- */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.3rem;
    }

    /* Ajuste para inputs */
    input, select {
        padding: 12px;
    }
    
    /* Ajuste fino dos tooltips no celular */
    .tooltip-content {
        width: 220px;
        left: 50%; 
        /* Mantém centralizado mas limitado pelo max-width global */
    }
}