/* =============================================================
   Nomes que Vendem v3 — app de criação de nomes
   Design tokens Decola Marca v1.0 (tema escuro do app)
   Sem build step. Mobile-first. 360x640 é o caso de teste real.
   ============================================================= */
:root {
  --brand: #F58634;
  --brand-hover: #ff9950;
  --ink: #0F0F11;            /* fundo do app (dark) */
  --paper: #FFFFFF;
  --surface: #18181B;        /* cartões/superfícies */
  --surface-2: #202024;
  --line: rgba(255, 255, 255, 0.08);
  /* --line dá 1.24:1 sobre o cartão: serve pra separar áreas, não pra
     desenhar o limite de um CONTROLE, que a WCAG 1.4.11 pede em 3:1.
     Este valor não é novo — é o mesmo que o botão secundário já usava aqui.
     Passa nos dois fundos do app: 3.23:1 no cartão, 3.19:1 no fundo. */
  --line-control: rgba(255, 255, 255, 0.35);
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.64);
  --text-faint: rgba(255, 255, 255, 0.55); /* 0.45 reprovava no contraste WCAG (4.29:1) */

  --verde: #34D399;
  --amarelo: #FBBF24;
  --vermelho: #F87171;
  --azul: #60A5FA;

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-elevate: 0 12px 32px rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --app-w: 640px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--brand); }

/* ===== Shell ===== */
.shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px 10px;
  position: relative;
}
.topbar-logo { width: 128px; height: auto; display: block; }

.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 0 20px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.progress-track.is-on { opacity: 1; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.45s var(--ease);
}
.progress-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  min-height: 1.2em;
  margin-top: 6px;
}

main.stage {
  flex: 1;
  width: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
}

