/* Signata: ativação da placa de avaliação */
@font-face { font-family: "Lato"; src: url("/_/lato-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/_/lato-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/_/cinzel-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  /* marca */
  --noite: #1E2838;
  --noite-2: #28344A;
  --ouro: #C9A04E;
  --ouro-claro: #D2B278;
  --marfim: #F3E9D2;
  --kraft: #E8D9C0;
  --cinza: #6B6457;
  /* papéis */
  --fundo: #F8F2E4;          /* marfim clareado: legível ao sol */
  --fundo-fora: #EBE0CA;     /* em telas largas, em volta do cartão */
  --superficie: #FFFDF8;
  --tinta: #1E2838;          /* 13,3:1 sobre o fundo */
  --tinta-2: #5E584C;        /* 6,3:1 sobre o fundo */
  --borda: #8C8270;          /* 3,4:1, contorno de campo */
  --divisa: #E3D7BF;
  --realce: #F1E6CE;         /* linha em foco ou tocada */
  --no-escuro-2: #C9CFD9;    /* texto secundário sobre o azul-noite */
  --erro: #8E2A22;
  --erro-fundo: #FBEEEA;
  --erro-borda: #E7C2B9;
  --raio: 14px;
  --raio-p: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; scrollbar-color: var(--borda) transparent; }
body {
  margin: 0; min-height: 100svh; background: var(--fundo); color: var(--tinta);
  font: 400 1.125rem/1.5 "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-kerning: normal; caret-color: var(--noite);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--kraft); color: var(--noite); }
button, input { font: inherit; color: inherit; }
a { color: var(--tinta); text-underline-offset: .22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--noite); outline-offset: 3px; border-radius: 4px; }
.so-leitor { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.pagina { min-height: 100svh; display: flex; flex-direction: column; background: var(--fundo); }

/* ---------- topo: a faixa da marca ---------- */
.aviso-teste {
  padding: .55rem var(--gutter); font-size: .95rem; font-weight: 700; line-height: 1.35;
  background: var(--ouro-claro); color: var(--noite); text-align: center;
}
.topo {
  background: var(--noite); color: var(--marfim);
  padding: calc(.9rem + env(safe-area-inset-top, 0px)) var(--gutter) 1rem;
  border-bottom: 1px solid #3A4458;
}
.topo-linha { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; }
.marca { display: block; width: 7.25rem; height: auto; overflow: visible; }
.topo-rotulo {
  font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: .78rem; line-height: 1.25;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ouro-claro); text-align: right; max-width: 9rem;
}

/* indicador de passos: quatro ovais, como o da marca, ligados por um fio dourado */
.passos {
  --p: 1; position: relative; list-style: none; margin: 1.1rem 0 .1rem; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.passos[hidden] { display: none; }
.passos::before, .passos::after {
  content: ""; position: absolute; top: 10px; left: 12.5%; height: 2px; border-radius: 1px;
}
.passos::before { right: 12.5%; background: #3E4A60; }
.passos::after { width: calc((var(--p) - 1) / 3 * 75%); background: var(--ouro); transition: width .6s var(--ease); }
.passos li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; min-width: 0; }
.marco {
  display: grid; place-items: center; width: 18px; height: 22px; border-radius: 50%;
  background: var(--noite); border: 2px solid #5A6680;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.marco svg { width: 11px; height: 11px; fill: none; stroke: var(--noite); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.passo-nome {
  font-weight: 700; font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--no-escuro-2); white-space: nowrap;
}
.passos li.feito .marco { background: var(--ouro); border-color: var(--ouro); }
.passos li.feito .marco svg { opacity: 1; }
.passos li.feito .passo-nome { color: var(--ouro-claro); }
.passos li[aria-current="step"] .marco {
  background: var(--marfim); border-color: var(--ouro); transform: scale(1.12);
  box-shadow: 0 0 0 4px rgb(201 160 78 / .28);
}
.passos li[aria-current="step"] .passo-nome { color: var(--marfim); }

/* ---------- área de trabalho ---------- */
.tela { flex: 1; width: 100%; max-width: 34rem; margin: 0 auto; padding: 1.75rem var(--gutter) 2.25rem; }
h1 {
  margin: 0 0 .6rem; font-size: 1.75rem; line-height: 1.18; font-weight: 700; letter-spacing: -.015em;
  text-wrap: balance; color: var(--tinta);
}
h1:focus { outline: none; }
.ajuda { margin: 0 0 1.5rem; color: var(--tinta-2); max-width: 36ch; text-wrap: pretty; }
.nota { margin: .6rem 0 0; color: var(--tinta-2); font-size: 1rem; line-height: 1.45; max-width: 38ch; text-wrap: pretty; }

/* selo de estado da placa */
.selo {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.1rem; padding: .4rem .8rem .4rem .7rem;
  border-radius: 999px; background: var(--superficie); border: 1px solid var(--divisa);
  font-size: .95rem; font-weight: 700; color: var(--tinta);
}
.selo::before { content: ""; width: 9px; height: 11px; border-radius: 50%; background: var(--ouro); box-shadow: 0 0 0 3px rgb(201 160 78 / .25); }
.selo.erro-selo::before { background: var(--erro); box-shadow: 0 0 0 3px rgb(142 42 34 / .16); }
.selo .id { font-family: "Cinzel", Georgia, serif; font-weight: 600; letter-spacing: .05em; font-size: .95rem; color: var(--tinta); }

/* campos */
.campo { margin: 0 0 1.25rem; }
label { display: block; margin: 0 0 .45rem; font-weight: 700; font-size: 1.05rem; }
.envolve { position: relative; }
input[type="text"] {
  display: block; width: 100%; min-height: 3.5rem; padding: .7rem 1rem; font-size: 1.25rem; line-height: 1.3;
  background: var(--superficie); border: 1.5px solid var(--borda); border-radius: var(--raio);
  appearance: none; transition: border-color .15s, box-shadow .2s var(--ease);
}
.envolve.busca input { padding-left: 3rem; }
.envolve.busca .ic {
  position: absolute; left: 1rem; top: 50%; translate: 0 -50%; width: 1.25rem; height: 1.25rem; color: var(--tinta-2); pointer-events: none;
}
input::placeholder { color: #776F62; opacity: 1; }
input:focus-visible { outline: none; border-color: var(--noite); box-shadow: 0 0 0 1px var(--noite), 0 0 0 5px rgb(201 160 78 / .42); }
input.codigo { font-variant-numeric: tabular-nums lining-nums; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
input.codigo::placeholder { text-transform: none; letter-spacing: .02em; font-weight: 400; }
input[aria-invalid="true"] { border-color: var(--erro); background: #FFFBFA; }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 1px var(--erro), 0 0 0 5px rgb(142 42 34 / .18); }

/* botões */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 3.6rem;
  padding: .75rem 1.25rem; font-weight: 700; font-size: 1.15rem; line-height: 1.2; text-decoration: none; text-align: center; cursor: pointer;
  border-radius: var(--raio); border: 2px solid var(--noite); background: var(--noite); color: var(--marfim);
  box-shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 6px 16px -8px rgb(30 40 56 / .55);
  transition: background-color .18s, box-shadow .18s, transform .18s var(--ease);
  touch-action: manipulation;
}
.btn:active { transform: scale(.985); box-shadow: 0 2px 6px -4px rgb(30 40 56 / .6); }
.btn:focus-visible { outline: 3px solid var(--ouro); outline-offset: 3px; border-radius: var(--raio); }
.btn[disabled] { cursor: progress; background: #4A5468; border-color: #4A5468; color: #E6E1D6; box-shadow: none; }
.btn[disabled]:not([aria-busy]) { cursor: not-allowed; background: var(--divisa); border-color: var(--divisa); color: var(--tinta-2); }
.btn[aria-busy="true"]::before {
  content: ""; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid rgb(243 233 210 / .35); border-top-color: var(--marfim); animation: gira .8s linear infinite;
}
.btn.sec { background: var(--superficie); color: var(--tinta); box-shadow: none; border-color: var(--noite); }
.btn .ic { width: 1.2rem; height: 1.2rem; flex: none; }
.btn + .btn, .btn + .acoes, .acoes + .btn { margin-top: .75rem; }

/* link de voltar ou trocar */
.link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.9rem; margin-top: .9rem; padding: .5rem .2rem;
  font-weight: 400; font-size: 1.05rem; color: var(--tinta); background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgb(30 40 56 / .35); text-underline-offset: .25em; text-decoration-thickness: 1.5px;
  transition: text-decoration-color .15s;
}
.link .ic { width: 1.1rem; height: 1.1rem; flex: none; }

/* mensagens */
.erro {
  display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 1rem; padding: .8rem 1rem;
  border-radius: var(--raio-p); background: var(--erro-fundo); border: 1px solid var(--erro-borda);
  color: var(--erro); font-weight: 700; font-size: 1.05rem; line-height: 1.4;
}
.erro { flex-wrap: wrap; }
.erro[hidden] { display: none; }
.erro .acao {
  display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 100%; min-height: 2.75rem; margin-top: .1rem; padding: .4rem 0;
  background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 1.05rem; color: var(--erro); text-align: left;
  text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1.5px;
}
.erro .acao .ic { width: 1.1rem; height: 1.1rem; flex: none; }
.erro .ic { width: 1.25rem; height: 1.25rem; flex: none; margin-top: .08rem; }
.campo .erro { margin: .75rem 0 0; }
.vazio { margin: 1rem 0 0; color: var(--tinta-2); font-size: 1.05rem; }
.vazio:empty { display: none; }
.vazio.procurando { display: flex; align-items: center; gap: .6rem; }
.vazio.procurando::before {
  content: ""; width: 1rem; height: 1rem; border-radius: 50%; flex: none;
  border: 2px solid var(--divisa); border-top-color: var(--ouro); animation: gira .8s linear infinite;
}

/* sem resultado e contato da loja */
.sem-resultado { margin-top: 1rem; }
.sem-resultado:empty { display: none; }
.contato { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--divisa); }
.contato .nota { margin: 0 0 .75rem; }
.contato-texto { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* listas: cidades e empresas */
.lista {
  list-style: none; margin: .5rem 0 0; padding: .3rem; background: var(--superficie);
  border: 1.5px solid var(--borda); border-radius: var(--raio);
  box-shadow: 0 10px 24px -14px rgb(30 40 56 / .35);
}
.lista[hidden] { display: none; }
.lista li + li { border-top: 1px solid var(--divisa); }
.lista button {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.5rem; padding: .85rem .8rem; text-align: left;
  background: none; border: 0; border-radius: var(--raio-p); cursor: pointer; transition: background-color .12s;
}
.lista button[aria-selected="true"] { background: var(--realce); box-shadow: inset 0 0 0 2px var(--noite); }
.lista button:active { background: var(--kraft); }
.lista button:focus-visible { outline: 3px solid var(--noite); outline-offset: -3px; }
.lista .txt { flex: 1; min-width: 0; }
.lista .nome { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.lista .sub { display: block; margin-top: .15rem; font-size: 1rem; line-height: 1.35; color: #4A453C; overflow-wrap: anywhere; }
.lista .seta { width: 1.1rem; height: 1.1rem; flex: none; color: var(--borda); }
.lista + .erro { margin-top: .75rem; }

/* ficha da empresa escolhida */
.ficha {
  display: flex; gap: .9rem; align-items: flex-start; margin: .4rem 0 1.25rem; padding: 1.1rem 1.1rem 1.15rem;
  background: var(--superficie); border: 1.5px solid var(--divisa); border-radius: var(--raio);
}
.ficha .pino { width: 1.5rem; height: 1.5rem; flex: none; margin-top: .15rem; color: var(--ouro); }
.ficha .nome { margin: 0; font-weight: 700; font-size: 1.25rem; line-height: 1.25; overflow-wrap: anywhere; }
.ficha .sub { margin: .3rem 0 0; color: var(--tinta-2); font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.nota + .btn, .ficha + .btn, .nota + .erro + .btn { margin-top: 1.25rem; }
.ficha + .erro { margin-top: -.25rem; }
.btn + .nota { margin: .75rem 0 1rem; }

/* placa já ativa (reconfigurar) */
.atual {
  margin: 0 0 1.35rem; padding: .85rem 1rem; border-radius: var(--raio-p);
  background: var(--realce); border: 1px solid var(--divisa); font-size: 1rem; line-height: 1.4; color: var(--tinta-2);
}
.atual strong { display: block; margin-top: .1rem; font-size: 1.1rem; color: var(--tinta); overflow-wrap: anywhere; }

/* ---------- placa ativada: o momento da assinatura ---------- */
.certificado {
  position: relative; margin: 0 0 1.25rem; padding: 1.4rem 1.25rem 1.35rem; text-align: center;
  background: var(--noite); color: var(--marfim); border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 36px -22px rgb(30 40 56 / .7);
}
.certificado::before { /* filete interno, como o oval duplo da marca */
  content: ""; position: absolute; inset: 7px; border: 1px solid rgb(210 178 120 / .35); border-radius: 13px; pointer-events: none;
}
.monograma { display: block; width: 5.25rem; height: auto; margin: 0 auto 1rem; overflow: visible; }
.monograma .oval { fill: none; stroke: var(--ouro-claro); }
.monograma .oval-1 { stroke-width: 3; }
.monograma .oval-2 { stroke-width: 1.2; }
.monograma .letra-s { fill: var(--ouro-claro); stroke: var(--ouro-claro); stroke-width: 18.1; stroke-linejoin: round; }
.monograma .letras { fill: var(--ouro-claro); }
.certificado h1 { color: var(--marfim); margin: 0; font-size: 1.85rem; }
.certificado .empresa { margin: .5rem auto 0; max-width: 26ch; font-size: 1.15rem; font-weight: 700; color: var(--ouro-claro); overflow-wrap: anywhere; }
.certificado .id { display: block; margin-top: .85rem; font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: .78rem; letter-spacing: .16em; color: var(--no-escuro-2); }

/* ---------- carregando ---------- */
.carregando { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3.5rem 0 2rem; color: var(--tinta-2); font-size: 1.05rem; }
.carregando-oval { width: 2.5rem; height: auto; overflow: visible; }
.carregando-oval ellipse { fill: none; stroke: #D8C9AA; stroke-width: 4; }
.carregando-oval .arco { stroke: var(--noite); stroke-linecap: round; stroke-dasharray: 40 60; animation: corre 1.3s linear infinite; }

/* ---------- rodapé ---------- */
.rodape {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .9rem;
  padding: 1.1rem var(--gutter) calc(1.4rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--divisa); font-size: 1rem; color: var(--tinta);
}
.rodape-marca { font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; color: var(--tinta); }
.rodape a { color: var(--tinta); font-weight: 700; padding: .35rem 0; }
.sem-js { margin: 1rem var(--gutter); }

@media (hover: hover) {
  .btn:not([disabled]):hover { background: var(--noite-2); }
  .btn.sec:hover { background: var(--realce); }
  .link:hover { text-decoration-color: var(--ouro); }
  input:not([aria-invalid="true"]):not(:focus-visible):hover { border-color: var(--tinta-2); }
  .lista button:hover { background: #F6EEDD; }
  .rodape a:hover { text-decoration-color: var(--ouro); }
}

/* ---------- movimento ---------- */
.entra { animation: entra .38s var(--ease) both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes corre { to { stroke-dashoffset: -100; } }

.certificado.assina .oval { stroke-dasharray: 100; stroke-dashoffset: 100; animation: traca 1.1s var(--ease) forwards; }
.certificado.assina .oval-2 { animation-delay: .15s; }
.certificado.assina .letra-s { stroke-dasharray: 100; stroke-dashoffset: 100; fill-opacity: 0; animation: traca 1.2s .45s cubic-bezier(.65, 0, .35, 1) forwards, preenche .5s 1.3s ease-out forwards; }
.certificado.assina .letras { opacity: 0; animation: surge .6s 1.5s ease-out forwards; }
.certificado.assina h1, .certificado.assina .empresa, .certificado.assina .id { animation: entra .5s var(--ease) both; }
.certificado.assina h1 { animation-delay: .2s; }
.certificado.assina .empresa { animation-delay: .35s; }
.certificado.assina .id { animation-delay: .5s; }
@keyframes traca { to { stroke-dashoffset: 0; } }
@keyframes preenche { to { fill-opacity: 1; } }
@keyframes surge { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .btn[aria-busy="true"]::before, .vazio.procurando::before { animation: none; border-top-color: var(--ouro); }
  .carregando-oval .arco { animation: none; }
}

/* ---------- telas largas: um cartão sobre o kraft ---------- */
@media (min-width: 720px) {
  body { background: var(--fundo-fora); }
  .pagina {
    min-height: 0; max-width: 36rem; margin: 3rem auto; border-radius: 22px; overflow: hidden;
    box-shadow: 0 1px 2px rgb(30 40 56 / .08), 0 30px 60px -30px rgb(30 40 56 / .45);
  }
  .topo { padding: 1.4rem 2rem 1.3rem; }
  .marca { width: 8.25rem; }
  .tela { max-width: none; padding: 2.5rem 2.5rem 2.75rem; min-height: 26rem; }
  .topo { padding-left: 2.5rem; padding-right: 2.5rem; }
  h1 { font-size: 2rem; }
  .rodape { padding: 1.1rem 2rem 1.4rem; }
}
@media (max-width: 380px) {
  .passo-nome { font-size: .72rem; letter-spacing: .02em; }
}
@media (max-width: 359px) {
  :root { --gutter: 1rem; }
  h1 { font-size: 1.6rem; }
}
