/* ============================================================
   Manual Groupz — folha de estilos
   Inspirado na identidade visual do sistema Groupz (groupz.shop)
   ============================================================ */

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --secondary: #0f172a;
  --accent: #22c55e;
  --background: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --border-radius: 10px;
  --border-radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --sidebar-width: 300px;
  --header-height: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Skip link (acessibilidade) ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 60;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: -2px; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  cursor: pointer;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background: var(--background);
  font-size: 14px;
  font-family: var(--font);
}
.topbar-search input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  background: var(--surface);
}
.topbar-search .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  z-index: 70;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--primary-light); text-decoration: none; }
.search-results .sr-title { font-weight: 600; font-size: 14px; }
.search-results .sr-module { font-size: 12px; color: var(--muted); }
.search-empty { padding: 16px; color: var(--muted); font-size: 14px; }

.topbar-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap;
}
.badge-version {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12px;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px 60px;
  z-index: 50;
}

.nav-group { margin-bottom: 4px; }
.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 10px 6px;
  cursor: pointer;
}
.nav-group-title .chev { transition: transform .2s ease; font-size: 10px; }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-links { display: none; }

.nav-links { list-style: none; margin: 0; padding: 0; }
.nav-links li a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  margin: 2px 0;
}
.nav-links li a:hover { background: var(--background); text-decoration: none; }
.nav-links li a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: 20px;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  z-index: 45;
}

/* ---------- Main content ---------- */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 32px 40px 100px;
  max-width: 980px;
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  margin-bottom: 32px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15);
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: 34px; margin: 0 0 8px; font-weight: 800; }
.hero p { font-size: 16px; opacity: .92; max-width: 560px; margin: 0 0 22px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; opacity: .85; }

.quick-search {
  margin-top: 22px;
  position: relative;
  max-width: 480px;
}
.quick-search input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border-radius: var(--border-radius);
  border: none;
  font-size: 14px;
  font-family: var(--font);
}
.quick-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.module-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.module-icon {
  width: 40px; height: 40px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.module-card h3 { margin: 0 0 6px; font-size: 16px; }
.module-card p { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.module-card a { font-size: 13.5px; font-weight: 600; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { margin: 0 6px; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

/* ---------- Manual sections ---------- */
.manual-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.manual-section h2 {
  font-size: 24px;
  margin: 0 0 6px;
}
.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.description { color: var(--muted); font-size: 15px; margin: 0 0 16px; }

.navigation-path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--background);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 22px;
  font-weight: 500;
}

/* status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
.status-verificado { background: var(--success-bg); color: var(--success); }
.status-parcial { background: var(--warning-bg); color: var(--warning); }
.status-inferido { background: var(--info-bg); color: var(--info); }
.status-nao-testado { background: #f3f4f6; color: var(--muted); }

/* steps */
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 26px;
  align-items: flex-start;
}
.step-number {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.step-content { flex: 1; min-width: 0; }
.step-content h3 { margin: 2px 0 6px; font-size: 16px; }
.step-content p { margin: 0 0 10px; font-size: 14.5px; }
.step-content kbd {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: monospace;
}

.step-image {
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  max-width: 720px;
  background: var(--background);
}
.step-image img { width: 100%; display: block; aspect-ratio: 1568 / 760; object-fit: cover; }

.result-box {
  background: var(--success-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--border-radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--primary-dark);
  margin-top: 6px;
}
.result-box strong { display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* callouts */
.callout {
  border-radius: var(--border-radius);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 14px;
  border: 1px solid transparent;
  display: flex;
  gap: 10px;
}
.callout .callout-icon { flex-shrink: 0; font-size: 16px; }
.callout.info { background: var(--info-bg); color: #1e3a8a; border-color: #bfdbfe; }
.callout.tip { background: var(--success-bg); color: var(--primary-dark); border-color: #bbf7d0; }
.callout.warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.callout.danger { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }

/* cards de módulo dentro da seção */
.mini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; margin: 18px 0; }
.mini-card { border: 1px solid var(--border); border-radius: var(--border-radius); padding: 16px; background: var(--background); }
.mini-card h4 { margin: 0 0 6px; font-size: 14.5px; }
.mini-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--border-radius); }
table.field-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.field-table th, table.field-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.field-table th { background: var(--background); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.field-table tr:last-child td { border-bottom: none; }
.req-yes { color: var(--danger); font-weight: 700; }
.req-no { color: var(--muted); }

/* nav between pages */
.section-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}
.section-pagination a { display: flex; align-items: center; gap: 6px; }

/* back to top */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  z-index: 55;
}
.back-to-top.show { display: flex; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.85);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lightbox-close {
  position: absolute; top: 20px; right: 26px;
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; cursor: pointer;
}
.lightbox-caption { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: .85; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; text-align: left;
  background: none; border: none;
  font-family: var(--font);
  padding: 16px 4px;
  font-size: 15px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; color: var(--text);
}
.faq-question .chev { transition: transform .2s ease; color: var(--muted); }
.faq-item.open .faq-question .chev { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .25s ease; font-size: 14.5px; color: var(--muted); }
.faq-item.open .faq-answer { max-height: 400px; padding-bottom: 16px; }

/* footer */
.page-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

/* status legend */
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.legend span { font-size: 12.5px; }

/* responsive */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-md);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; padding: 24px 18px 90px; }
  .menu-toggle { display: flex; }
  .topbar-search { display: none; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 26px; }
  .manual-section { padding: 20px; }
}

@media (max-width: 600px) {
  .topbar-meta span:not(:first-child) { display: none; }
  table.field-table { min-width: 420px; }
  .module-grid { grid-template-columns: 1fr; }
  .mini-cards { grid-template-columns: 1fr; }
  .hero-meta { flex-direction: column; gap: 6px; }
}