.footbar {
  text-align: center;
  padding: 14px 20px 20px;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footbar a { color: var(--text-faint); text-decoration: underline; }

/* ===== Screens ===== */
.screen { display: none; flex: 1; flex-direction: column; }
.screen.is-active { display: flex; }

/* entrada suave — só quando o JS confirma que roda (classe .js no html) */
.js .screen.is-active { animation: screenIn 0.45s var(--ease); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .js .screen.is-active { animation: none; }
}

.screen-title {
  font-weight: 800;
  font-size: clamp(1.45rem, 5.4vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.screen-title em { font-style: italic; color: var(--brand); }
/* O app foca o título a cada troca de tela (leitor de tela anuncia a etapa).
   O título não é interativo — anel de foco visual aqui é só ruído. */
.screen-title:focus { outline: none; }
.screen-sub {
  color: var(--text-dim);
  line-height: 1.55;
  font-size: 1rem;
  margin-bottom: 22px;
  max-width: 46ch;
}
.screen-hint {
  color: var(--text-faint);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 10px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.02rem;
  border: none;
  cursor: pointer;
  white-space: normal;
  line-height: 1.25;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
/* Anel de foco — mesma REGRA das duas ferramentas da Decola: 3px, deslocado
   2px, e a cor tem que alcançar 3:1 contra o próprio fundo.
   A cor de propósito NÃO é a mesma nas duas: o laranja da marca dá 7.61:1
   aqui no escuro e só 2.52:1 no branco da página de briefing, onde o anel é
   escuro. Igualar a cor quebraria uma das duas — o que se compartilha é a
   régua, não o valor. */
.btn:focus-visible,
.option:focus-visible,
.chip:focus-visible,
.btn-back:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.btn-primary { background: var(--brand); color: var(--ink); }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(245, 134, 52, 0.45);
  font-weight: 600;
}
.btn-ghost:hover { background: rgba(245, 134, 52, 0.08); }
.btn-quiet {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 600;
  min-height: 42px;
  padding: 9px 18px;
  font-size: 0.88rem;
}
.btn-quiet:hover { border-color: rgba(255, 255, 255, 0.6); background: var(--surface-2); }
.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  text-decoration: underline;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
}
.btn-link:hover { color: var(--text); }
/* Botão de voltar — mesmo controle da página de briefing da Logomarca
   Expresso, na pele escura. As duas são ferramentas da Decola e o cliente
   pode passar pelas duas no mesmo dia: voltar tem que ser a mesma coisa.
   O que era daqui e ficou: a posição no topo à esquerda, que é onde se
   procura voltar num passo a passo.
   O que veio de lá: alvo circular de 48px com contorno (o antigo tinha
   ~42px de largura, abaixo do mínimo de toque, e nenhuma borda — sumia no
   fundo escuro), e a seta que anda pro lado que leva. */
.btn-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px; padding: 0;
  background: transparent;
  border: 1.5px solid var(--line-control);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.2s var(--ease), scale 0.2s var(--ease);
}
.btn-back.is-on { display: inline-flex; }
.btn-back svg { display: block; transition: transform 0.2s var(--ease); }
.btn-back:hover, .btn-back:focus-visible {
  color: var(--text);
  border-color: var(--text);
  background: var(--surface-2);
}
.btn-back:hover svg, .btn-back:focus-visible svg { transform: translateX(-2px); }
.btn-back:active { scale: 0.94; }
@media (prefers-reduced-motion: reduce) {
  .btn-back, .btn-back svg { transition: none; }
  .btn-back:hover svg, .btn-back:focus-visible svg { transform: none; }
  .btn-back:active { scale: 1; }
}

/* ===== Inputs ===== */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 14px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .obs { font-weight: 400; color: var(--text-faint); font-size: 0.85rem; }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus { border-color: rgba(245, 134, 52, 0.6); }
.field-error {
  color: var(--vermelho);
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ===== Opções (estilo / personalidade) ===== */
.options { display: flex; flex-direction: column; gap: 10px; }
/* Borda de CONTROLE, não de cartão: aqui o contorno é o que diz "isto é
   clicável". Com --line ficava em 1.24:1, abaixo dos 3:1 da WCAG 1.4.11. */
.option {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-control);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  min-height: 52px;
}
.option:hover { border-color: rgba(245, 134, 52, 0.5); transform: translateY(-1px); }
.option strong { display: block; font-weight: 700; font-size: 1.02rem; }
.option span { display: block; color: var(--text-dim); font-size: 0.88rem; margin-top: 3px; line-height: 1.4; }
.option[aria-pressed="true"] {
  border-color: var(--brand);
  background: rgba(245, 134, 52, 0.1);
}

/* ===== Método (boas-vindas) ===== */
.method { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 4px; }
.method-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.method-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.method-item p { line-height: 1.45; font-size: 0.95rem; color: var(--text-dim); }
.method-item p strong { color: var(--text); }

/* ===== Loader ===== */
.loader-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 30px 0;
}
.loader-dots { display: flex; gap: 10px; }
.loader-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--brand);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-9px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-dots span { animation: none; opacity: 0.8; }
}
.loader-msg { font-weight: 700; font-size: 1.1rem; min-height: 1.5em; }
.loader-sub { color: var(--text-faint); font-size: 0.9rem; }

/* ===== Cards de nome ===== */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 6px; }
.name-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-elevate);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.name-card:hover { border-color: rgba(245, 134, 52, 0.45); transform: translateY(-2px); }
.name-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.name-card-nome {
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.name-card-tecnica {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  background: rgba(245, 134, 52, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.name-card-porque { color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }
.name-card .btn { align-self: flex-start; margin-top: 4px; }

.cards-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
}

/* ===== Testes ===== */
.test-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: rgba(245, 134, 52, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 12px;
}
.test-nome-vitrine {
  font-weight: 800;
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  letter-spacing: -0.01em;
  color: var(--brand);
  overflow-wrap: anywhere;
  margin: 6px 0 14px;
}

/* ===== Confirmação / contato ===== */
.nome-final {
  background: var(--surface);
  border: 1px solid rgba(245, 134, 52, 0.4);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 26px 18px;
  margin: 8px 0 18px;
}
.nome-final strong {
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
/* Correção de grafia na própria tela. Era um window.prompt, que webview de
   Instagram pode bloquear — e esta é a última chance de acertar a grafia que
   vai pra consulta do INPI. Mesmo tamanho do texto que ele substitui, pra
   nada saltar quando troca. */
.nome-final-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--brand);
  color: inherit;
  font-family: inherit;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  padding: 0 0 4px;
}
.nome-final-input:focus { outline: 2px solid var(--brand); outline-offset: 6px; }
.lgpd-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-faint); font-size: 0.82rem; line-height: 1.5; margin-top: 12px; }
.lgpd-note svg { flex-shrink: 0; margin-top: 2px; }

