/* ==========================================================================
   Devacancy — base: tokens, reset, tipografia e utilitários
   ========================================================================== */

:root {
  /* Identidade: azul profundo (confiança) + azul elétrico/ciano (tecnologia); verde só para progresso;
     laranja reservado aos botões de ação, para o olho ir direto ao próximo passo. */
  --fundo: #f6f8fb;
  --fundo-2: #eef2f8;
  --superficie: #ffffff;
  --superficie-2: #f4f7fb;
  --superficie-vidro: rgba(255, 255, 255, .86);
  --borda: #e4e9f1;
  --borda-forte: #d0d8e5;

  --texto: #0a1426;
  --texto-2: #334155;
  --texto-suave: #64748b;

  --marinho: #0a1733;
  --marinho-2: #102454;
  --primaria: #2563eb;
  --primaria-forte: #1d4ed8;
  --primaria-suave: rgba(37, 99, 235, .08);
  --eletrico: #3b82f6;
  --ciano: #06b6d4;
  --ciano-suave: rgba(6, 182, 212, .1);
  --sucesso: #15803d;
  --sucesso-vivo: #16a34a;
  --sucesso-suave: rgba(22, 163, 74, .1);
  --alerta: #b45309;
  --alerta-suave: rgba(245, 158, 11, .14);
  --erro: #dc2626;
  --erro-suave: rgba(220, 38, 38, .08);

  --acao: #f97316;
  --acao-forte: #ea580c;
  --brilho-acao: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -8px rgba(234, 88, 12, .55);

  --gradiente: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #0891b2 100%);
  --gradiente-texto: linear-gradient(100deg, #1d4ed8 0%, #2563eb 45%, #0891b2 100%);
  --gradiente-marinho: linear-gradient(150deg, #0a1733 0%, #0f2557 60%, #11307a 100%);

  --raio-sm: 8px;
  --raio: 12px;
  --raio-lg: 16px;
  --raio-xl: 22px;

  --sombra-sm: 0 1px 2px rgba(10, 20, 38, .06);
  --sombra: 0 1px 2px rgba(10, 20, 38, .04), 0 6px 20px -8px rgba(10, 20, 38, .1);
  --sombra-lg: 0 2px 6px rgba(10, 20, 38, .04), 0 24px 56px -18px rgba(10, 20, 38, .2);
  --sombra-azul: 0 18px 40px -20px rgba(29, 78, 216, .45);
  --brilho-primaria: 0 0 0 4px rgba(37, 99, 235, .16);

  /* Escala tipográfica (mobile-first; os títulos crescem com a tela). */
  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-base: 1rem;
  --t-lg: 1.125rem;
  --t-xl: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --t-2xl: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  --t-3xl: clamp(2.1rem, 1.5rem + 2.8vw, 3.5rem);

  --fonte: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fonte-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --largura: 1180px;
  --transicao: .2s cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

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

/* O atributo hidden sempre esconde, mesmo em componentes com display próprio (botões, painéis em grid). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  min-height: 100vh;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--texto);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.028em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(37, 99, 235, .18);
  color: var(--texto);
}

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

/* Respeita quem pede menos movimento: sem animações nem transições longas. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0 20px;
}

.texto-gradiente {
  background: var(--gradiente-texto);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: var(--fonte-mono);
}

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

/* ---------- Ícones ---------- */
.icone {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.icone-sm {
  width: 16px;
  height: 16px;
}

.icone-lg {
  width: 24px;
  height: 24px;
}

/* ---------- Botões ---------- */
.botao {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--raio);
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: -.011em;
  white-space: nowrap;
  user-select: none;
  transition: background var(--transicao), border-color var(--transicao), box-shadow var(--transicao), transform var(--transicao), color var(--transicao), opacity var(--transicao);
  -webkit-tap-highlight-color: transparent;
}

.botao:active {
  transform: translateY(1px) scale(.985);
}

.botao:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--superficie), 0 0 0 4px var(--primaria);
}

.botao:disabled,
.botao[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.botao .icone {
  width: 18px;
  height: 18px;
  transition: transform var(--transicao);
}

.botao:hover .icone-seta {
  transform: translateX(3px);
}

/* Botão de ação (CTA): a única coisa laranja da página. */
.botao-primario {
  background: linear-gradient(180deg, #fb8b3c 0%, var(--acao) 50%, var(--acao-forte) 100%);
  border-color: rgba(194, 65, 12, .5);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--brilho-acao);
  text-shadow: 0 1px 0 rgba(154, 52, 18, .3);
}

.botao-primario:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--acao) 0%, var(--acao-forte) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 16px 32px -10px rgba(234, 88, 12, .6);
  transform: translateY(-1px);
}

