/* ── Tokens da identidade Ênfase (espelha index.html) ─────────────────── */
:root {
  --md-primary-fg-color:        #174d91;
  --md-primary-fg-color--light: #1e63b8;
  --md-primary-fg-color--dark:  #0d2f5f;
  --md-accent-fg-color:         #10a78f;
  --md-accent-fg-color--transparent: rgba(16, 167, 143, .10);
}

/* Fonte body alinhada ao index.html */
body, .md-typeset {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #102033;
  line-height: 1.55;
}

/* Topbar com o mesmo glassmorphism do index.html */
.md-header {
  background: rgba(23, 77, 145, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}

/* Nav tabs */
.md-tabs {
  background: #0d2f5f;
}
.md-tabs__link--active,
.md-tabs__link:hover {
  color: #10a78f;
}

/* Sidebar */
.md-nav__link--active {
  color: #174d91;
  font-weight: 600;
}

/* ── Badges de status (matriz e-ARQ) ──────────────────────────────────── */
/* Uso: `<span class="badge ok">Completo</span>` em MD com attr_list */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.6;
  vertical-align: middle;
}
.badge.ok       { background: #388e3c; }
.badge.partial  { background: #f59e0b; color: #1a1a1a; }
.badge.missing  { background: #d32f2f; }
.badge.blocker  { background: #e65100; }

/* Admonition de bloqueador jurídico */
.md-typeset .admonition.blocker,
.md-typeset details.blocker {
  border-color: #e65100;
}
.md-typeset .blocker > .admonition-title,
.md-typeset .blocker > summary {
  background: rgba(230, 81, 0, .12);
  color: #e65100;
}
.md-typeset .blocker > .admonition-title::before,
.md-typeset .blocker > summary::before {
  background-color: #e65100;
  -webkit-mask-image: var(--md-admonition-icon--warning);
          mask-image: var(--md-admonition-icon--warning);
}

/* Tabelas — mesma aparência do HTML existente */
.md-typeset table:not([class]) {
  font-size: .82rem;
}
.md-typeset table:not([class]) th {
  background: #e3e6f3;
  color: #0d2f5f;
  font-weight: 700;
}
.md-typeset table:not([class]) tr:nth-child(even) td {
  background: #f4f6fa;
}

/* Links */
.md-typeset a {
  color: #174d91;
}
.md-typeset a:hover {
  color: #10a78f;
}

/* Code inline */
.md-typeset code {
  background: #eef2f8;
  color: #0d2f5f;
  border-radius: 4px;
  padding: 1px 5px;
}

/* Footer */
.md-footer {
  background: #0d2f5f;
}

/* ── Badges de componente (usados nas specs) ──────────────────────────── */

.comp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  margin: 2px 3px 2px 0;
  text-decoration: none !important;
  vertical-align: middle;
}
/* Prefixo "EnfaseCloud." mais fraco, sufixo em negrito */
.comp .ec  { opacity: .55; font-weight: 500; }

.comp.scan    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.comp.webapi  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.comp.library { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.comp.webapp     { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.comp.idp     { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }

/* Bloco de componentes no topo de cada spec */
.spec-components {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  margin: -4px 0 20px 0;
  font-size: 12px;
  color: #64748b;
}
.spec-components::before {
  content: "Componentes afetados:";
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-right: 4px;
  white-space: nowrap;
}

/* Status badge no cabeçalho da spec */
.spec-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  vertical-align: middle;
  margin-left: 8px;
}
.spec-status.draft       { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.spec-status.implemented { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.spec-status.verified    { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.spec-status.accepted    { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* ── Filtro de componentes (landing de specs) ─────────────────────────── */

.spec-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 20px;
}
.spec-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  margin-right: 4px;
  white-space: nowrap;
}
.spec-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}
.spec-filter-btn .ec { opacity: .5; font-weight: 400; }
.spec-filter-btn:hover { border-color: #174d91; color: #174d91; }
.spec-filter-btn.active { background: #174d91; color: #fff; border-color: #174d91; }
.spec-filter-btn.active .ec { opacity: .7; }
.spec-filter-btn[data-comp="scan"].active    { background: #1e40af; border-color: #1e40af; }
.spec-filter-btn[data-comp="webapi"].active  { background: #166534; border-color: #166534; }
.spec-filter-btn[data-comp="library"].active { background: #374151; border-color: #374151; }
.spec-filter-btn[data-comp="webapp"].active     { background: #065f46; border-color: #065f46; }
.spec-filter-btn[data-comp="idp"].active     { background: #5b21b6; border-color: #5b21b6; }
.spec-filter-count {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* ── Cards de spec (índice filtrável) ──────────────────────────────────── */

.spec-list { display: flex; flex-direction: column; gap: 10px; }

.spec-card {
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.spec-card:hover {
  border-color: #174d91;
  box-shadow: 0 2px 12px rgba(23, 77, 145, .08);
}
.spec-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.spec-card-header a {
  font-weight: 700;
  font-size: .95rem;
  color: #0d2f5f !important;
  text-decoration: none !important;
}
.spec-card-header a:hover { color: #174d91 !important; text-decoration: underline !important; }
.spec-card-desc {
  font-size: .82rem;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.45;
}
.spec-card-comps { display: flex; flex-wrap: wrap; gap: 3px; }

/* ── Specs — visual de artefato de engenharia ─────────────────────────── */

/* Tab "⚙ Specs" com cor diferenciada na nav */
.md-tabs__item:last-child .md-tabs__link {
  color: rgba(255,255,255,.7);
  font-style: italic;
}
.md-tabs__item:last-child .md-tabs__link--active,
.md-tabs__item:last-child .md-tabs__link:hover {
  color: #f59e0b;
}

/* Hero da landing de specs */
.spec-hero {
  background: linear-gradient(135deg, #0d2f5f 0%, #174d91 100%);
  color: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 24px;
}
.spec-hero h2 {
  color: #fff;
  margin-top: 0;
  font-size: 1.4rem;
  letter-spacing: .02em;
}
.spec-hero p {
  color: rgba(255,255,255,.85);
  margin-bottom: 0;
  font-size: 1rem;
}

/* Badge de status inline nos títulos das specs */
.md-typeset h1::after,
.md-typeset h2.spec-status::after {
  content: attr(data-status);
  display: inline-block;
  margin-left: 10px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  background: #f59e0b;
  color: #1a1a1a;
}

/* Bloco de requisito formal: Quando X, o sistema deve Y */
.md-typeset li:has(> strong:first-child),
.md-typeset li > p:first-child strong:first-child {
  font-family: ui-monospace, "JetBrains Mono", monospace;
}

/* Code blocks dentro de specs: fundo levemente azulado */
.md-content .md-typeset pre > code {
  background: #f0f4fb;
}

/* Admonition de spec draft */
.md-typeset .admonition.spec,
.md-typeset details.spec {
  border-color: #f59e0b;
}
.md-typeset .spec > .admonition-title,
.md-typeset .spec > summary {
  background: rgba(245, 158, 11, .10);
  color: #92400e;
}

/* Tabela de requisitos dentro de specs — fonte menor para caber */
.md-content [data-md-component="content"] .md-typeset table {
  font-size: .8rem;
}

