/* ============================================================
   Scrutiny — Design System
   Padrão: Vercel · Linear · Resend
   Técnicas: dot grid, radial glow, tipografia precisa
============================================================ */

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

:root {
  --bg: #080b10;
  --surface-1: #0d1117;
  --surface-2: #161b22;
  --surface-3: #1e242d;

  --border-faint: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-1: #f0f6fc;
  --text-2: #8d96a0;
  --text-3: #555f6b;

  --accent: #4493f8;
  --accent-soft: rgba(68, 147, 248, 0.12);
  --accent-glow: rgba(68, 147, 248, 0.18);
  --green: #3fb950;
  --red: #f85149;

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", monospace;

  --r1: 4px;
  --r2: 6px;
  --r3: 10px;
  --r4: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Grade de pontos estilo Vercel */
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%,
      rgba(68, 147, 248, 0.1) 0%,
      transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size:
    100% 100%,
    24px 24px;
  background-attachment: fixed;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(8, 11, 16, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-faint);
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--r1);
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(68, 147, 248, 0.4);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: var(--r2);
  transition:
    color 0.12s,
    background 0.12s;
}

.nav-link:hover {
  color: var(--text-1);
  background: var(--surface-3);
}

/* ============================================================
   LAYOUT PRINCIPAL
============================================================ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 20px 80px;
}

/* ============================================================
   HERO — centralizado verticalmente na tela
============================================================ */
.hero-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 560px;
  min-height: calc(100vh - 52px - 52px);
  padding: 48px 0 32px;
  gap: 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(68, 147, 248, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 26px;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 2.5s ease infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

/* Título */
.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  color: var(--text-1);
  margin-bottom: 16px;
  /* Sem quebra de linha estranha — deixa fluir */
  max-width: 480px;
}

/* Subtítulo */
.hero-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto 32px;
}

/* ============================================================
   TABS DE MODO
============================================================ */
.mode-tabs {
  display: flex;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r3);
  padding: 3px;
  margin-bottom: 12px;
  gap: 2px;
}

.mode-tab {
  position: relative;
  flex: 1;
}

.mode-tab input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tab-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition:
    color 0.15s,
    background 0.15s;
}

.tab-label:hover {
  color: var(--text-1);
}

.mode-tab input:checked+.tab-label {
  background: var(--surface-1);
  color: var(--text-1);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px var(--border-default);
}

/* ============================================================
   FORMULÁRIO
============================================================ */
.form-card {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--r4);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-wrap {
  position: relative;
  flex: 1;
}

.input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 13px;
  pointer-events: none;
}

.main-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 32px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r2);
  color: var(--text-1);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.main-input::placeholder {
  color: var(--text-3);
}

.main-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface-1);
}

.btn-run {
  height: 40px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    opacity 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  box-shadow: 0 0 0 1px rgba(68, 147, 248, 0.3);
}

.btn-run:hover {
  opacity: 0.88;
  box-shadow: 0 0 16px rgba(68, 147, 248, 0.35);
}

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

.btn-run:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   INDICADORES DE CONFIANÇA
============================================================ */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.trust-item i {
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   FEEDBACK — ERRO
============================================================ */
.error-strip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(248, 81, 73, 0.07);
  border: 1px solid rgba(248, 81, 73, 0.22);
  border-radius: var(--r2);
  color: var(--red);
  font-size: 12.5px;
  width: 100%;
  margin-top: 12px;
}

.error-strip.visible {
  display: flex;
}

/* ============================================================
   LOADER
============================================================ */
.loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 20px;
  width: 100%;
}

.loader.visible {
  display: flex;
}

.loader-ring {
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loader-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.loader-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ============================================================
   PAINEL DE RESULTADO
============================================================ */
.result-panel {
  display: none;
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--border-default);
  border-radius: var(--r4);
  overflow: hidden;
  margin-top: 16px;
  animation: up 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.result-panel.visible {
  display: block;
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-faint);
}

.result-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.result-body {
  padding: 20px;
  background: var(--surface-1);
}

/* HTML gerado pela IA */
.result-body h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-faint);
}

.result-body h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  margin: 16px 0 6px;
  font-family: var(--mono);
}

