/* ============================================================================
   Cidade Simples — site institucional
   Conceito: "Guichê aberto". O site é organizado como um balcão de
   atendimento bem sinalizado: cada bloco responde uma pergunta que o cidadão
   faria ao atendente, com passos numerados, linguagem simples e cada serviço
   marcado pela sua cor (a mesma faixa colorida que o app usa nos cards).

   Paleta e tipografia vêm de constants/colors.ts (tema claro do app) — nenhuma
   cor nova foi inventada aqui.
   ========================================================================= */

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --secondary: #3b82f6;
  --accent: #60a5fa;
  --gradient-start: #2563eb;
  --gradient-end: #3b82f6;

  --navy: #3d4e7c;
  --navy-light: #4a5c8a;

  --teal: #0d7377;
  --teal-light: #e0f4f4;
  --teal-dark: #095455;

  --success: #2d6a4f;
  --success-light: #d8f3dc;
  --warning: #f4a261;
  --warning-light: #fff3e0;
  --danger: #e63946;
  --danger-light: #ffe0e3;

  --white: #ffffff;
  --background: #f5f5f5;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a6a7a;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow: rgba(37, 99, 235, 0.08);
  --splash-bg: #f0f7fa;

  /* Cores dos serviços — mesmas faixas coloridas dos cards do app */
  --service-saude: #0d7377;
  --service-educacao: #00b4d8;
  --service-doc: #f4a261;
  --service-alerta: #e63946;
  --service-extra: #7b2cbf;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

h1 {
  font-size: 40px;
  font-weight: 700;
}

h2 {
  font-size: 28px;
  font-weight: 700;
}

h3 {
  font-size: 20px;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 780px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ── Cabeçalho ───────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  height: 30px;
  width: auto;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.site-nav a:hover {
  background: var(--border-light);
  color: var(--text);
  text-decoration: none;
}

.nav-funcionalidades .site-nav a[data-nav="funcionalidades"],
.nav-manuais .site-nav a[data-nav="manuais"],
.nav-perguntas-frequentes .site-nav a[data-nav="perguntas-frequentes"],
.nav-videos .site-nav a[data-nav="videos"],
.nav-sobre .site-nav a[data-nav="sobre"] {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px !important;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px var(--shadow);
}

.nav-cta:hover {
  background: var(--primary-dark);
  text-decoration: none !important;
}

/* ── Faixa de topo das páginas internas ──────────────────────────────────── */

.page-head {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  padding: 48px 0 56px;
}

.page-head h1 {
  color: #fff;
  max-width: 20ch;
}

.page-head p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  max-width: 62ch;
  margin: 0;
}

.breadcrumb {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Seções e cartões ────────────────────────────────────────────────────── */

.section {
  padding: 64px 0;
}

.section-tint {
  background: var(--splash-bg);
}

.section-white {
  background: var(--white);
}

.section-head {
  max-width: 68ch;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 18px;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 3px var(--shadow);
}

/* Faixa colorida à esquerda — mesma linguagem dos cards de serviço do app */
.card-service {
  border-left: 4px solid var(--primary);
}

.card-service.is-saude {
  border-left-color: var(--service-saude);
}

.card-service.is-educacao {
  border-left-color: var(--service-educacao);
}

.card-service.is-doc {
  border-left-color: var(--service-doc);
}

.card-service.is-alerta {
  border-left-color: var(--service-alerta);
}

.card-service.is-extra {
  border-left-color: var(--service-extra);
}

.card h3 {
  margin-bottom: 8px;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-bottom: 14px;
}

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

.is-saude .card-icon {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.is-educacao .card-icon {
  background: #e0f5fb;
  color: #0077a3;
}

.is-doc .card-icon {
  background: var(--warning-light);
  color: #b5651d;
}

.is-alerta .card-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.is-extra .card-icon {
  background: #f2e8fd;
  color: var(--service-extra);
}

.card-meta {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  font-weight: 500;
}

/* ── Listas ──────────────────────────────────────────────────────────────── */

.list-check {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.list-check li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success-light);
  border: 2px solid var(--success);
}

.list-check strong {
  color: var(--text);
}

/* Passos numerados — mesmo padrão de "passo a passo" do manual */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
  color: var(--text-secondary);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A linha que liga os passos — o "trilho" do guichê */
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.steps > li strong {
  color: var(--text);
}

.steps-teal > li::before {
  background: var(--teal-light);
  color: var(--teal-dark);
}

/* ── Blocos de aviso ─────────────────────────────────────────────────────── */

.callout {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 0 0 20px;
  color: #1e3a8a;
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-warning {
  border-left-color: var(--warning);
  background: var(--warning-light);
  color: #7c4a12;
}

.callout-success {
  border-left-color: var(--success);
  background: var(--success-light);
  color: #1b4332;
}

.callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-light);
  color: #8b1f28;
}

/* ── Botões ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-light {
  background: #fff;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  background: var(--white);
  color: var(--primary-dark);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--border-light);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Índice de letras (glossário): botões compactos que nunca ocupam a linha toda,
   nem no celular. */
.btn-row-chips {
  gap: 8px;
}

.btn-row-chips .btn {
  width: auto;
  min-width: 44px;
  padding: 8px 12px;
  font-size: 15px;
}

/* ── Índice lateral / sumário ────────────────────────────────────────────── */

.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: 88px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.doc-toc h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.doc-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
}

.doc-toc li {
  margin-bottom: 8px;
}

.doc-toc a {
  color: var(--text-secondary);
}

.doc-toc a:hover {
  color: var(--primary-dark);
}

.doc-body h2 {
  scroll-margin-top: 90px;
  margin-top: 40px;
  padding-top: 4px;
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body h3 {
  scroll-margin-top: 90px;
  margin-top: 28px;
  color: var(--navy);
}

.doc-body ul {
  padding-left: 22px;
  color: var(--text-secondary);
}

.doc-body ul li {
  margin-bottom: 8px;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.doc-body th,
.doc-body td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.doc-body th {
  background: var(--border-light);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.doc-body tr:last-child td {
  border-bottom: none;
}

.doc-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 24px;
}

.glossary dl {
  margin: 0;
}

.glossary dt {
  font-weight: 700;
  color: var(--text);
  margin-top: 18px;
}

.glossary dt:first-child {
  margin-top: 0;
}

.glossary dd {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

/* ── Telas do app (screenshots) ──────────────────────────────────────────── */

.shot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 3px var(--shadow);
}

/* As telas do app são muito altas (473×1024). Limitar pela ALTURA — e não pela
   largura do card — evita imagens gigantescas que esticam a página inteira. */
.shot img {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  width: auto;
  max-width: 100%;
  max-height: 400px;
}

.grid-3 .shot img {
  max-height: 340px;
}

.shot figcaption {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

.shot figcaption strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.shot-step {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.video-frame {
  background: #0b1220;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.video-frame video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

/* ── Rodapé ──────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 48px 0 32px;
  font-size: 15px;
}

.site-footer h2 {
  font-size: 15px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.86);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

/* O logotipo tem texto escuro; sobre o azul-marinho do rodapé ele é
   convertido para branco sólido. */
.footer-brand img {
  height: 34px;
  margin-bottom: 14px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--navy-light);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-toc {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
  }

  .site-header .container {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 0;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .section {
    padding: 44px 0;
  }

  .page-head {
    padding: 36px 0 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card-link:hover,
  .btn:hover {
    transform: none;
  }
}
