/*
 * Base de conhecimento -- identidade visual da Sellentt (sellentt.com.br).
 *
 * Paleta 100% laranja Sellentt (sem azul) e fundo branco, igual ao site --
 * o site institucional nao tem modo escuro, entao esta base tambem nao tem.
 *
 * Formas extraidas do site institucional:
 *   - laranja de marca #EE7100 (CTA, links, indicador ativo, categorias, tags)
 *   - cantos retos (2px) em botoes e cartoes -- a marca nao usa pilula/rounded
 *   - sombra caracteristica 0 16px 40px rgba(100,114,128,.2) nos cartoes
 *   - tipografia GreycliffCF (fonte proprietaria da Sellentt, licenciada
 *     separadamente). Aqui usamos Poppins como substituta -- geometria
 *     proxima -- ate os arquivos .woff2 da GreycliffCF serem adicionados em
 *     /public/fonts e declarados via @font-face (ver comentario no final).
 */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-sunken: #f4f3f0;
  --border: #e8e7e4;
  --text: #1a1a1a;
  --muted: #5f5e5a;

  --brand: #ee7100;
  --brand-strong: #c85000;
  --brand-soft: #fff3ec;
  /* "acento" agora e so um segundo tom de laranja -- sem azul na marca */
  --accent: #c85000;
  --accent-soft: #fff3ec;

  --radius: 2px;
  --radius-lg: 4px;
  --shadow: 0 16px 40px rgba(100, 114, 128, 0.2);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --code-bg: #f4f3f0;

  --font: 'Poppins', 'GreycliffCF', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding-block: 12px;
  padding-left: 4px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  height: 40px;
  width: auto;
}

.topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--brand-strong);
}

.brand__name {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}

/* ---------------------------------------------------------------- topnav */

.topnav__item {
  position: relative;
}

.topnav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
}

.topnav__item:hover .topnav__trigger,
.topnav__item:focus-within .topnav__trigger {
  color: var(--brand);
}

.topnav__chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.topnav__item:hover .topnav__chevron,
.topnav__item:focus-within .topnav__chevron {
  transform: rotate(180deg);
}

.mega {
  position: absolute;
  left: 0;
  top: calc(100% + 14px);
  z-index: 20;
  display: flex;
  gap: 28px;
  min-width: 480px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.topnav__item:hover .mega,
.topnav__item:focus-within .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega__col {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.mega__col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mega__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--brand-soft);
  border-radius: var(--radius);
  color: var(--brand);
}

.mega__icon svg {
  width: 15px;
  height: 15px;
}

.mega__icon--addon {
  background: #e6f7f9;
  color: #17a2b8;
}

/* Selo ADDON: mesma cor usada no painel de verdade (sellentt-panel), pra
   quem conhece o produto reconhecer de cara. */
.addon-badge {
  display: inline-block;
  padding: 1px 7px;
  background: #17a2b8;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.addon-badge--sm {
  padding: 0 5px;
  font-size: 9.5px;
}

.page-head h1 .addon-badge {
  margin-left: 6px;
  font-size: 12.5px;
}

/* Selo dos artigos vindos da base canonica kb/ (origem: 'kb'). */
.kb-seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  padding: 6px 12px;
  border: 1px solid #bfe3c6;
  border-radius: var(--radius);
  background: #f1f9f2;
  color: #245c31;
  font-size: 13.5px;
}

.kb-seal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #2f7d43;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Ancora quebrada / verificacao vencida: o selo vira alerta. */
.kb-seal--alerta {
  border-color: #f0d3a8;
  background: #fdf6ea;
  color: #7a4c10;
}

.kb-seal--alerta .kb-seal__icon {
  background: #b9761b;
}

.mega__col-head strong {
  font-size: 14px;
}

.mega__col ul {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.mega__col ul a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13.5px;
}

.mega__col ul a:hover {
  color: var(--brand);
  text-decoration: none;
}

.mega__viewall {
  margin-top: auto;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .topnav {
    order: 3;
    width: 100%;
  }

  .mega {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    transform: none;
  }

  .topnav__item:hover .mega,
  .topnav__item:focus-within .mega {
    display: flex;
    flex-wrap: wrap;
  }
}

