/* =========================================================
   ALTITUDE V31 — CABEÇALHO PÚBLICO ÚNICO
   Mesmas cores e alinhamento em Início, Cursos, Certificados,
   Sobre Nós, Ajuda, Login, Cadastro e páginas legais.
   ========================================================= */

:root {
  --v31-header-navy: #07314f;
  --v31-header-cyan: #38b1cb;
  --v31-header-soft: #edf8fb;
  --v31-header-line: #d8e6ef;
}

.old-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  display: block !important;
  width: 100% !important;
  padding: 0 22px !important;
  border-bottom: 1px solid var(--v31-header-line) !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 5px 18px rgba(7, 49, 79, .07) !important;
  backdrop-filter: blur(10px);
}

.old-header .top-bar {
  display: grid !important;
  grid-template-columns: 190px minmax(0, 1fr) 190px !important;
  align-items: center !important;
  gap: 16px !important;
  width: min(1200px, 100%) !important;
  min-height: 72px !important;
  margin: 0 auto !important;
}

.old-header .institution-logo,
.old-header .institution-logo a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
}

.old-header .institution-logo .logo {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 150px !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  transform: none !important;
  object-fit: contain !important;
}

.old-header .navbar {
  min-width: 0 !important;
  margin: 0 !important;
  justify-self: center !important;
}

.old-header .navbar ul {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.old-header .navbar li {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.old-header .navbar a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  color: var(--v31-header-cyan) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.old-header .navbar a:hover,
.old-header .navbar a:focus-visible {
  color: var(--v31-header-navy) !important;
  background: var(--v31-header-soft) !important;
  box-shadow: none !important;
}

.old-header .header-buttons {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.old-header .header-buttons .btn-outline,
.old-header .header-buttons .btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.old-header .header-buttons .btn-outline {
  border: 2px solid var(--v31-header-cyan) !important;
  color: var(--v31-header-cyan) !important;
  background: #fff !important;
}

.old-header .header-buttons .btn-primary {
  border: 2px solid var(--v31-header-cyan) !important;
  color: #fff !important;
  background: var(--v31-header-cyan) !important;
}

.old-header .header-buttons .btn-outline:hover,
.old-header .header-buttons .btn-outline:focus-visible,
.old-header .header-buttons .btn-primary:hover,
.old-header .header-buttons .btn-primary:focus-visible {
  border-color: var(--v31-header-navy) !important;
  color: #fff !important;
  background: var(--v31-header-navy) !important;
}

/* Evita espaço fantasma entre o cabeçalho e o conteúdo. */
body > .old-header + main,
body > .new-header + .old-header + main {
  margin-top: 0 !important;
}

/* Cabeçalho móvel também usa a mesma identidade. */
.new-header {
  min-height: 66px !important;
  padding: 8px 14px !important;
  border-bottom: 1px solid var(--v31-header-line) !important;
  background: #fff !important;
  box-shadow: 0 4px 16px rgba(7, 49, 79, .08) !important;
}

.new-header .logo img {
  width: 138px !important;
  max-height: 48px !important;
  object-fit: contain !important;
}

.new-header .menu-icon {
  position: relative !important;
  inset: auto !important;
  width: 42px !important;
  height: 42px !important;
  padding: 6px !important;
}

.new-header .menu-icon > img {
  position: static !important;
  inset: auto !important;
  width: 28px !important;
  height: 28px !important;
}

@media (max-width: 1080px) {
  .old-header .top-bar {
    grid-template-columns: 150px minmax(0, 1fr) 176px !important;
    gap: 10px !important;
  }

  .old-header .institution-logo .logo {
    width: 135px !important;
  }

  .old-header .navbar a {
    padding: 0 9px !important;
    font-size: 13px !important;
  }

  .old-header .header-buttons .btn-outline,
  .old-header .header-buttons .btn-primary {
    padding: 0 11px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 900px) {
  .old-header {
    display: none !important;
  }

  .new-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    align-items: center !important;
  }
}
