/* Cobra Sem Climão — estilo
   Ideia visual: o velho caderninho de fiado (papel pautado, caneta azul,
   marca-texto) virando conversa de WhatsApp. Mobile-first, a partir de 360 px. */

@font-face {
  font-family: "Bricolage";
  src: url("/fontes/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("/fontes/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fontes/figtree-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fontes/figtree-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --papel: #fbfaf5;        /* fundo, papel de caderno */
  --pauta: #e6edf6;        /* linhas do caderno */
  --margem: #e9a8a3;       /* linha vermelha da margem */
  --tinta: #1b3a8c;        /* caneta azul: títulos, links, botão principal */
  --tinta-escura: #12286a;
  --grafite: #23272f;      /* texto */
  --grafite-claro: #555c69;
  --marca-texto: #ffe14d;  /* o único destaque forte */
  --erro: #b3261e;
  --ok: #0e6b58;
  --whats: #25d366;
  --whats-texto: #06331d;
  --bolha: #dcf8c6;        /* bolha de mensagem enviada */
  --raio: 14px;
  --sombra: 0 1px 0 rgba(27, 58, 140, 0.08), 0 8px 24px -12px rgba(27, 58, 140, 0.25);
  --titulo: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --corpo: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--papel);
  color: var(--grafite);
  font-family: var(--corpo);
  font-size: 1.0625rem; /* 17 px */
  line-height: 1.55;
}

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

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

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

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pular {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--tinta);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.pular:focus {
  top: 1rem;
}

.conteudo {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

/* Topo */
.topo {
  padding-block: 1rem;
}
.topo .conteudo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.marca {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--grafite);
  text-decoration: none;
  font-family: var(--titulo);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marca img {
  width: 36px;
  height: 36px;
}
.topo-link {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
@media (max-width: 419px) {
  .topo-link {
    display: none;
  }
}

/* Abertura */
.abertura {
  padding-block: 1.5rem 1rem;
}
h1,
h2,
h3 {
  font-family: var(--titulo);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--tinta-escura);
  margin: 0;
}
h1 {
  font-weight: 800;
  font-size: clamp(2.3rem, 9vw, 4.4rem);
  max-width: 14ch;
}
.abertura p {
  margin: 0.8rem 0 0;
  max-width: 38rem;
  font-size: 1.1rem;
  color: var(--grafite-claro);
}

/* Gerador: a página do caderninho + a conversa */
.gerador {
  display: grid;
  gap: 1.25rem;
  padding-block: 1.25rem 3rem;
}

.caderno {
  position: relative;
  background-color: #fff;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2.45rem,
    var(--pauta) 2.45rem,
    var(--pauta) calc(2.45rem + 1px)
  );
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 1.25rem 1.1rem 1.5rem 2.1rem;
}
/* Linha vermelha da margem do caderno */
.caderno::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.2rem;
  width: 2px;
  background: var(--margem);
  opacity: 0.8;
}

.caderno h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.caderno .dica {
  margin: 0 0 1rem;
  color: var(--grafite-claro);
  font-size: 0.95rem;
}

.campos {
  display: grid;
  gap: 0.9rem;
}
.campo {
  display: grid;
  gap: 0.3rem;
}
.campo label,
.legenda {
  font-weight: 700;
  font-size: 1rem;
}
.campo small {
  color: var(--grafite-claro);
  font-size: 0.9rem;
}
.opcional {
  font-weight: 400;
  color: var(--grafite-claro);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[inputmode="decimal"],
select,
textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--grafite);
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border: 2px solid #c9d3e3;
  border-radius: 10px;
  background: #fff;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--tinta);
  box-shadow: 0 0 0 3px rgba(27, 58, 140, 0.2);
}
.duas-colunas {
  display: grid;
  gap: 0.9rem;
}

/* Escolha do tom: três "etiquetas" de caneta */
.tons {
  border: 0;
  margin: 0;
  padding: 0;
}
.tons .opcoes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.tons input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tons label {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0.4rem;
  text-align: center;
  font-weight: 700;
  border: 2px solid #c9d3e3;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  line-height: 1.2;
}
.tons input:checked + label {
  border-color: var(--tinta);
  background: var(--marca-texto);
  color: var(--grafite);
}
.tons input:focus-visible + label {
  outline: 3px solid var(--tinta);
  outline-offset: 2px;
}

.marcar {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.95rem;
  min-height: 48px;
  padding-top: 0.6rem;
}
.marcar input {
  width: 22px;
  height: 22px;
  margin: 0.1rem 0 0;
  accent-color: var(--tinta);
  flex: none;
}

/* A conversa: onde a mensagem aparece pronta */
.conversa {
  background: #e9e3d6;
  background-image: radial-gradient(rgba(27, 58, 140, 0.06) 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: var(--raio);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}
.conversa-topo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--grafite);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tinta);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--titulo);
  font-weight: 800;
}
.conversa-topo small {
  display: block;
  font-weight: 400;
  color: var(--grafite-claro);
  font-size: 0.85rem;
}

