/* ═══════════════════════════════════════════════════════════════════
   Neuroesp Design System — aplicação para coleta Tops Esportivos UFMG
   Tokens extraídos de neuroesp-design-system.html
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --blue-700: #0d64a1;
  --blue-600: #1976b8;
  --blue-500: #2f8fd0;
  --blue-300: #94d9ff;
  --blue-100: #e9f7ff;
  --blue-050: #f6fbff;
  --gray-700: #4b5563;
  --gray-500: #7b8794;
  --gray-300: #bcbcbc;
  --gray-200: #dfe5ea;
  --gray-100: #eef3f7;
  --ink: #102235;
  --white: #ffffff;
  --success: #1f9d72;
  --success-soft: #e8f8f2;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --erro: #c2410c;
  --erro-soft: #fff1ee;
  --shadow: 0 18px 48px rgba(13, 100, 161, .10);
  --shadow-sm: 0 8px 24px rgba(16, 34, 53, .035);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --max: 920px;
  --max-wide: 1480px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-700); }
button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--blue-300);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 12px;
  z-index: 80;
  background: var(--blue-700);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 76px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--max-wide), 88vw);
  margin: auto;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--blue-700);
  text-decoration: none;
  min-width: 0;
}
.nav-brand img, .nav-brand svg { width: 36px; height: 36px; flex-shrink: 0; }
.nav-brand img.logo-neuroesp {
  width: auto;
  height: 52px;
  max-width: min(280px, 58vw);
  object-fit: contain;
}
.nav-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-meta {
  color: var(--gray-500);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: right;
}
.nav-meta small { display: block; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--gray-700); margin-top: 2px; }

/* ── Layout ─────────────────────────────────────────────────────── */
.page {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #f8fcff 45%, #eaf7ff 100%);
}
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(13,100,161,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,100,161,.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 72%);
  pointer-events: none;
}
.wrap {
  position: relative;
  width: min(var(--max), 88vw);
  margin: 0 auto;
  padding: 36px 0 72px;
}
.wrap.wide { width: min(var(--max-wide), 96vw); }

.eyebrow, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-700);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before, .section-kicker::before {
  content: "";
  width: 34px;
  height: 3px;
  background: var(--blue-300);
  border-radius: 99px;
}

.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 14px 0 8px;
  color: var(--blue-700);
  font-weight: 800;
}
.hero-sub {
  margin: 0 0 28px;
  color: var(--gray-700);
  font-size: 1.02rem;
  max-width: 640px;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(13,100,161,.10);
  border-radius: 20px;
  padding: 28px 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  margin: 0 0 14px;
  color: var(--blue-700);
  font-size: 1.2rem;
  letter-spacing: -.02em;
}
.card p { margin: 0 0 12px; color: var(--gray-700); text-align: justify; }
.card p:last-child { margin-bottom: 0; }

.fieldset {
  border: 1px solid var(--gray-100);
  background: #fff;
  border-radius: 20px;
  padding: 26px 24px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-sm);
}
.fieldset legend {
  padding: 0 10px;
  font-weight: 800;
  color: var(--blue-700);
  font-size: 1.05rem;
}

