/*
 * Site institucional do cotaCar (cotacar.app.br).
 * Tokens: os mesmos do app (apps/mobile/src/lib/tema.tsx) e da identidade visual do vault.
 * Regra da marca: nunca o mesmo hex nos dois temas, sem gradiente, separação por borda.
 */

:root {
  color-scheme: light dark;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-muted: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #7C8AA0;
  --text: #0F172A;
  --text-muted: #475569;
  --brand: #0F172A;
  --primary: #047857;
  --primary-hover: #065F46;
  --on-primary: #FFFFFF;
  --primary-soft: #ECFDF5;
  --success-border: #A7F3D0;
  --warning: #B45309;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;
  --info: #1D4ED8;
  --info-soft: #EFF6FF;
  --info-border: #BFDBFE;

  --font-title: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius-control: 6px;
  --radius-card: 12px;
  --page: 1180px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #111A2E;
    --surface-muted: #0E1626;
    --border: #1E293B;
    --border-strong: #64748B;
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --brand: #F8FAFC;
    --primary: #34D399;
    --primary-hover: #6EE7B7;
    --on-primary: #0B1220;
    --primary-soft: #052E24;
    --success-border: #065F46;
    --warning: #FBBF24;
    --warning-soft: #291F0B;
    --warning-border: #5C4410;
    --info: #60A5FA;
    --info-soft: #0F1D35;
    --info-border: #1E3A66;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--brand);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 10px 14px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo .estrada { stroke: var(--primary); }
.logo .faixa { stroke: var(--surface); }
.logo .carro { fill: var(--brand); }
.wordmark {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--brand);
  line-height: 1;
}
.wordmark span { color: var(--primary); }

