/* ==========================================================
   Wikipédia UseLoja — wiki.useloja.com.br
   Identidade visual USE Loja Brasil
   ========================================================== */

:root {
  --navy: #0a2d66;
  --navy-dark: #061a3f;
  --green: #37c400;
  --lime: #c4cf28;
  --ice: #f4fafc;
  --cyan: #caf0f8;
  --line: rgba(10, 45, 102, 0.18);
  --radius: 20px;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Poppins", "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--navy-dark);
  background: var(--ice);
}

[hidden] { display: none !important; }

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

a { color: var(--navy); }

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding-inline: 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  background: var(--green);
  color: var(--navy);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 100;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

/* ---------------- Cabeçalho ---------------- */
.site-header {
  background:
    radial-gradient(ellipse at top right, rgba(55, 196, 0, 0.34) 0%, rgba(10, 45, 102, 0) 46%),
    var(--navy);
  color: var(--ice);
  padding: 28px 0 56px;
}

.brand { display: inline-block; margin-bottom: 36px; }
.brand img { display: block; width: 120px; height: auto; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.82px;
  text-transform: uppercase;
  color: var(--lime);
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(38px, 8vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.site-header h1 span { color: var(--lime); }

.subtitle {
  margin: 20px 0 32px;
  max-width: 640px;
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.6;
  color: var(--cyan);
}

/* ---------------- Busca ---------------- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--ice);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(6, 26, 63, 0.35);
  max-width: 720px;
}
.search-icon {
  position: absolute;
  left: 22px;
  color: var(--navy);
  pointer-events: none;
}
.search-box input {
  flex: 1;
  width: 100%;
  border: 0;
  background: transparent;
  font: 500 18px/1.2 var(--font-body);
  color: var(--navy-dark);
  padding: 20px 56px 20px 58px;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::placeholder { color: rgba(6, 26, 63, 0.55); }
.search-box input:focus { outline: none; }
.search-box:focus-within { box-shadow: 0 0 0 4px var(--green), 0 18px 40px rgba(6, 26, 63, 0.35); }
.search-box input::-webkit-search-cancel-button { display: none; }

.clear-btn {
  position: absolute;
  right: 12px;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--ice);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.clear-btn:hover { background: var(--navy-dark); }

/* ---------------- Filtros ---------------- */
.main { padding-block: 40px 72px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.chip {
  font: 700 15px/1.2 var(--font-body);
  color: var(--navy);
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.chip:hover { background: var(--cyan); }
.chip:active { transform: scale(.97); }
.chip.is-active {
  background: var(--navy);
  color: var(--ice);
}

.result-count {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(6, 26, 63, 0.75);
  min-height: 1.5em;
}

.empty {
  background: var(--cyan);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
}
.empty p { margin: 0; }
.empty-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 6px !important;
}

/* ---------------- Categorias ---------------- */
.category { margin-bottom: 48px; }

.category h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.cat-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--navy);
  font-size: 18px;
}

/* ---------------- Sanfona ---------------- */
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  scroll-margin-top: 24px;
  transition: border-color .2s, box-shadow .25s;
}
.faq-item.is-open {
  border-color: var(--navy);
  box-shadow: 0 14px 32px rgba(6, 26, 63, 0.12);
}
.faq-item.is-flash { animation: flash 1.8s ease; }

@keyframes flash {
  0%, 60% { box-shadow: 0 0 0 4px var(--green); }
  100% { box-shadow: 0 14px 32px rgba(6, 26, 63, 0.12); }
}

.faq-q { margin: 0; font: inherit; }

.faq-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--navy);
}
.faq-btn:hover .faq-title { text-decoration: underline; text-underline-offset: 4px; }

.faq-num {
  flex: none;
  min-width: 46px;
  padding: 5px 0;
  text-align: center;
  border-radius: 999px;
  background: var(--navy);
  color: var(--ice);
  font: 700 14px/1.2 var(--font-body);
  letter-spacing: 0.5px;
}
.faq-title { flex: 1; }

.faq-icon {
  flex: none;
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cyan);
  transition: background .25s, transform .3s;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 2.5px;
  background: var(--navy);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform .3s, opacity .3s;
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.is-open .faq-icon { background: var(--green); }
.is-open .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Painel: abre e fecha suavemente (grid 0fr -> 1fr) */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .35s ease, visibility 0s linear .35s;
}
.is-open .faq-panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows .35s ease, visibility 0s;
}
.faq-panel-inner { overflow: hidden; min-height: 0; }

.faq-body { padding: 4px 22px 24px 22px; }

