/* Fontes próprias (Sprint 4D): Barlow 400/600 e Barlow Condensed 600, só latino
   (cobre o português). Licença OFL; arquivos v13 do Google Fonts, guardados
   em /fonts/ para a página não depender do Google nem esperar o CSS deles. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400-v13.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600-v13.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-600-v13.woff2) format('woff2'); }

:root {
  --preto: #0B0B0C;
  --laranja: #F26B21;
  --laranja-forte: #FF7F3A;
  --superficie: #161618;
  --superficie-2: #1F1F22;
  --borda: #2E2E32;
  --texto: #F5F5F7;
  --texto-suave: #A1A1A6;
  --raio: 18px;
  --largura: 640px;
  --titulo: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--preto);
  color: var(--texto);
  font: 400 1.0625rem/1.5 'Barlow', system-ui, sans-serif;
}

main, .topo, .rodape {
  width: 100%;
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0 1rem;
}

h1, h2 {
  margin: 0;
  font-family: var(--titulo);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.25rem, 9vw, 3.25rem); text-transform: uppercase; }
h2 { font-size: 1.75rem; }

p { margin: 0; }

a { color: var(--laranja); }

:focus-visible {
  outline: 3px solid var(--laranja);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Botões e links com cara de botão: alvo de toque de 48 px. */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--laranja);
  color: var(--preto);
  font: 600 1.0625rem 'Barlow', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.botao:hover { background: var(--laranja-forte); }

.botao.secundario {
  background: transparent;
  color: var(--texto);
  box-shadow: inset 0 0 0 1.5px var(--borda);
}

.botao.secundario:hover { box-shadow: inset 0 0 0 1.5px var(--texto-suave); }

.botao.largo { width: 100%; }

/* Início */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0 3rem;
  text-align: center;
}

.hero .logo {
  width: min(52vw, 200px);
  height: auto;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.hero h1 { max-width: 12ch; }

.info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  color: var(--texto-suave);
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.secao { padding-bottom: 2.5rem; }

.secao > h2 { margin-bottom: 1rem; }

.status { color: var(--texto-suave); }
.status:empty { display: none; }
.status.aviso { color: var(--laranja); margin-bottom: 1rem; }

.lista-servicos {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cartao-servico {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 1rem;
  min-height: 72px;
  padding: 1rem 1.25rem;
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--texto);
  text-decoration: none;
  transition: background 0.15s;
}

.cartao-servico:hover { background: var(--superficie-2); }

.cartao-servico .nome { font-weight: 600; font-size: 1.125rem; }
.cartao-servico .meta { grid-column: 1; color: var(--texto-suave); font-size: 0.95rem; }
.cartao-servico .preco {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
  font-family: var(--titulo);
  font-size: 1.375rem;
  font-weight: 600;
  white-space: nowrap;
}
.cartao-servico .preco small {
  display: block;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--texto-suave);
}

/* Página do serviço */
.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.topo .voltar {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-right: 1rem;
  color: var(--texto);
  font-weight: 600;
  text-decoration: none;
}

.topo .voltar::before { content: '‹'; margin-right: 0.4rem; font-size: 1.5rem; line-height: 1; color: var(--laranja); }

.topo img { width: 44px; height: 44px; border-radius: 50%; }

.cabecalho-servico { display: grid; gap: 0.5rem; padding: 1rem 0 2rem; }
.cabecalho-servico .meta { color: var(--texto-suave); }

.cartao {
  padding: 1.25rem;
  border-radius: var(--raio);
  background: var(--superficie);
}

.tabela-precos { width: 100%; border-collapse: collapse; }
.tabela-precos th, .tabela-precos td { padding: 0.75rem 0; text-align: left; border-bottom: 1px solid var(--borda); }
.tabela-precos tr:last-child th, .tabela-precos tr:last-child td { border-bottom: 0; }
.tabela-precos thead th { padding-top: 0; color: var(--texto-suave); font-weight: 400; font-size: 0.9rem; }
.tabela-precos thead th:last-child { text-align: right; }
.tabela-precos td { text-align: right; font-weight: 600; white-space: nowrap; }
.tabela-precos .exemplo { display: block; color: var(--texto-suave); font-size: 0.875rem; font-weight: 400; }

.campo { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }

label, legend { font-weight: 600; }

select, input[type='text'], input[type='tel'] {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto);
  font: inherit;
}

select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-suave) 50%), linear-gradient(135deg, var(--texto-suave) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }

select:focus-visible, input:focus-visible { outline-offset: 0; border-color: var(--laranja); }

fieldset { margin: 0 0 1.25rem; padding: 0; border: 0; }
legend { margin-bottom: 0.5rem; padding: 0; }

.opcoes { display: grid; gap: 0.5rem; }

.opcao {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  font-weight: 400;
  cursor: pointer;
}

.opcao:has(input:checked) { border-color: var(--laranja); }
.opcao input { width: 20px; height: 20px; margin: 0; accent-color: var(--laranja); }
.opcao .exemplo { display: block; color: var(--texto-suave); font-size: 0.875rem; }

.nota { color: var(--texto-suave); font-size: 0.95rem; }

