/* =============================================================================
   Página pública de tutoriais (/tutoriais) — estilos.
   Paleta clara BearFast (branco/creme/laranja, cantos retos). Sem CDNs, sem
   fontes externas (fallback para a fonte do sistema), sem trackers (Req 2.7, 8.3).
   ========================================================================== */
:root {
  --bg: #ffffff;
  --panel: #faf8f2;
  --panel2: #f5f0e8;
  --panel3: #efe6d3;
  --border: rgba(17,17,17,.13);
  --border2: rgba(17,17,17,.24);
  --text: #111111;
  --muted: #5c5850;
  --muted2: #847f74;
  --accent: #f94e03;
  --accent2: #d84102;
  --code-bg: #0c0c0c;
  --ok: #4caf7d;
  --info: #5b8fd6;
  --warn: #d9a441;
  --radius: 0px;
  --radius-sm: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

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

.tut-num { font-variant-numeric: tabular-nums; }

/* ----- Cabeçalho fixo ---------------------------------------------------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
header.top .brand { font-weight: 700; font-size: 18px; }
header.top .brand span { color: var(--accent); }
header.top .spacer { flex: 1; }
header.top a.btn {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
header.top a.btn:hover { background: var(--accent2); text-decoration: none; }
header.top a.btn.ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
}
header.top a.btn.ghost:hover { background: var(--panel2); }

/* ----- Layout ------------------------------------------------------------ */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 80px; }

.hero {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 30px 32px;
  margin-bottom: 24px;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; }
.hero p { color: var(--muted); margin: 0; max-width: 760px; }

.app-download {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(249, 78, 3, .32);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.app-download-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(249, 78, 3, .32);
  color: var(--accent2);
  background: rgba(249, 78, 3, .08);
}
.app-download-icon svg { width: 23px; height: 23px; }
.app-download-copy { min-width: 0; }
.app-download-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.app-download-title h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.app-download-title span { padding: 2px 7px; border: 1px solid var(--border2); border-radius: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.app-download-copy p { margin: 5px 0 3px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.app-download-copy small { color: var(--muted2); font-size: 11.5px; }
.app-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.app-download-button:hover { background: var(--accent2); color: #fff; text-decoration: none; }
.app-download-button svg { width: 17px; height: 17px; }

/* ----- Barra de ferramentas (busca + filtros) ---------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}
.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 40px;
  font-size: 15px;
  outline: none;
}
.search input:focus-visible { border-color: var(--accent); }
.search input::placeholder { color: var(--muted2); }
.search .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted2);
  display: inline-flex;
  pointer-events: none;
}
.search .ic svg { width: 18px; height: 18px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  background: var(--panel);
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 0;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filters button:hover { color: var(--text); border-color: var(--border2); }
.filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filters button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ----- Grade de cartões -------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.tool-card .head { display: flex; align-items: flex-start; gap: 12px; }
.tool-card .icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--panel3);
  color: var(--accent2);
  display: grid;
  place-items: center;
}
.tool-card .icon svg { width: 24px; height: 24px; }
.tool-card .title { flex: 1; min-width: 0; }
.tool-card .title h3 { margin: 0; font-size: 17px; }
.tool-card .title .desc { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 9px;
  border-radius: 0;
  white-space: nowrap;
}
.badge.ok { background: rgba(76, 175, 125, .16); color: var(--ok); }
.badge.info { background: rgba(91, 143, 214, .16); color: var(--info); }
.badge.warn { background: rgba(217, 164, 65, .16); color: var(--warn); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 8px;
}

.tool-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}
.tool-card .mins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted2);
  font-size: 12.5px;
}
.tool-card .mins svg { width: 15px; height: 15px; }

.btn-see {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-see:hover { background: var(--accent2); }
.btn-see:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ----- Modal de passos --------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .68);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 0;
  width: 100%;
  max-width: 640px;
  margin: auto 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal .m-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal .m-head .icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--panel3);
  color: var(--accent2);
  display: grid;
  place-items: center;
}
.modal .m-head .icon svg { width: 24px; height: 24px; }
.modal .m-head h2 { margin: 0; font-size: 20px; }
.modal .m-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal .m-head .grow { flex: 1; min-width: 0; }
.modal .m-close {
  flex: 0 0 auto;
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 0;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal .m-close:hover { color: var(--text); }
.modal .m-body { padding: 18px 24px 24px; }

.step { display: flex; gap: 12px; margin: 0 0 18px; }
.step:last-child { margin-bottom: 0; }
.step .n {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.step .b { flex: 1; min-width: 0; }
.step .b .s-title { font-weight: 600; margin: 3px 0 6px; }
.step .b p { margin: 0; color: var(--muted); font-size: 14px; }

.codeblock {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
  margin: 8px 0 0;
  overflow: auto;
}
.codeblock pre {
  margin: 0;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e0e0e0;
}
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 0;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
}
.copy:hover { color: var(--text); }

/* ----- FAQ accordion ----------------------------------------------------- */
.section { margin-top: 44px; }
.section > h2 { font-size: 22px; margin: 0 0 4px; }
.section > .sub { color: var(--muted); margin: 0 0 18px; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-q:hover { background: var(--panel2); }
.faq-q:focus-visible { outline: 2px solid var(--accent2); outline-offset: -2px; }
.faq-q .chev {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform .2s;
}
.faq-q[aria-expanded="true"] .chev { transform: rotate(180deg); }
.faq-q .chev svg { width: 18px; height: 18px; display: block; }
.faq-a {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 14px;
}
.faq-a[hidden] { display: none; }

/* ----- Bloco de suporte -------------------------------------------------- */
.support {
  margin-top: 40px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 28px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.support .grow { flex: 1 1 320px; min-width: 0; }
.support h2 { margin: 0 0 6px; font-size: 20px; }
.support p { margin: 0; color: var(--muted); }
.support .actions { display: flex; flex-wrap: wrap; gap: 10px; }

footer {
  text-align: center;
  color: var(--muted);
  padding: 36px 20px 0;
  font-size: 13px;
}
footer a { margin: 0 6px; }

/* ----- Responsivo -------------------------------------------------------- */
@media (max-width: 640px) {
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 25px; }
  .app-download { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .app-download-button { grid-column: 1 / -1; width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 16px 10px; }
}

/* ----- Acessibilidade: movimento reduzido -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .tool-card:hover { transform: none; }
}