/* Linha da classe do INPI: informação de conferência, não manchete. Discreta
   de propósito, mas legível (contraste validado). */
.result-classe {
  color: var(--text-faint);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
  margin: 14px auto 0;
  max-width: 46ch;
}

/* ===== Página de resultado ===== */
.result-head { text-align: center; padding: 8px 0 4px; }
.result-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.result-nome {
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  margin: 6px 0 4px;
}
.semaforo {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 20px;
  text-align: center;
  margin: 18px 0;
}
.semaforo-luz {
  width: 74px; height: 74px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.semaforo-luz svg { display: block; }
.semaforo-titulo { font-weight: 800; font-size: 1.35rem; margin-bottom: 6px; }
.semaforo-texto { color: var(--text-dim); line-height: 1.55; font-size: 0.98rem; max-width: 46ch; margin: 0 auto; }
.semaforo.verde .semaforo-luz { background: rgba(52, 211, 153, 0.14); }
.semaforo.verde .semaforo-titulo { color: var(--verde); }
.semaforo.amarelo .semaforo-luz { background: rgba(251, 191, 36, 0.14); }
.semaforo.amarelo .semaforo-titulo { color: var(--amarelo); }
.semaforo.vermelho .semaforo-luz { background: rgba(248, 113, 113, 0.14); }
.semaforo.vermelho .semaforo-titulo { color: var(--vermelho); }
.semaforo.analise .semaforo-luz { background: rgba(96, 165, 250, 0.14); }
.semaforo.analise .semaforo-titulo { color: var(--azul); }

.result-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.result-block h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.result-brief { display: flex; flex-direction: column; gap: 8px; }
.result-brief p { font-size: 0.92rem; line-height: 1.5; color: var(--text-dim); }
.result-brief p strong { color: var(--text); font-weight: 700; }
.finalistas { display: flex; flex-wrap: wrap; gap: 8px; }
.finalista {
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
}
.finalista.is-escolhido { border-color: var(--brand); color: var(--brand); }

.result-cta {
  background: linear-gradient(135deg, rgba(245, 134, 52, 0.16), rgba(245, 134, 52, 0.05));
  border: 1px solid rgba(245, 134, 52, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin: 22px 0 10px;
}
.result-cta h2 { font-weight: 800; font-size: 1.25rem; margin-bottom: 8px; }
.result-cta p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.55; max-width: 44ch; margin: 0 auto 16px; }

.share-row { display: flex; justify-content: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ===== Tablet/desktop ===== */
@media (min-width: 700px) {
  :root { --app-w: 860px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .options.options-2col { display: grid; grid-template-columns: repeat(2, 1fr); }
  .actions { flex-direction: row; align-items: center; }
  .topbar { padding-top: 20px; }
}
@media (min-width: 1080px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* Viewport BAIXO (celular deitado / telas curtas): densidade maior */
@media (max-height: 700px) {
  .screen-title { margin-bottom: 6px; }
  .screen-sub { margin-bottom: 14px; }
  main.stage { padding-top: 12px; }
  .method { gap: 8px; margin-top: 12px; }
  .method-item { padding: 10px 14px; }
}