.resultado { display: grid; gap: 0.25rem; margin: 0.5rem 0 1.25rem; }
.resultado:empty { display: none; }
.resultado dl { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; margin: 0; }
.resultado dt { color: var(--texto-suave); }
.resultado dd { margin: 0; text-align: right; font-weight: 600; }
.resultado .total { font-family: var(--titulo); font-size: 1.75rem; color: var(--texto); }

.empilhado { display: grid; gap: 1.25rem; padding-bottom: 2.5rem; }

/* Rodapé */
.rodape {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--borda);
  color: var(--texto-suave);
  font-size: 0.95rem;
}

.rodape a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--texto-suave);
}

/* Privacidade */
.texto-longo { display: grid; gap: 1rem; padding: 1rem 0 2.5rem; }
.texto-longo h2 { margin-top: 1rem; font-size: 1.5rem; }
.texto-longo ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.25rem; }

.faixa-rascunho {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(242, 107, 33, 0.12);
  color: var(--laranja);
  font-weight: 600;
}

#simulador { padding-top: 1rem; }
.acao-agendar { margin-top: 1.25rem; }
.nota-agendar { margin-top: 0.75rem; }

[hidden] { display: none !important; }

/* Reserva a altura da tela enquanto o catálogo carrega: o rodapé não pula (CLS). */
main { min-height: 100vh; min-height: 100dvh; }

/* O que inclui */
.lista-inclui { display: grid; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.lista-inclui li { position: relative; padding-left: 1.75rem; }
.lista-inclui li::before { content: '✓'; position: absolute; left: 0.25rem; color: var(--laranja); font-weight: 600; }
#nao-inclui { margin-top: 1rem; }

/* Busca de modelo com lupa */
.busca { position: relative; }
.busca .lupa {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-suave);
  pointer-events: none;
}
.busca input { padding-left: 2.85rem; padding-right: 3rem; }
.busca .limpar {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--texto-suave);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.busca .limpar:hover { color: var(--texto); }

.sugestoes {
  max-height: 24rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  list-style: none;
}
.sugestao {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}
.sugestao .marca { color: var(--texto-suave); }
.sugestao:hover, .sugestao[aria-selected='true'] { background: rgba(242, 107, 33, 0.16); }
.sugestao.outro { display: block; margin-top: 0.25rem; border-top: 1px solid var(--borda); border-radius: 0 0 8px 8px; color: var(--laranja); }
.sugestao.outro strong { color: var(--texto); }

/* Agendar */
.campo-primeiro { margin-top: 1rem; }
#campo-opcao, #campo-adicionais { margin-top: 0.25rem; }
#campo-adicionais { margin-bottom: 0; }
.explica { margin: 0.5rem 0 1rem; }

.semana-nav { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; scroll-margin-top: 1rem; }
.semana-nav p { text-align: center; font-weight: 600; }
.semana-nav-baixo { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--borda); }
.botao-icone {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--borda);
  border-radius: 999px;
  background: var(--superficie-2);
  color: var(--texto);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.botao-icone:disabled { opacity: 0.35; cursor: default; }

.dias { display: grid; gap: 0.5rem; }
.dia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dia .dia-nome { font-weight: 600; }
.dia .dia-estado { color: var(--texto-suave); font-size: 0.95rem; }
.dia-livre .dia-estado { color: var(--laranja); }
.dia:disabled { cursor: default; background: transparent; border-style: dashed; }
.dia:disabled .dia-nome { color: var(--texto-suave); font-weight: 400; }
.dia.escolhido, .horario.escolhido { border-color: var(--laranja); background: rgba(242, 107, 33, 0.16); }
.dia.na-sequencia { border-color: var(--laranja); border-style: dashed; }
.dia.na-sequencia .dia-estado::after { content: ' · no serviço'; }

.rotulo { margin: 1.25rem 0 0.5rem; font-weight: 600; }
.horarios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.horario {
  min-height: 48px;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto);
  font: 600 1.0625rem 'Barlow', system-ui, sans-serif;
  cursor: pointer;
}
.horario:disabled { cursor: default; background: transparent; color: var(--texto-suave); font-weight: 400; border-style: dashed; }
.legenda { margin-top: 1rem; font-size: 0.875rem; }
.escolha-quando { margin-top: 0.75rem; font-weight: 600; color: var(--laranja); }
.escolha-quando:empty { display: none; }

.aceites { display: grid; gap: 0.75rem; margin: 1rem 0 1.25rem; }
.aceite { display: flex; align-items: flex-start; gap: 0.75rem; min-height: 44px; font-weight: 400; cursor: pointer; }
.aceite input { flex: none; width: 24px; height: 24px; margin: 0.1rem 0 0; accent-color: var(--laranja); }
.regras { margin: -0.25rem 0 0.25rem 2.25rem; padding-left: 1rem; color: var(--texto-suave); font-size: 0.9rem; display: grid; gap: 0.25rem; }