.botao-primario:focus-visible {
  box-shadow: 0 0 0 2px var(--superficie), 0 0 0 4px var(--acao-forte), var(--brilho-acao);
}

/* Botão sólido escuro (ações secundárias de destaque, como "Sou empresa"). */
.botao-claro {
  background: var(--marinho);
  color: #fff;
}

.botao-claro:hover {
  background: var(--marinho-2);
}

.botao-secundario {
  background: var(--superficie);
  border-color: var(--borda-forte);
  color: var(--texto);
  box-shadow: var(--sombra-sm);
}

.botao-secundario:hover:not(:disabled) {
  border-color: #b9c4d6;
  background: var(--superficie-2);
}

.botao-fantasma {
  color: var(--texto-2);
}

.botao-fantasma:hover:not(:disabled) {
  color: var(--texto);
  background: rgba(10, 20, 38, .045);
}

.botao-grande {
  height: 52px;
  padding: 0 26px;
  font-size: 1rem;
  border-radius: 14px;
}

.botao-pequeno {
  height: 36px;
  padding: 0 12px;
  font-size: .86rem;
  border-radius: 10px;
}

.botao-bloco {
  width: 100%;
}

/* No celular o texto do botão quebra linha em vez de vazar da tela. */
@media (max-width: 600px) {
  .botao {
    height: auto;
    min-height: 44px;
    padding-block: 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .botao-grande {
    min-height: 52px;
  }

  .botao-pequeno {
    min-height: 36px;
    padding-block: 6px;
  }
}

/* Estado de carregamento do HTMX */
.botao .carregando {
  display: none;
}

.htmx-request .botao[type="submit"] .carregando,
.botao.htmx-request .carregando {
  display: inline-block;
}

.htmx-request .botao[type="submit"] .rotulo-botao,
.htmx-request .botao[type="submit"] .icone-seta {
  opacity: .7;
}

.carregando {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: girar .7s linear infinite;
}

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

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.rotulo-botao {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Ação com menos peso (um botão por cartão): mesma cor do CTA, sem o preenchimento. */
.botao-acao-suave {
  border: 1.5px solid var(--acao);
  background: #fff7ed;
  color: var(--acao-forte);
  font-weight: 700;
}

.botao-acao-suave:hover {
  background: var(--acao);
  color: #fff;
  box-shadow: var(--brilho-acao);
}

/* ---------- Celular: sem rolagem lateral e sem zoom automático ---------- */
/* "hidden" no html impede scroll lateral em iOS/Android (clip não cria scroll container então o touch
   rubber-band ainda revela o overflow). body mantém "clip" para não criar novo scroll container e
   não quebrar position:sticky dos elementos dentro do body. */
html {
  overflow-x: hidden;
}

body {
  overflow-x: clip;
}

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

/* Toque duplo não dá zoom em botões, opções e links (o toque fica imediato). */
a,
button,
label,
input,
select,
textarea {
  touch-action: manipulation;
}

/* O iPhone dá zoom ao focar campos com fonte menor que 16px: no celular, todos ficam com 16px. */
@media (max-width: 900px) {
  input,
  select,
  textarea,
  .entrada,
  .selecao,
  .area-texto {
    font-size: 16px !important;
  }
}
