/* ─────────────────────────────────────────────────────────────
   Assina Oficial — Central de Ajuda
   Layout estilo Intercom: hero com busca, coleções, artigo limpo
   ───────────────────────────────────────────────────────────── */

:root {
  --primary: #3d5a40;
  --primary-hover: #2f4632;
  --primary-light: #4e7352;
  --bg: #f8fafc;
  --card: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #ca8a04;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Modo escuro manual via classe */
body.dark {
  --bg: #111827;
  --card: #1f2937;
  --text-dark: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #374151;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Header ─── */
.help-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

body.dark .help-header {
  background: rgba(31, 41, 55, 0.9);
}

.help-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.help-brand svg {
  width: 28px;
  height: 28px;
}

.help-brand span.muted {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 15px;
}

@media (max-width: 640px) {
  .help-brand span.muted {
    display: none;
  }
}

.help-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.help-header-actions a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.help-header-actions a:hover {
  color: var(--primary);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: 9999px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.theme-toggle button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 9999px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.theme-toggle button svg {
  width: 16px;
  height: 16px;
}

/* ─── Hero (faixa verde com busca, estilo Intercom) ─── */
.help-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 64px 24px;
  text-align: center;
}

.help-hero-slim {
  padding: 28px 24px;
}

.help-hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.help-hero h1 {
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
}

.help-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 17px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .help-hero {
    padding: 40px 20px;
  }

  .help-hero h1 {
    font-size: 26px;
  }
}

/* ─── Busca (input + dropdown de resultados) ─── */
.help-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.help-search input {
  width: 100%;
  padding: 15px 18px 15px 48px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  color: #1f2937;
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow-md);
}

.help-search input::placeholder {
  color: #9ca3af;
}

.help-search input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), var(--shadow-md);
}

.help-search svg {
  position: absolute;
  left: 18px;
  top: 25px;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: #9ca3af;
  pointer-events: none;
}

.help-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 60;
  max-height: 380px;
  overflow-y: auto;
}

.help-search-results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.help-search-results a:last-child {
  border-bottom: none;
}

.help-search-results a:hover,
.help-search-results a.active {
  background: rgba(61, 90, 64, 0.08);
  text-decoration: none;
}

.help-search-results a strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.help-search-results a span {
  font-size: 12px;
  color: var(--text-muted);
}

.help-search-empty {
  padding: 20px 16px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Main / Containers ─── */
.help-main {
  flex: 1;
  padding: 40px 24px 64px;
}

.help-container {
  max-width: 1000px;
  margin: 0 auto;
}

.help-container-narrow {
  max-width: 720px;
  margin: 0 auto;
}

/* ─── Grid de coleções (home) ─── */
.help-collections {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
}

@media (min-width: 640px) {
  .help-collections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .help-collections {
    grid-template-columns: repeat(3, 1fr);
  }
}

.help-collection-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.help-collection-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.help-collection-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
}

.help-collection-card:hover h3 {
  color: var(--primary);
}

.help-collection-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.help-collection-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(61, 90, 64, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark .help-collection-icon {
  background: rgba(255, 255, 255, 0.08);
}

.help-collection-icon svg {
  width: 22px;
  height: 22px;
}

.help-collection-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ─── Página de coleção ─── */
.help-collection-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.help-collection-head h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 4px;
}

.help-collection-head p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ─── Lista de artigos (coleção e relacionados) ─── */
.help-article-list {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.help-article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.help-article-item:last-child {
  border-bottom: none;
}

.help-article-item:hover {
  background: rgba(61, 90, 64, 0.05);
  text-decoration: none;
}

body.dark .help-article-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.help-article-item-text h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.help-article-item:hover .help-article-item-text h3 {
  color: var(--primary);
}

.help-article-item-text p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.help-article-item > svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ─── Breadcrumb ─── */
.help-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.help-breadcrumb a {
  color: var(--text-muted);
}

.help-breadcrumb a:hover {
  color: var(--primary);
}

/* ─── Artigo ─── */
.help-article h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.25;
  color: var(--text-dark);
}

.help-article h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.help-article h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.help-article p {
  margin-bottom: 16px;
  color: var(--text-dark);
}

.help-article ul,
.help-article ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.help-article li {
  margin-bottom: 8px;
}

.help-article strong {
  font-weight: 600;
}

.help-article blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(61, 90, 64, 0.05);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
  color: var(--text-dark);
}

body.dark .help-article blockquote {
  background: rgba(255, 255, 255, 0.05);
}

.help-article img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 24px 0;
}

.help-figure {
  margin: 24px 0;
}

.help-figure img {
  margin: 0 0 8px;
}

.help-figure figcaption {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Feedback ("Este artigo foi útil?") ─── */
.help-feedback {
  margin-top: 48px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.help-feedback h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.help-feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.help-feedback-buttons button {
  font-size: 22px;
  line-height: 1;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.help-feedback-buttons button:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

.help-feedback-thanks {
  font-size: 15px;
  color: var(--success);
  font-weight: 500;
}

.help-feedback-form p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ─── Relacionados / Próximos passos ─── */
.help-related {
  margin-top: 40px;
}

.help-related h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
}

/* ─── Box de suporte ─── */
.help-support {
  margin-top: 40px;
  background: rgba(61, 90, 64, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

body.dark .help-support {
  background: rgba(255, 255, 255, 0.04);
}

.help-support h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.help-support p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.help-btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
  color: #fff;
}

/* ─── Footer ─── */
.help-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 24px;
}

.help-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .help-footer-inner {
    flex-direction: row;
  }
}

/* ─── Utilidades ─── */
.help-hidden {
  display: none !important;
}