/* Cabeçalho */
.topo { border-bottom: 1px solid var(--border); background: var(--bg); }
.topo .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.topo nav ul { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.topo nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.topo nav a:not(.btn):hover { color: var(--primary); }
.topo .so-largo { display: none; }
@media (min-width: 820px) { .topo .so-largo { display: list-item; } }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primario { background: var(--primary); color: var(--on-primary); }
.btn-primario:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secundario { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secundario:hover { color: var(--text); border-color: var(--text); }
.btn-pequeno { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; }
.acoes { display: flex; flex-wrap: wrap; gap: 12px; }

/* Seções */
main > section { padding: 72px 0; border-top: 1px solid var(--border); }
main > section:first-child { border-top: 0; }
@media (min-width: 960px) { main > section { padding: 96px 0; } }
.intro { max-width: 660px; }
.intro p { color: var(--text-muted); font-size: 1.0625rem; margin-top: 14px; }

/* Hero */
main > .hero { padding-top: 56px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
.hero .texto p { font-size: 1.125rem; color: var(--text-muted); margin-top: 20px; max-width: 34em; }
.hero .acoes { margin-top: 32px; }
@media (min-width: 1040px) {
  .hero .wrap { grid-template-columns: 4fr 6fr; gap: 56px; }
}

/* Telas ilustrativas */
.tela {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.tela-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.tela-barra strong { font-family: var(--font-title); font-size: 0.9375rem; color: var(--brand); }
.tela-barra span { color: var(--text-muted); }
.tela-corpo { padding: 16px; }
.legenda { margin-top: 10px; font-size: 0.8125rem; color: var(--text-muted); }

/* Pátio */
.patio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--surface-muted); }
.tela { container-type: inline-size; }
@container (min-width: 600px) { .patio { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.coluna h3 { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 8px; letter-spacing: 0; }
.coluna h3 .qtd { margin-left: auto; color: var(--text-muted); font-weight: 500; }
.ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ponto.info { background: var(--info); }
.ponto.alerta { background: var(--warning); }
.ponto.primaria { background: var(--primary); }
.ponto.texto { background: var(--text); }
.cartao-os {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.cartao-os b { display: block; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.cartao-os span { display: block; color: var(--text-muted); font-size: 0.75rem; }

/* Selos de status, sempre com texto */
.selo {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.selo.alerta { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-border); }
.selo.info { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.selo.ok { color: var(--primary); background: var(--primary-soft); border-color: var(--success-border); }

/* Problema */
.dores { list-style: none; padding: 0; margin: 40px 0 0; }
.dores li {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
}
.dores li:last-child { border-bottom: 1px solid var(--border); }
.dores q { font-family: var(--font-title); font-weight: 600; font-size: 1.1875rem; color: var(--brand); }
.dores span { color: var(--text-muted); }
@media (min-width: 860px) {
  .dores li { grid-template-columns: 2fr 3fr; gap: 40px; align-items: baseline; }
}

/* Passos */
.passos { list-style: none; padding: 0; margin: 48px 0 0; display: grid; gap: 32px; counter-reset: passo; }
.passos li { counter-increment: passo; padding-top: 20px; border-top: 2px solid var(--brand); }
.passos li::before {
  content: counter(passo);
  display: block;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.passos p { color: var(--text-muted); margin-top: 8px; }
@media (min-width: 860px) { .passos { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* Recursos com tela */
.recurso { display: grid; gap: 28px; align-items: start; padding: 48px 0; border-top: 1px solid var(--border); }
.intro + .recurso { margin-top: 40px; }
.recurso .texto p { color: var(--text-muted); margin-top: 10px; }
.recurso .texto ul { margin: 14px 0 0; padding-left: 18px; color: var(--text-muted); }
.recurso .texto li { margin-top: 4px; }
@media (min-width: 960px) {
  .recurso { grid-template-columns: 2fr 3fr; gap: 56px; }
  .recurso.inverte .texto { order: 2; }
}

/* Itens do orçamento */
.itens { width: 100%; border-collapse: collapse; }
.itens th, .itens td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.itens thead th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; }
.itens .valor { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.itens .grupo th { padding-top: 12px; font-weight: 600; color: var(--text); }
.itens .subtotal td { color: var(--text-muted); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; }
.total b { font-family: var(--font-title); font-size: 1.25rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* Fotos ilustrativas (sem imagem real) */
.fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.foto {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.linha { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.linha:last-child { border-bottom: 0; }
.linha > span:first-child { color: var(--text-muted); }
.linha > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.aviso {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--success-border);
  color: var(--text);
}

/* Agenda */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agenda li:last-child { border-bottom: 0; }
.agenda time { font-variant-numeric: tabular-nums; font-weight: 600; }
.agenda .vago { color: var(--text-muted); }

/* Link do cliente */
.cliente-link { max-width: 400px; }
.endereco {
  display: block;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.botao-falso {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-control);
  font-weight: 600;
  margin-top: 10px;
}
.botao-falso.cheio { background: var(--primary); color: var(--on-primary); }
.botao-falso.vazio { border: 1px solid var(--border-strong); color: var(--text); }

/* Duas colunas */
.duas { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .duas { grid-template-columns: 1fr 1fr; gap: 64px; } }
.lista-simples { list-style: none; margin: 24px 0 0; padding: 0; }
.lista-simples li { padding: 14px 0; border-top: 1px solid var(--border); }
.lista-simples li:last-child { border-bottom: 1px solid var(--border); }
.lista-simples b { display: block; color: var(--text); }
.lista-simples span { color: var(--text-muted); }

/* Papéis */
.papeis { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.papeis th, .papeis td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.papeis thead th { color: var(--text-muted); font-weight: 600; font-size: 0.8125rem; }
.papeis td { color: var(--text-muted); }
.papeis tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }

/* Pessoas */
.pessoas { display: grid; gap: 24px; margin-top: 32px; }
@media (min-width: 720px) { .pessoas { grid-template-columns: 1fr 1fr; } }
.pessoa { border-left: 2px solid var(--primary); padding-left: 16px; }
.pessoa b { display: block; font-family: var(--font-title); color: var(--brand); font-size: 1.0625rem; }
.pessoa span { color: var(--text-muted); }
.empresa { margin-top: 28px; color: var(--text-muted); max-width: 40em; }

/* Preço */
.preco {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 24px;
}
.preco strong { font-family: var(--font-title); font-size: 1.25rem; color: var(--text); display: block; }
.preco p + p { margin-top: 10px; color: var(--text-muted); }

/* Perguntas */
.faq { margin-top: 32px; border-top: 1px solid var(--border); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 40px 18px 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 24px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 29px; }
.faq details p { padding: 0 0 18px; color: var(--text-muted); max-width: 680px; }

/* Faixa do motorista */
main > .motorista { background: var(--surface-muted); }
.motorista .wrap { display: grid; gap: 24px; align-items: end; }
.motorista p { color: var(--text-muted); margin-top: 12px; max-width: 40em; }
@media (min-width: 900px) { .motorista .wrap { grid-template-columns: 3fr 1fr; } .motorista .acoes { justify-content: flex-end; } }

/* Chamado final */
.final p { color: var(--text-muted); margin-top: 12px; max-width: 36em; }
.final .acoes { margin-top: 28px; }

/* Rodapé */
.rodape { border-top: 1px solid var(--border); padding: 40px 0 48px; font-size: 0.875rem; color: var(--text-muted); }
.rodape .wrap { display: grid; gap: 20px; }
.rodape p + p { margin-top: 4px; }
.rodape ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.rodape a { color: var(--text); }
.rodape a:hover { color: var(--primary); }
@media (min-width: 860px) { .rodape .wrap { grid-template-columns: 1fr auto; align-items: start; } }

/* Páginas de texto (termos e privacidade) */
.documento { padding: 48px 0 80px; }
.documento .wrap { max-width: calc(760px + var(--gutter) * 2); }
.documento h1 { font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem); }
.documento .versao { margin-top: 12px; color: var(--text-muted); font-size: 0.9375rem; }
.documento h2 { font-size: 1.375rem; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.documento h3 { margin-top: 28px; }
.documento p, .documento ul, .documento ol { margin-top: 14px; }
.documento li { margin-top: 6px; }
.documento .resumo {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
}
.documento .resumo > :first-child { margin-top: 0; }
.documento nav ol { padding-left: 20px; }
.tabela-rolagem { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; }
.documento table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; min-width: 600px; }
.documento th, .documento td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.documento thead th { background: var(--surface-muted); font-weight: 600; }
.documento tbody tr:last-child > * { border-bottom: 0; }

/* 404 */
.nao-achou { padding: 96px 0; }
.nao-achou p { color: var(--text-muted); margin-top: 14px; max-width: 32em; }
.nao-achou .acoes { margin-top: 28px; }

/* Utilitários */
figure { margin: 0; }
.muted { color: var(--text-muted); }
.espaco-4 { margin-top: 4px; }
.espaco-8 { margin-top: 8px; }
