/* ═══════════════════════════════════════════════
   PNIA — Módulo 05: Público-alvo  v1.0.0
   ═══════════════════════════════════════════════ */

/* ── Container geral ── */
.pnia-m05-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 4px;
}

/* ── Seção genérica ── */
.pnia-m05-section {
    padding: 12px 0;
}

/* ════════════════════════════════════════
   CARD DE INTRODUÇÃO
   ════════════════════════════════════════ */
.pnia-m05-intro-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px 36px;
    text-align: center;
    color: #fff;
    box-shadow: 0 8px 32px rgba(102,126,234,.30);
}

.pnia-m05-intro-icon {
    font-size: 52px;
    margin-bottom: 12px;
    line-height: 1;
}

.pnia-m05-intro-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}

.pnia-m05-intro-desc {
    font-size: 1rem;
    opacity: .9;
    margin: 0 0 20px;
    line-height: 1.6;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.pnia-m05-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: inline-block;
    text-align: left;
}

.pnia-m05-checklist li {
    font-size: .93rem;
    opacity: .9;
    padding: 4px 0;
}

/* ════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════ */
.pnia-m05-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .88rem;
    transition: background .18s, transform .12s, box-shadow .18s;
    padding: 8px 16px;
    line-height: 1;
}

.pnia-m05-btn:active { transform: scale(.97); }

.pnia-m05-btn-primary {
    background: #667eea;
    color: #fff;
}
.pnia-m05-btn-primary:hover { background: #5a6fd6; }

.pnia-m05-btn-secondary {
    background: #f0f0f0;
    color: #444;
}
.pnia-m05-btn-secondary:hover { background: #e2e2e2; }

.pnia-m05-btn-success {
    background: #22c55e;
    color: #fff;
}
.pnia-m05-btn-success:hover { background: #16a34a; }

.pnia-m05-btn-ghost {
    background: transparent;
    color: #667eea;
    border: 1.5px solid #667eea;
}
.pnia-m05-btn-ghost:hover { background: #f0f2ff; }

.pnia-m05-btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.pnia-m05-btn-lg:hover { box-shadow: 0 6px 20px rgba(0,0,0,.24); }

.pnia-m05-btn-sm {
    padding: 5px 10px;
    font-size: .8rem;
}

.pnia-m05-btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ════════════════════════════════════════
   LOADING
   ════════════════════════════════════════ */
.pnia-m05-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.pnia-m05-loading-inner {
    text-align: center;
}

.pnia-m05-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pnia-m05-spin .8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes pnia-m05-spin {
    to { transform: rotate(360deg); }
}

.pnia-m05-loading-inner p {
    color: #6b7280;
    font-size: .93rem;
}

/* ════════════════════════════════════════
   LAYOUT PRINCIPAL (duas colunas)
   ════════════════════════════════════════ */
.pnia-m05-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 720px) {
    .pnia-m05-main-layout {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════
   COLUNA CHAT
   ════════════════════════════════════════ */
.pnia-m05-col-chat {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.pnia-m05-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.pnia-m05-chat-icon { font-size: 1.5rem; }

.pnia-m05-chat-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.pnia-m05-chat-sub {
    font-size: .78rem;
    color: #9ca3af;
    margin: 0;
}

.pnia-m05-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    max-height: 440px;
}

/* ── Mensagens individuais ── */
.pnia-m05-msg {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: .87rem;
    line-height: 1.55;
    word-break: break-word;
}

.pnia-m05-msg-user {
    background: #667eea;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.pnia-m05-msg-assistant {
    background: #f3f4f6;
    color: #1a1a2e;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.pnia-m05-msg-system {
    background: #fef9c3;
    color: #713f12;
    align-self: center;
    text-align: center;
    font-size: .82rem;
    padding: 7px 12px;
    border-radius: 20px;
    max-width: 95%;
}

.pnia-m05-msg-error {
    background: #fee2e2;
    color: #b91c1c;
    align-self: flex-start;
    font-size: .82rem;
}

/* Typing indicator */
.pnia-m05-msg-typing {
    background: #f3f4f6;
    align-self: flex-start;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    align-items: center;
    border-bottom-left-radius: 3px;
}

.pnia-m05-msg-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: pnia-m05-bounce .9s infinite;
}

.pnia-m05-msg-typing span:nth-child(2) { animation-delay: .15s; }
.pnia-m05-msg-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes pnia-m05-bounce {
    0%, 80%, 100% { transform: scale(1); opacity: .5; }
    40%           { transform: scale(1.25); opacity: 1; }
}

.pnia-m05-divider {
    border: none;
    border-top: 1px solid #d1d5db;
    margin: 6px 0;
}

/* ── Input do chat ── */
.pnia-m05-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    align-items: flex-end;
}

.pnia-m05-chat-textarea {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: .87rem;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .15s;
}

.pnia-m05-chat-textarea:focus {
    border-color: #667eea;
}

.pnia-m05-send-icon { font-style: normal; }

/* ════════════════════════════════════════
   COLUNA EDITOR
   ════════════════════════════════════════ */
.pnia-m05-col-editor {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.pnia-m05-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    gap: 8px;
    flex-wrap: wrap;
}

.pnia-m05-editor-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
}

.pnia-m05-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnia-m05-badge-salvo {
    font-size: .75rem;
    color: #16a34a;
    font-weight: 600;
}

.pnia-m05-editor-textarea {
    flex: 1;
    min-height: 360px;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: .875rem;
    font-family: inherit;
    line-height: 1.65;
    resize: vertical;
    color: #1a1a2e;
}

.pnia-m05-editor-textarea::placeholder {
    color: #b0b8c8;
}

.pnia-m05-editor-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    justify-content: flex-end;
}

/* ════════════════════════════════════════
   PREVIEW — MÓDULO CONCLUÍDO
   ════════════════════════════════════════ */
.pnia-m05-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pnia-m05-preview-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.pnia-m05-preview-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.pnia-m05-preview-content {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 28px;
    font-size: .92rem;
    line-height: 1.7;
    color: #374151;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.pnia-m05-preview-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin: 16px 0 6px;
}

.pnia-m05-preview-content p {
    margin: 0 0 10px;
}

.pnia-m05-preview-content strong {
    color: #1a1a2e;
}
