/* Portal do solicitante — Design moderno e responsivo sobre tokens do style.css */
.portal-body {
  background: var(--bg, var(--surface-2));
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Cabeçalho e Navegação ── */
.pt-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.pt-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
}
.pt-brand .icon {
  width: 22px;
  height: 22px;
}
.pt-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pt-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius, 8px);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.pt-nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.pt-nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 600px) {
  .pt-bar { padding: 8px 12px; }
  .pt-brand span { display: none; }
  .pt-nav-link span { display: none; }
  .pt-nav-link { padding: 8px 10px; }
}

/* ── Conteúdo Principal ── */
.pt-main {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}
.pt-single-col {
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pt-main h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.pt-h {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pt-hello {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0;
  color: var(--text);
}
.pt-big {
  width: 100%;
  justify-content: center;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius, 10px);
}
.pt-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.pt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pt-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.pt-form .input,
.pt-form textarea {
  font-size: 14.5px;
  font-family: inherit;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  min-height: 44px;
  height: auto;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pt-form .select,
.pt-form select,
select.select {
  font-size: 14.5px !important;
  font-family: inherit !important;
  border-radius: var(--radius, 8px) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 11px 38px 11px 14px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.pt-form .select option,
.pt-form select option,
select.select option {
  padding: 8px 12px !important;
  font-size: 14px !important;
  color: var(--text) !important;
  background: var(--surface) !important;
}
.pt-form textarea {
  min-height: 110px;
  height: auto;
  padding: 10px 14px;
  resize: vertical;
}
.pt-form .input:focus,
.pt-form .select:focus,
.pt-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ── Abas de Login / Cadastro Rápido ── */
.pt-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius, 8px);
  padding: 4px;
  gap: 4px;
}
.pt-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pt-tab-btn:hover {
  color: var(--text);
}
.pt-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Lista de Chamados ── */
.pt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pt-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  color: inherit;
  text-decoration: none;
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.pt-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.pt-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.pt-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.pt-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.pt-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--warn, #d97706);
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--warn, #f59e0b) 12%, transparent);
  padding: 2px 8px;
  border-radius: 12px;
}
.pt-closed summary {
  cursor: pointer;
  color: var(--text-2);
  padding: 8px 4px;
  font-weight: 600;
  font-size: 14px;
}
.pt-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
  margin-bottom: 4px;
}
.pt-back:hover {
  color: var(--accent);
}

/* ── Chat em Tempo Real — Balões Modernos ── */
.pt-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.pt-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}
.pt-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.pt-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 12px;
}
.pt-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 82%;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
/* Mensagem da TI / Atendente */
.pt-msg.tech {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
}
.pt-msg-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.pt-msg-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--accent);
  text-transform: uppercase;
}
/* Mensagem do Solicitante (Você) */
.pt-msg.me {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 16px 16px 4px 16px;
}
.pt-msg.me .pt-msg-author {
  color: var(--accent);
}
.pt-msg-time {
  font-size: 11px;
  color: var(--text-2);
  align-self: flex-end;
  margin-top: 2px;
}
.pt-msg .pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

/* ── Formulário de Resposta do Chat ── */
.pt-reply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.pt-reply-card textarea {
  border: none;
  background: transparent;
  resize: vertical;
  min-height: 60px;
  padding: 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.pt-reply-card textarea:focus {
  outline: none;
}
.pt-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ── Base de Conhecimento Moderna & Ampla ── */
.pt-kb-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius, 16px);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
.pt-kb-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pt-kb-hero p {
  color: var(--text-2);
  margin: 0;
  font-size: 15px;
}
.pt-kb-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.pt-kb-search .icon {
  position: absolute;
  left: 16px;
  color: var(--text-2);
  pointer-events: none;
}
.pt-kb-search input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.pt-kb-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.pt-kb-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 2px;
  scrollbar-width: thin;
  justify-content: flex-start;
  flex-wrap: wrap;
}
@media (min-width: 900px) {
  .pt-kb-pills {
    justify-content: center;
  }
}
.pt-kb-pill {
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.pt-kb-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.pt-kb-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Grade ampla de artigos — 2 ou 3 colunas em telas médias/largas */
.pt-kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-top: 14px;
}
@media (max-width: 768px) {
  .pt-kb-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.pt-kb-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  position: relative;
}
.pt-kb-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.pt-kb-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pt-kb-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.pt-kb-card-head h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}
.pt-kb-card-snip {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-kb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 4px;
}
.pt-kb-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pt-kb-arrow {
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}
.pt-kb-card:hover .pt-kb-arrow {
  transform: translateX(3px);
}

.pt-article-view {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ── Sugestão Rápida da KB no formulário ── */
.pt-kb {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius, 10px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pt-kb .pt-item {
  padding: 8px 10px;
  font-size: 13px;
}

/* ── Avaliação / Feedback ── */
.pt-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.pt-stars {
  display: flex;
  gap: 8px;
}
.pt-stars .btn {
  width: 44px;
  height: 44px;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
}

/* ── Estilos Aprimorados para Formulário de Abertura ── */
.pt-form-group {
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 80%, var(--surface-2) 20%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}
.pt-form-group:focus-within {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.pt-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.pt-group-head .icon {
  color: var(--accent);
  width: 17px;
  height: 17px;
}
.pt-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.pt-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.pt-template-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text);
  margin-top: -4px;
}
.pt-file-uploader {
  border: 2px dashed var(--border);
  border-radius: var(--radius, 10px);
  padding: 14px 16px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pt-file-uploader:hover,
.pt-file-uploader.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.pt-file-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.pt-file-preview-card .file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