.result-body p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 8px;
}

.result-body ul {
  padding-left: 0;
  list-style: none;
  margin-bottom: 8px;
}

.result-body li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.result-body li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-3);
}

.result-body strong {
  color: var(--text-1);
  font-weight: 600;
}

.result-body a {
  color: var(--accent);
  text-decoration: none;
}

.result-body a:hover {
  text-decoration: underline;
}

.result-body div[style*="border"] {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-faint) !important;
  border-radius: var(--r3) !important;
  padding: 14px 16px !important;
  margin-bottom: 10px !important;
}

/* ============================================================
   FOOTER
============================================================ */
footer {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-faint);
  color: var(--text-3);
  font-size: 12px;
  background: rgba(8, 11, 16, 0.6);
  backdrop-filter: blur(8px);
}

footer a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.12s;
}

footer a:hover {
  color: var(--accent);
}

/* ============================================================
   RESPONSIVO MOBILE
   Corrige: espaço em branco no hero, input/botão pequenos,
   padding excessivo no main.
============================================================ */
@media (max-width: 768px) {

  /* Remove min-height e centralização vertical — eram os culpados
     do espaço em branco gigante acima e abaixo do conteúdo */
  .hero-wrap {
    min-height: 0;
    justify-content: flex-start;
    padding: 24px 0 24px;
  }

  /* Reduz padding lateral e inferior do main */
  main {
    padding: 0 16px 40px;
  }

  .badge {
    margin-bottom: 18px;
  }

  .hero-title {
    font-size: 26px;
    letter-spacing: -0.8px;
  }

  .hero-sub {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .navbar {
    padding: 0 16px;
  }

  /* Input e botão empilhados — ocupa largura total */
  .input-row {
    flex-direction: column;
    gap: 8px;
  }

  .input-wrap {
    width: 100%;
  }

  /* Input mais alto para toque confortável */
  .main-input {
    height: 48px;
    font-size: 15px;
  }

  /* Botão Analisar — largura total e altura confortável */
  .btn-run {
    width: 100%;
    height: 48px;
    justify-content: center;
    font-size: 15px;
  }

  .trust-row {
    gap: 12px;
  }
}

/* ============================================================
   CAMPO DE VAGA — colapsável (progressive disclosure)
============================================================ */
.job-toggle-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-faint);
}

.job-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
  font-family: var(--font);
}

.job-toggle-btn:hover {
  color: var(--text-2);
}

.job-toggle-btn.active {
  color: var(--accent);
}

.job-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.job-toggle-btn.active .job-toggle-icon {
  transform: rotate(45deg);
}

.job-toggle-badge {
  font-size: 10px;
  background: var(--surface-3);
  color: var(--text-3);
  padding: 1px 7px;
  border-radius: 100px;
  border: 1px solid var(--border-faint);
}

.job-field {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    margin 0.3s ease;
  margin-top: 0;
}

.job-field.open {
  max-height: 200px;
  opacity: 1;
  margin-top: 10px;
}

.job-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--r2);
  color: var(--text-1);
  font-size: 12.5px;
  font-family: var(--font);
  line-height: 1.6;
  padding: 10px 12px;
  resize: none;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.job-textarea::placeholder {
  color: var(--text-3);
  font-size: 12px;
}

.job-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   SCORE CARD
============================================================ */
.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 20px;
  padding: 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-default);
}

.score-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-right: 20px;
  border-right: 1px solid var(--border-faint);
  min-width: 90px;
}

.score-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}

.score-number {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.score-max {
  font-size: 16px;
  color: var(--text-3);
  font-weight: 500;
}

.score-level {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.score-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar-label {
  font-size: 11.5px;
  color: var(--text-3);
  min-width: 88px;
}

.score-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-bar-val {
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: right;
}

.score-resumo {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-faint);
  line-height: 1.5;
}

/* Cor do score por faixa */
.score-number.high {
  color: var(--green);
}

.score-number.medium {
  color: #d29922;
}

.score-number.low {
  color: var(--red);
}

@media (max-width: 480px) {
  .score-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .score-left {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-faint);
    padding-right: 0;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
}