/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 200ms, opacity 200ms, transform 100ms;
  min-height: 48px;
  min-width: 44px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--cta);
  color: #fff;
}

.btn-primary:hover {
  background: var(--cta-hover);
}

.btn-primary:disabled {
  background: var(--cta);
  color: #fff;
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.loading:disabled {
  background: var(--cta);
  color: #fff;
  opacity: 1;
  cursor: wait;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn-secondary:hover {
  background: rgba(39, 32, 26, 0.05);
}

/* Voltar/Editar pedido no padrão do redesign: sem borda/fundo, seta em SVG. */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
}

.btn-link svg {
  flex: none;
}

.btn-full {
  width: 100%;
}

.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: none;
  /* Ocupa a mesma altura da linha de texto normal (1rem × 1.6): sem isso o
     botão encolhe ao entrar em loading quando o texto some. */
  margin-block: calc((1.6rem - 18px) / 2);
}

.btn.loading .spinner {
  display: block;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading[data-loading-text] .btn-text {
  display: inline;
  font-size: 0.85rem;
  font-weight: 500;
  /* Mantém a caixa de linha do texto normal para o botão não mudar de altura. */
  line-height: 1.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn.loading .btn-arrow {
  display: none;
}

/* O CTA da landing é largo (width:100%): manter a fonte do estado de loading
   igual à do texto normal para o botão não mudar de altura ao clicar. */
.cnpj-block__submit.loading[data-loading-text] .btn-text {
  font-size: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Shine periódico do CTA de consulta na landing (vt-btn-shine do redesign).
   No redesign só esse botão brilha; os demais CTAs são lisos. */
.cnpj-block__submit {
  position: relative;
  overflow: hidden;
}

.cnpj-block__submit::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
  filter: blur(2px);
  animation: vt-btn-shine 4.5s ease-in-out infinite;
  pointer-events: none;
}

.cnpj-block__submit:disabled::before,
.cnpj-block__submit.loading::before {
  display: none;
}

@keyframes vt-btn-shine {
  0%,
  32% {
    transform: translateX(-60px) skewX(-20deg);
  }

  60% {
    transform: translateX(480px) skewX(-20deg);
  }

  100% {
    transform: translateX(480px) skewX(-20deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnpj-block__submit::before {
    display: none;
  }
}

/* ===== TOAST & ERRORS ===== */
.field-error {
  color: var(--cta);
  font-size: 0.84rem;
  margin-top: 6px;
  display: none;
}

.field-error.visible {
  display: block;
}

.toast {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(-150px);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  max-width: calc(100% - 32px);
  width: max-content;
  text-align: center;
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  line-height: 1.4;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}

.toast.info {
  background: var(--ink);
  color: #fff;
}

.toast.error {
  background: var(--cta);
  color: #fff;
}

.update-notice {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  background: rgba(39, 32, 26, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  animation: updateNoticeFade 280ms ease both;
}

@keyframes updateNoticeFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.update-notice-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 420px;
  letter-spacing: 0.01em;
}

.update-notice-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 32px;
  background: var(--cta);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: background 160ms ease, transform 160ms ease;
}

.update-notice-btn:hover,
.update-notice-btn:focus-visible {
  background: var(--cta-hover);
}

.update-notice-btn:active {
  transform: scale(0.97);
}


@media (prefers-reduced-motion: reduce) {
  .update-notice {
    animation: none;
  }
}