/* ── Progress ───────────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 18px; }
.pag-info {
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.progress { display: flex; gap: 8px; }
.progress div {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-100);
}
.progress div.ativo { background: var(--blue-700); }
.progress div.done { background: var(--blue-300); }

/* ── Forms ──────────────────────────────────────────────────────── */
.campo { margin-bottom: 16px; }
.campo > label, .label {
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
  font-size: .95rem;
  color: var(--ink);
}
.hint {
  color: var(--gray-500);
  font-size: .86rem;
  margin: -4px 0 10px;
}
.campo small, .footer-note {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  color: var(--gray-500);
}
.campo .msg { font-size: .82rem; margin-top: 5px; display: block; min-height: 18px; }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: .95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover, select:hover { border-color: var(--blue-300); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(148, 217, 255, .45);
}
input.invalido { border-color: var(--erro); }
input.valido { border-color: var(--success); }
input[readonly] {
  background: var(--gray-100);
  color: var(--ink);
  cursor: default;
}
input[readonly]:hover,
input[readonly]:focus {
  border-color: var(--gray-200);
  box-shadow: none;
}
textarea { min-height: 110px; resize: vertical; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.checkbox-label,
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .95rem;
  cursor: pointer;
  margin: 10px 0;
  padding: 12px 14px;
  background: var(--blue-050);
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  transition: border-color .15s, background .15s;
}
.checkbox-label:hover, .option:hover {
  border-color: var(--blue-300);
  background: var(--blue-100);
}
.checkbox-label:has(input:checked),
.option:has(input:checked) {
  border-color: var(--blue-500);
  background: var(--blue-100);
  box-shadow: 0 0 0 3px rgba(148, 217, 255, .35);
}
.checkbox-label input, .option input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--blue-700);
}

.options { display: grid; gap: 8px; }
.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.inline-options .option,
.inline-options label {
  margin: 0;
  flex: 1 1 140px;
}