.erro {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--laranja);
  border-radius: 12px;
  background: rgba(242, 107, 33, 0.12);
  color: var(--texto);
  font-weight: 600;
  scroll-margin: 6rem;
}
.erro::before { content: '⚠ '; color: var(--laranja); }
.erro:focus-visible { outline-offset: 2px; }
.erro:empty { display: none; }
.botao:disabled { opacity: 0.6; cursor: progress; }

.confirmacao { padding-bottom: 2.5rem; outline: none; }
.confirmacao .cartao { display: grid; gap: 0.75rem; }
.codigo { font-family: var(--titulo); font-size: 2.5rem; letter-spacing: 0.08em; color: var(--laranja); }
.prazo { font-weight: 600; }

/* Dicas e erros por campo (Agendar) */
.dica { color: var(--texto-suave); font-size: 0.9rem; }
.dica:empty { display: none; }
.dica.ok { color: var(--texto); font-weight: 600; }
.erro-campo { color: var(--laranja); font-size: 0.95rem; font-weight: 600; }
.erro-campo::before { content: '⚠ '; }
input[aria-invalid='true'] { border-color: var(--laranja); }

/* Botão com cara de link (ex.: "Fui indicado por alguém", "Não sou eu") */
.link-botao {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--laranja);
  font: 600 1rem 'Barlow', system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-botao[aria-expanded]::after { content: ' ▾'; text-decoration: none; display: inline-block; margin-left: 0.25rem; }
.link-botao[aria-expanded='true']::after { transform: rotate(180deg); }
.campo-indicacao #bloco-indicacao { margin: 0.5rem 0 0; }

/* Dados lembrados no aparelho */
.dados-salvos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.75rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto-suave);
  font-size: 0.95rem;
}

/* Pagamento do sinal e Acompanhar */
h3 { margin: 0; font-family: var(--titulo); font-weight: 600; font-size: 1.375rem; }
.pagamento { display: grid; gap: 0.75rem; }
.valor-sinal { font-family: var(--titulo); font-size: 2rem; color: var(--laranja); }
.aviso-sem-pix { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.qr-moldura { justify-self: center; width: min(100%, 280px); padding: 0; border-radius: 12px; overflow: hidden; background: #fff; }
.qr { display: block; width: 100%; height: auto; }
.copia-cola {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto);
  font: 0.9rem/1.4 ui-monospace, Menlo, monospace;
  word-break: break-all;
  resize: none;
}
.aviso-copia { color: var(--texto-suave); font-size: 0.95rem; min-height: 1.4em; }
.politica { display: grid; gap: 0.25rem; }
.politica .regras { margin-left: 0; }
.acoes-fim { display: grid; gap: 0.75rem; margin-top: 1rem; }
.confirmacao { display: grid; gap: 1rem; }
.lista-codigos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.lista-codigos .botao { padding: 0 1rem; font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.05em; }
#form-codigo { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
#form-codigo .campo { margin-bottom: 0; }
#form-codigo #codigo { text-transform: uppercase; letter-spacing: 0.08em; }
.endereco { font-weight: 600; font-size: 1.125rem; }
.acoes-inicio { margin-top: 0.75rem; }

/* Faixa do ambiente de teste (js/ui/ambiente.js; só no dev e no emulador). */
.faixa-teste {
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--laranja);
  color: var(--preto);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

/* Tela de Confirmado no Acompanhar: o anel gira 3 voltas na mudança de status e
   fecha em círculo. Com movimento reduzido, já aparece fechado. */
.estado-confirmado #r-status { justify-items: center; text-align: center; }
.estado-confirmado #t-resultado { color: var(--laranja); font-size: clamp(2.25rem, 10vw, 3rem); line-height: 1.05; }
.anel {
  display: block;
  box-sizing: border-box;
  width: 72px;
  height: 72px;
  border: 6px solid var(--laranja);
  border-radius: 50%;
}
.anel[hidden] { display: none; }
.anel.gira { animation: anel-girar 2.4s ease-in-out both; }
@keyframes anel-girar {
  0% { transform: rotate(0deg); border-right-color: transparent; border-bottom-color: transparent; }
  85% { transform: rotate(1080deg); border-right-color: transparent; border-bottom-color: transparent; }
  100% { transform: rotate(1080deg); border-right-color: var(--laranja); border-bottom-color: var(--laranja); }
}

/* Convite para instalar o app (js/ui/instalar.js). */
.convite-instalar {
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
  margin: 1rem auto 0;
  padding: 1rem;
  border: 1px solid var(--borda);
  border-radius: 16px;
  background: var(--superficie);
}
.convite-instalar[hidden] { display: none; }
.convite-instalar p { margin: 0; }
.acoes-convite { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.acoes-convite .botao { flex: 1 1 8rem; }

/* Aviso de versão nova (js/ui/atualizacao.js): discreto, fixo no rodapé. */
.aviso-versao {
  position: fixed;
  inset: auto 1rem calc(1rem + env(safe-area-inset-bottom)) 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 608px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--borda);
  border-radius: 16px;
  background: var(--superficie-2);
}
.aviso-versao p { margin: 0; }
.aviso-versao .botao { min-height: 44px; padding-inline: 1rem; }
.com-aviso-versao { padding-bottom: 9rem; }