.bolha {
  justify-self: end;
  width: min(100%, 30rem);
  background: var(--bolha);
  border-radius: 14px 4px 14px 14px;
  padding: 0.6rem 0.75rem 0.4rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.bolha label {
  display: block;
  font-size: 0.8rem;
  color: var(--grafite-claro);
  margin-bottom: 0.2rem;
}
.bolha textarea {
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 12rem;
  resize: vertical;
  line-height: 1.45;
}
.bolha textarea:focus-visible {
  box-shadow: none;
  outline: 2px dashed var(--tinta);
  outline-offset: 4px;
}
.bolha .hora {
  text-align: right;
  font-size: 0.75rem;
  color: var(--grafite-claro);
}

.acoes {
  display: grid;
  gap: 0.6rem;
}
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease;
}
.botao:active {
  transform: translateY(1px);
}
.botao-whats {
  background: var(--whats);
  color: var(--whats-texto);
}
.botao-whats:hover {
  background: #1fbd5a;
}
.botao-principal {
  background: var(--tinta);
  color: #fff;
}
.botao-principal:hover {
  background: var(--tinta-escura);
}
.botao-secundario {
  background: #fff;
  color: var(--tinta);
  border-color: var(--tinta);
}
.botao-secundario:hover {
  background: #eef2fb;
}
.botao[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.par-botoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.aviso {
  font-size: 0.9rem;
  color: var(--grafite-claro);
  margin: 0;
}
.status {
  min-height: 1.5rem;
  margin: 0;
  font-weight: 700;
  color: var(--ok);
}

/* Seções seguintes: calmas */
.secao {
  padding-block: 3rem;
  border-top: 2px dashed var(--pauta);
}
.secao h2 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  max-width: 20ch;
}
.secao > .conteudo > p {
  max-width: 40rem;
  color: var(--grafite-claro);
  font-size: 1.1rem;
}

.passos {
  list-style: none;
  counter-reset: passo;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.25rem;
}
.passos li {
  counter-increment: passo;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.9rem;
  align-items: start;
}
.passos li::before {
  content: counter(passo);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 2px solid var(--tinta);
  font-family: var(--titulo);
  font-weight: 800;
  color: var(--tinta);
}
.passos h3 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}
.passos p {
  margin: 0;
  color: var(--grafite-claro);
}

/* Lista de espera */
.lista {
  margin-top: 2rem;
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 1.5rem 1.25rem;
  max-width: 36rem;
  display: grid;
  gap: 0.9rem;
}
.lista .armadilha {
  position: absolute;
  left: -9999px;
}
.mensagem-form {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
}
.mensagem-form[hidden] {
  display: none;
}
.mensagem-form.sucesso {
  background: #e3f4ee;
  color: var(--ok);
}
.mensagem-form.falha {
  background: #fbe9e7;
  color: var(--erro);
}

/* Perguntas */
.perguntas {
  margin-top: 1.5rem;
  max-width: 44rem;
}
.perguntas details {
  border-bottom: 1px solid var(--pauta);
}
.perguntas summary {
  cursor: pointer;
  min-height: 48px;
  padding: 0.85rem 0;
  font-weight: 700;
  font-size: 1.08rem;
  list-style-position: outside;
}
.perguntas details p {
  margin: 0 0 1rem;
  color: var(--grafite-claro);
}

/* Rodapé */
.rodape {
  padding-block: 2rem 3rem;
  background: var(--tinta-escura);
  color: #e6ebf7;
  font-size: 0.95rem;
}
.rodape a {
  color: #fff;
}
.rodape nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1rem;
}
.rodape nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}
.rodape p {
  margin: 0.4rem 0;
  max-width: 44rem;
}

/* Páginas de texto (privacidade, termos) */
.texto-legal {
  padding-block: 1.5rem 3rem;
  max-width: 46rem;
}
.texto-legal h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  max-width: none;
}
.texto-legal h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
}
.texto-legal p,
.texto-legal li {
  max-width: 70ch;
}
.texto-legal .versao {
  color: var(--grafite-claro);
}
.tabela-rolagem {
  overflow-x: auto;
  margin-block: 1rem;
}
.texto-legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 36rem;
  font-size: 0.95rem;
}
.texto-legal th,
.texto-legal td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem;
  border-bottom: 1px solid var(--pauta);
}
.texto-legal th {
  background: #eef2fb;
}

/* Telas maiores */
@media (min-width: 640px) {
  .duas-colunas {
    grid-template-columns: 1fr 1fr;
  }
  .acoes {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .acoes .par-botoes {
    display: contents;
  }
  .passos {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .abertura {
    padding-block: 3rem 1rem;
  }
  .gerador {
    grid-template-columns: 1.05fr 1fr;
    align-items: start;
  }
  .conversa {
    position: sticky;
    top: 1rem;
    padding: 1.25rem;
  }
  .acoes {
    grid-template-columns: 1fr;
  }
  .acoes .par-botoes {
    display: grid;
  }
  .passos {
    grid-template-columns: repeat(4, 1fr);
  }
}

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