.subcard {
  border: 1px dashed var(--blue-300);
  background: var(--blue-050);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

.pesquisador-box, .mini {
  padding: 16px;
  border-radius: 14px;
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  margin: 14px 0;
  font-size: .9rem;
  color: var(--gray-700);
}
.pesquisador-box strong, .mini b { color: var(--blue-700); }

.captcha-box {
  margin: 18px 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
}
.captcha-box strong {
  display: block;
  color: var(--blue-700);
  margin-bottom: 6px;
}
.captcha-box p { margin: 0 0 12px; text-align: left; color: var(--gray-700); font-size: .9rem; }
#cf-widget { min-height: 68px; }
#captcha-status { margin: 10px 0 0; }

.destaque, .alerta, .erro-box, .ok-box {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: .92rem;
}
.destaque { background: var(--blue-100); border-left: 4px solid var(--blue-700); color: var(--ink); }
.alerta { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.erro-box { background: var(--erro-soft); border-left: 4px solid var(--erro); }
.ok-box { background: var(--success-soft); border-left: 4px solid var(--success); }

/* ── Buttons ────────────────────────────────────────────────────── */
.botoes, .actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn, button.primary, button.secondary {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, background .15s, opacity .15s, border-color .15s;
  text-align: center;
}
.btn-primary, button.primary {
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 12px 28px rgba(13,100,161,.20);
  flex: 1;
}
.btn-primary:hover:not(:disabled), button.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #0b5689;
}
.btn-secondary, button.secondary {
  background: #fff;
  color: var(--blue-700);
  border: 1px solid var(--gray-200);
  flex: 1;
}
.btn-secondary:hover, button.secondary:hover {
  border-color: var(--blue-300);
  background: var(--blue-050);
}
.btn:disabled, button:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* ── Tables / likert ────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: .9rem;
  min-width: 480px;
}
th, td {
  border: 1px solid var(--gray-100);
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
}
th:first-child, td:first-child { text-align: left; min-width: 180px; }
thead th {
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.radio-cell label { display: flex; justify-content: center; }

/* ── Image choice ───────────────────────────────────────────────── */
.image-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.image-box {
  border: 1px solid var(--gray-100);
  border-radius: 16px;
  padding: 14px 12px 16px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.image-box:hover { border-color: var(--blue-300); transform: translateY(-2px); }
.image-box:has(input:checked) {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px rgba(148, 217, 255, .55);
}
.image-box img, .image-box svg {
  width: 100%;
  max-width: 180px;
  height: 150px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}
.image-box .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}
.image-box .pair img {
  height: 120px;
  max-width: none;
}
.image-choice.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.image-choice.cols-2 .image-box {
  padding: 14px 12px 16px;
  gap: 10px;
}
.image-choice.cols-2 .pair {
  gap: 10px;
}
.image-choice.cols-2 .image-box img,
.image-choice.cols-2 .pair img {
  width: 100%;
  max-width: none;
  height: min(22vh, 266px);
  min-height: 147px;
  object-fit: contain;
  background: #fff;
}
.image-choice.cols-2 strong {
  font-size: 1.12rem;
}
.image-box strong { display: block; color: var(--blue-700); font-size: .88rem; }
.image-box span { font-size: .78rem; color: var(--gray-500); line-height: 1.35; }
.image-box input { accent-color: var(--blue-700); }

/* ── Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(31,157,114,.10);
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  padding: 36px 0;
  background: var(--blue-700);
  color: #fff;
  margin-top: auto;
}
.footer .wrap { padding: 0; width: min(var(--max-wide), 88vw); }
.footer a { color: var(--blue-300); }
.footer p { margin: 0 0 8px; font-size: .86rem; color: rgba(255,255,255,.88); text-align: left; }
.footer strong { color: #fff; }

/* ── Screen helpers ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.erro-msg { color: var(--erro); font-size: .85rem; margin-top: 6px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--blue-050);
  padding: 1px 6px;
  border-radius: 6px;
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 32px, 88vw); padding-top: 24px; }
  .card { padding: 20px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .botoes, .actions { flex-direction: column; }
  .nav-meta { display: none; }
  .nav-brand img.logo-neuroesp { height: 42px; max-width: 72vw; }
  .hero-title { font-size: 1.55rem; }
  table { font-size: .82rem; }
  .image-choice.cols-2 { grid-template-columns: 1fr; }
  .image-choice.cols-2 .image-box img,
  .image-choice.cols-2 .pair img {
    min-height: 98px;
    height: min(20vh, 196px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover, .image-box:hover { transform: none; }
}

.print-only { display: none !important; }

@media print {
  @page {
    size: A4;
    margin: 14mm 16mm 16mm;
  }

  html, body {
    background: #fff !important;
    color: #111;
    display: block;
    min-height: 0;
    overflow: visible;
    font-size: 11pt;
    line-height: 1.45;
  }

  .skip, .topbar, .footer, .page, .print-hide { display: none !important; }
  .page::before { display: none !important; }

  .print-only {
    display: block !important;
    max-width: none;
  }

  #documento-via p {
    text-align: justify;
    margin: 0 0 9pt;
    color: #111;
  }
  #documento-via h1 {
    font-size: 14pt;
    margin: 0 0 4pt;
    color: #0d64a1;
  }
  #documento-via h2 {
    font-size: 12pt;
    margin: 14pt 0 8pt;
    color: #0d64a1;
    border: none;
    padding: 0;
  }
  .via-cabecalho {
    display: flex;
    align-items: center;
    gap: 14pt;
    border-bottom: 2px solid #0d64a1;
    padding-bottom: 10pt;
    margin-bottom: 12pt;
  }
  .via-cabecalho img {
    height: 42px;
    width: auto;
    max-width: 180px;
  }
  .via-cabecalho p {
    margin: 0;
    text-align: left;
    font-size: 9pt;
    color: #4b5563;
  }
  .via-registro {
    border: 1.5px solid #0d64a1;
    padding: 10pt 12pt;
    margin-top: 14pt;
    break-inside: avoid;
  }
  .via-registro h2 { margin-top: 0; }
  .via-rodape {
    margin-top: 12pt;
    font-size: 8.5pt;
    color: #4b5563;
    border-top: 1px solid #dfe5ea;
    padding-top: 8pt;
  }
  .via-quebra { break-before: page; page-break-before: always; }
  #documento-via .destaque,
  #documento-via .pesquisador-box {
    border: 1px solid #bcbcbc;
    background: #fff;
    box-shadow: none;
    padding: 8pt 10pt;
    margin: 8pt 0;
  }
  a { color: #111; text-decoration: none; }
}