.search {
  display: flex;
  flex: 1 1 260px;
  gap: 8px;
  max-width: 460px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
}

.search input:focus-visible,
.search button:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.search button,
.button {
  padding: 9px 20px;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button {
  display: inline-block;
}

.button:hover,
.search button:hover {
  background: var(--brand-strong);
  color: #fff;
  text-decoration: none;
}

/* ------------------------------------------------------------------ layout */

.layout {
  padding-block: 32px 56px;
}


/* ------------------------------------------------------------------- lista */

.page-head {
  margin-bottom: 28px;
}

.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 17px;
}

.article__summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 17px;
}

.result-count {
  margin: 0;
  font-size: 14px;
}

.clear {
  margin-left: 6px;
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 720px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: inherit;
}

.card__link:hover {
  text-decoration: none;
}

.card__body {
  min-width: 0;
}

.card__category {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__title {
  margin: 2px 0 3px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}

.card__title::before {
  content: '\25B8';
  margin-right: 5px;
  color: var(--brand);
}

.card__link:hover .card__title {
  color: var(--brand);
}

.card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
}

.card__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--brand-soft);
  border-radius: 999px;
  color: var(--brand);
}

.card__icon svg {
  width: 20px;
  height: 20px;
}

.empty {
  padding: 40px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  font-size: 14.5px;
}

/* ------------------------------------------------------------------ artigo */

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.article {
  max-width: 720px;
}

.article__meta {
  margin: 0;
  font-size: 14px;
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}

.prose {
  padding-top: 8px;
  font-size: 16.5px;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 36px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 22px;
}

.prose h3 {
  margin: 28px 0 10px;
  font-weight: 600;
  font-size: 18px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 6px;
}

.prose code {
  padding: 2px 5px;
  background: var(--code-bg);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prose pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  line-height: 1.5;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose blockquote {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-size: 15px;
}

.prose blockquote p {
  margin: 0;
}

.prose blockquote p + p {
  margin-top: 8px;
}

.prose blockquote strong:first-child {
  color: var(--brand-strong);
}

.toc {
  margin: 0 0 28px;
  padding: 16px 20px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.toc__title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.toc a {
  color: var(--accent);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--code-bg);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

.related {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.related h2 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 16px;
}

.related ul {
  margin: 0;
  padding-left: 18px;
}

.related li {
  margin-bottom: 6px;
}

/* -------------------------------------------------------------- erro/footer */

.error-page {
  padding: 96px 0;
  text-align: center;
}

.error-page__code {
  margin: 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.03em;
}

.error-page h1 {
  margin: 0 0 24px;
  font-weight: 600;
  font-size: 22px;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
  font-size: 14px;
}

.footer p {
  margin: 0;
}

.footer__links a {
  color: var(--muted);
}

.footer__links a:hover {
  color: var(--brand);
}

/* ---------- Tela de login ---------- */

.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  font-family: var(--font);
  color: var(--text);
}

.login-screen {
  width: 100%;
  padding: 24px;
}

.login-card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.login-brand {
  margin: 0 0 32px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.login-brand__name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.login-brand__badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.login-heading {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.login-subtext {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.login-button-wrap {
  display: flex;
  justify-content: center;
}

.login-warning {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}

.login-error {
  min-height: 20px;
  margin: 16px 0 0;
  color: #c0392b;
  font-size: 13px;
}

/*
 * Para usar a fonte oficial da marca em vez do substituto Poppins, adicione
 * os arquivos licenciados em /public/fonts e troque a variavel --font acima
 * por 'GreycliffCF', preservando o fallback:
 *
 * @font-face {
 *   font-family: 'GreycliffCF';
 *   src: url('/static/fonts/GreycliffCF-Regular.woff2') format('woff2');
 *   font-weight: 400;
 *   font-display: swap;
 * }
 * @font-face {
 *   font-family: 'GreycliffCF';
 *   src: url('/static/fonts/GreycliffCF-DemiBold.woff2') format('woff2');
 *   font-weight: 600;
 *   font-display: swap;
 * }
 */
