/* Tela de login da /pesquisa — CAVEAT. CSS puro (CSP: style-src 'self', font-src 'self'). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/pesquisa/fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --preto: #0a0a0b;
  --preto-2: #141416;
  --branco: #fff;
  --amarelo: #f9ca13;
  --cinza: #aeaeb3;
  --cinza-texto: #55555c;   /* 7.3:1 sobre branco */
  --borda: #85858c;         /* 3.6:1 sobre branco (componente de UI) */
  --erro: #b3261e;          /* 6.5:1 sobre branco */
  --erro-fundo: #fdf3f2;
  --fonte: "Archivo", system-ui, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 1rem/1.5 var(--fonte);
  color: var(--preto);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
}

.tela {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ───────── Painel de marca ───────── */
.marca {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 4.5vw, 4rem);
  background: var(--preto);
  color: var(--branco);
  isolation: isolate;
}

.marca-rotulo {
  position: relative;
  z-index: 1;
  margin: 0;
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.marca-rotulo span {
  font-weight: 500;
  color: var(--cinza);
  letter-spacing: 0.08em;
}

.lema {
  position: relative;
  z-index: 1;
  max-width: 11ch;
  margin: 0;
  font-weight: 800;
  font-size: clamp(3rem, 1rem + 4.4vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  word-spacing: 0.06em;
  text-wrap: balance;
}

.lema .ponto {
  color: var(--amarelo);
}

/* Dispositivo gráfico: radar + sinal + glifo liga/desliga */
.sinal {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -14%;
  width: min(78vh, 50vw);
  height: auto;
  transform: translateY(-66%);
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sinal .grade {
  stroke: var(--cinza);
  stroke-width: 0.6;
  opacity: 0.09;
}

.sinal .aneis circle {
  stroke: var(--cinza);
  stroke-width: 1;
  opacity: 0.38;
}

.sinal .aneis .tracejado {
  stroke-dasharray: 2 6;
  opacity: 0.55;
}

.sinal .marcas {
  stroke: var(--cinza);
  stroke-width: 1.2;
  opacity: 0.6;
}

.sinal .setor {
  fill: var(--branco);
  opacity: 0.045;
}

.sinal .pontos circle {
  fill: var(--cinza);
  opacity: 0.8;
}

.sinal .pulso {
  stroke: var(--branco);
  stroke-width: 1.4;
  opacity: 0.85;
}

.sinal .glifo path {
  stroke: var(--branco);
  stroke-width: 6;
}

.sinal .glifo circle {
  fill: var(--amarelo);
}

/* ───────── Formulário ───────── */
.acesso {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 4.5rem);
  background: var(--branco);
}

.acesso-miolo {
  width: 100%;
  max-width: 25rem;
}

.logo {
  display: block;
  width: 7.5rem;
  height: auto;
  margin: 0 0 2.75rem;
}

h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.25rem, 1.6rem + 1.6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.sub {
  margin: 0.875rem 0 2rem;
  max-width: 34ch;
  color: var(--cinza-texto);
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.campo + .campo {
  margin-top: 1.125rem;
}

label {
  display: block;
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--preto);
}

input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  min-height: 3.25rem; /* 52px */
  padding: 0.75rem 0.9rem;
  font: 500 1.0625rem/1.3 var(--fonte);
  color: var(--preto);
  background: var(--branco);
  border: 1.5px solid var(--borda);
  border-radius: 2px;
  outline: 2px solid transparent; /* aparece em modo de alto contraste */
  outline-offset: 2px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:hover,
input[type="password"]:hover {
  border-color: var(--preto);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--preto);
}

/* Foco de estúdio: anel amarelo por dentro, preto por fora (contraste sobre o branco). */
input:focus-visible,
button:focus-visible {
  box-shadow: 0 0 0 3px var(--amarelo), 0 0 0 5px var(--preto);
}

input:disabled {
  color: #6b6b72;
  background: #f2f2f3;
  border-color: #c9c9cd;
  cursor: not-allowed;
}

/* Preenchimento automático do navegador sem o fundo amarelado padrão */
input:-webkit-autofill {
  -webkit-text-fill-color: var(--preto);
  -webkit-box-shadow: 0 0 0 40px var(--branco) inset;
}

input:-webkit-autofill:focus-visible {
  -webkit-box-shadow: 0 0 0 40px var(--branco) inset, 0 0 0 3px var(--amarelo), 0 0 0 5px var(--preto);
}

/* ───────── Erro ───────── */
.erro {
  margin: 0;
}

.erro:empty {
  display: none;
}

.erro:not(:empty) {
  margin-top: 1.25rem;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--erro);
  background: var(--erro-fundo);
  border-left: 3px solid var(--erro);
}

form:has(.erro:not(:empty)) input:not(:focus):not([type="hidden"]) {
  border-color: var(--erro);
}