.faq-content {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 17px;
}
.faq-content p { margin: 0 0 14px; }
.faq-content ol, .faq-content ul { margin: 0 0 16px; padding-left: 26px; }
.faq-content li { margin-bottom: 9px; padding-left: 4px; }
.faq-content li::marker { color: var(--navy); font-weight: 700; }
.faq-content li > ul, .faq-content li > ol { margin: 9px 0 4px; }
.faq-content > :last-child { margin-bottom: 0; }

.faq-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--cyan);
  color: var(--navy);
  padding: 2px 7px;
  border-radius: 6px;
  word-break: break-word;
}

.tip {
  background: var(--cyan);
  border-left: 5px solid var(--green);
  border-radius: 12px;
  padding: 14px 18px;
}

/* Rodapé de cada resposta: tags + copiar link */
.faq-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.faq-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tags-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(6, 26, 63, 0.7);
}
.faq-tags ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.faq-tags li {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ice);
  border: 1px solid var(--line);
  color: var(--navy);
}

.copy-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 14px/1 var(--font-body);
  color: var(--navy);
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.copy-link::before {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.1 0l3-3a5 5 0 0 0-7.1-7.1l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.1 0l-3 3A5 5 0 0 0 11 21.1l1.7-1.7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.1 0l3-3a5 5 0 0 0-7.1-7.1l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.1 0l-3 3A5 5 0 0 0 11 21.1l1.7-1.7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.copy-link:hover { background: var(--cyan); }
.copy-link.is-copied { background: var(--green); border-color: var(--green); color: var(--navy); }

/* Destaque da busca */
mark.hl {
  background: var(--lime);
  color: var(--navy-dark);
  border-radius: 4px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------------- CTA de ajuda ---------------- */
.help-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding: 40px;
  border-radius: 28px;
  color: var(--ice);
  background:
    radial-gradient(ellipse at top right, rgba(55, 196, 0, 0.38) 0%, rgba(10, 45, 102, 0) 55%),
    var(--navy);
}
.help-cta h2 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.15;
}
.help-cta p { margin: 0; color: var(--cyan); }

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-whats {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 190px;
  text-align: center;
  text-decoration: none;
  color: var(--navy);
  background: var(--green);
  border-radius: 999px;
  padding: 16px 30px;
  transition: background .2s;
}
.btn-whats:hover { background: var(--lime); }
.btn-label { font: 700 18px/1 var(--font-body); }
.btn-number { font: 500 15px/1 var(--font-body); }

/* ---------------- Rodapé ---------------- */
.site-footer {
  background: var(--navy-dark);
  color: var(--cyan);
  padding: 28px 0;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--cyan); }

/* ---------------- Aviso (toast) ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--navy-dark);
  color: var(--ice);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(6, 26, 63, 0.35);
  z-index: 50;
  max-width: calc(100% - 32px);
  text-align: center;
  animation: toast-in .25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding-inline: 18px; }
  .site-header { padding: 20px 0 40px; }
  .brand { margin-bottom: 28px; }
  .search-box input { font-size: 16px; padding: 18px 52px 18px 52px; }
  .search-icon { left: 18px; }

  .main { padding-block: 28px 56px; }

  /* filtros em linha com rolagem horizontal no celular */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -18px;
    padding: 4px 18px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; white-space: nowrap; font-size: 14px; padding: 10px 16px; }

  .faq-btn { padding: 16px 16px; gap: 12px; font-size: 16px; }
  .faq-num { min-width: 40px; font-size: 13px; }
  .faq-icon { width: 26px; height: 26px; }
  .faq-body { padding: 2px 16px 20px; }
  .faq-content { font-size: 16px; }
  .faq-content ol, .faq-content ul { padding-left: 22px; }

  .faq-meta { flex-direction: column; align-items: flex-start; }
  .copy-link { width: 100%; justify-content: center; }

  .help-cta { padding: 28px 22px; }
  .cta-actions { width: 100%; flex-direction: column; gap: 12px; }
  .btn-whats { width: 100%; padding: 16px 24px; }
  .btn-label { font-size: 19px; }
  .btn-number { font-size: 16px; }
}

/* ---------------- Preferências do usuário ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .site-header, .filters, .search-box, .copy-link, .help-cta, .toast, .skip-link { display: none !important; }
  .faq-panel { grid-template-rows: 1fr !important; visibility: visible !important; }
  .faq-icon { display: none; }
  .faq-item { break-inside: avoid; box-shadow: none !important; }
  body { background: #fff; }
}