/* ───────── Botão ───────── */
button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.5rem; /* 56px */
  margin-top: 1.5rem;
  padding: 0 1.1rem 0 1.25rem;
  font: 800 1.0625rem/1 var(--fonte);
  letter-spacing: -0.005em;
  color: var(--branco);
  background: var(--preto);
  border: 0;
  border-radius: 2px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease, transform 120ms ease, box-shadow 140ms ease;
}

button .seta {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--amarelo);
  stroke-width: 2;
  stroke-linecap: square;
  transition: transform 180ms ease;
}

button:hover {
  background: #26262b;
}

button:hover .seta {
  transform: translateX(3px);
}

button:active {
  transform: scale(0.985);
  background: #000;
}

button:disabled {
  color: #d7d7da;
  background: #6b6b72;
  cursor: not-allowed;
  transform: none;
}

button:disabled .seta {
  stroke: currentColor;
  transform: none;
}

.ajuda {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e3e3e6;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cinza-texto);
  text-wrap: pretty;
}

/* ───────── Entrada (uma vez, discreta) ───────── */
@media (prefers-reduced-motion: no-preference) {
  .sinal .pulso {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: tracar 900ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards;
  }

  .sinal .aneis,
  .sinal .marcas {
    transform-box: view-box;
    transform-origin: 300px 300px;
    animation: abrir 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes tracar {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes abrir {
  from {
    opacity: 0;
    transform: scale(0.94) rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  button:active {
    transform: none;
  }
}

/* ───────── Tablet e celular: marca no topo ───────── */
@media (max-width: 900px) {
  .tela {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .marca {
    min-height: clamp(8.5rem, 34vh, 22rem);
    padding: 1.5rem clamp(1.25rem, 6vw, 3rem);
    gap: 1.5rem;
  }

  .sinal {
    right: -12%;
    width: min(64vw, 30rem);
    transform: translateY(-43%);
  }

  .lema {
    font-size: clamp(1.75rem, 0.6rem + 5.4vw, 3.75rem);
    max-width: 12ch;
  }

  .acesso {
    padding: 2.5rem clamp(1.25rem, 6vw, 3rem) 3rem;
  }

  .logo {
    display: none;
  }
}

@media (max-width: 520px) {
  .marca {
    min-height: 0;
    padding: 1rem 1.25rem 1.125rem;
    gap: 0.875rem;
  }

  .marca-rotulo {
    font-size: 0.75rem;
  }

  .sinal {
    top: 0;
    right: -20%;
    width: 15rem;
    transform: translateY(-22%);
    opacity: 0.7;
  }

  .lema {
    font-size: 1.5rem;
    line-height: 1;
    max-width: 14ch;
  }

  .acesso {
    align-items: flex-start;
    padding: 1.25rem 1.25rem 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .sub {
    margin: 0.375rem 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
  }

  label {
    margin-bottom: 0.3rem;
  }

  .campo + .campo {
    margin-top: 0.75rem;
  }

  button {
    margin-top: 1rem;
  }

  .erro:not(:empty) {
    margin-top: 0.75rem;
    padding: 0.55rem 0.75rem;
  }

  .ajuda {
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (forced-colors: active) {
  .sinal {
    display: none;
  }

  button {
    border: 2px solid ButtonText;
  }
}

/* ───────── Escolha de entrada (Entrevista ou Apuração) ───────── */
.portas {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.porta {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "t seta"
    "d seta";
  align-items: center;
  gap: 0.25rem 1rem;
  min-height: 5.25rem;
  padding: 1rem 1.1rem 1rem 1.25rem;
  color: var(--branco);
  background: var(--preto);
  border-radius: 2px;
  text-decoration: none;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: background-color 160ms ease, transform 120ms ease;
}
.porta-2 {
  color: var(--preto);
  background: var(--branco);
  box-shadow: inset 0 0 0 2px var(--preto);
}
.porta-t {
  grid-area: t;
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.porta-d {
  grid-area: d;
  font-size: 0.875rem;
  opacity: 0.8;
}
.porta .seta {
  grid-area: seta;
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--amarelo);
  stroke-width: 2;
  stroke-linecap: square;
  transition: transform 180ms ease;
}
.porta-2 .seta {
  stroke: var(--preto);
}
.porta:hover .seta {
  transform: translateX(3px);
}
.porta:hover {
  background: #26262b;
}
.porta-2:hover {
  background: #f1f1f3;
}
.porta:focus-visible,
.porta-volta a:focus-visible {
  outline-color: var(--amarelo);
}
.porta:active {
  transform: scale(0.985);
}
.porta-volta {
  margin: -1rem 0 1.25rem;
}
.porta-volta a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--preto);
  font-weight: 700;
  font-size: 0.9375rem;
  text-underline-offset: 3px;
}
.aviso {
  margin: -1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--amarelo);
  background: #fff8db;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.porta-3 {
  color: var(--preto);
  background: #fff8db;
  box-shadow: inset 0 0 0 2px var(--amarelo);
}
.porta-3 .seta {
  stroke: var(--preto);
}
.porta-3:hover {
  background: #fff1b8;
}
