/* EstudeGrátis Brasil — Estilos, Tema Brasil & Acessibilidade */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --br-green: #009639;
  --br-green-dark: #00702a;
  --br-green-light: #e8f5e9;
  --br-yellow: #ffcc29;
  --br-yellow-dark: #d97706;
  --br-blue: #002776;
  --br-blue-dark: #001a4e;
  --br-blue-light: #e0f2fe;
}

/* Base de Foco para Acessibilidade Total (Teclado) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffcc29 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(0, 150, 57, 0.4) !important;
}

/* Modos de Tamanho de Fonte (Acessibilidade) */
html.font-size-small { font-size: 87.5%; }    /* 14px base */
html.font-size-normal { font-size: 100%; }    /* 16px base */
html.font-size-large { font-size: 112.5%; }   /* 18px base */
html.font-size-xlarge { font-size: 125%; }    /* 20px base */

/* Modo Alto Contraste (Acessibilidade para Baixa Visão) */
html.high-contrast {
  filter: contrast(110%);
}

html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.high-contrast header,
html.high-contrast main,
html.high-contrast footer,
html.high-contrast section,
html.high-contrast article,
html.high-contrast .course-card,
html.high-contrast div,
html.high-contrast nav {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

html.high-contrast a,
html.high-contrast button {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast a:hover,
html.high-contrast button:hover {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

html.high-contrast input,
html.high-contrast select,
html.high-contrast textarea {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

/* Barra de rolagem suave e discreta */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Transições de elementos */
.course-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  will-change: transform, box-shadow;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -8px rgba(0, 39, 118, 0.08), 0 8px 16px -6px rgba(0, 150, 57, 0.06);
}

/* Espaçamento inferior mobile para a Barra de Navegação Inferior */
@media (max-width: 767.98px) {
  body {
    padding-bottom: 64px;
  }
}

/* Animações */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInSlide 0.25s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================================
   ESTILOS DE ACESSIBILIDADE & SEPARAÇÃO TOTAL DE WIDGETS
   ============================================================== */
/* Ajustes no posicionamento do VLibras */
[vw] {
  z-index: 99999 !important;
}

/* Widget Flutuante de Acessibilidade Visual */
#visual-accessibility-widget {
  position: fixed;
  z-index: 99998;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* No Mobile (< 768px): Posicionado na lateral ESQUERDA da tela para NÃO colidir com o VLibras que fica na DIREITA */
@media (max-width: 767px) {
  #visual-accessibility-widget {
    left: 0 !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  #visual-accessibility-toggle-btn {
    border-radius: 0 1rem 1rem 0 !important;
    border-left: 0 !important;
    border-right: 2px solid #ffcc29 !important;
    border-top: 2px solid #ffcc29 !important;
    border-bottom: 2px solid #ffcc29 !important;
    padding: 0.5rem 0.55rem 0.5rem 0.4rem !important;
    box-shadow: 2px 4px 16px rgba(0, 39, 118, 0.28) !important;
  }

  #visual-accessibility-toggle-btn:hover {
    padding-left: 0.4rem !important;
    padding-right: 0.85rem !important;
  }
}

/* No Desktop (>= 768px): Posicionado na lateral DIREITA, com margem vertical garantida abaixo do VLibras */
@media (min-width: 768px) {
  #visual-accessibility-widget {
    right: 0 !important;
    left: auto !important;
    top: calc(50vh + 35px) !important;
    transform: none !important;
  }

  #visual-accessibility-toggle-btn {
    border-radius: 1rem 0 0 1rem !important;
    border-right: 0 !important;
    border-left: 2px solid #ffcc29 !important;
    border-top: 2px solid #ffcc29 !important;
    border-bottom: 2px solid #ffcc29 !important;
  }
}

#visual-accessibility-backdrop {
  z-index: 2147483640;
}

#visual-accessibility-panel {
  z-index: 2147483645;
  box-shadow: 0 25px 50px -12px rgba(0, 39, 118, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Garante alto contraste em todos os elementos de acessibilidade */
html.high-contrast #visual-accessibility-widget button {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

html.high-contrast #visual-accessibility-panel {
  background-color: #000000 !important;
  border-color: #ffff00 !important;
  color: #ffffff !important;
}

html.high-contrast #visual-accessibility-panel div,
html.high-contrast #visual-accessibility-panel button {
  background-color: #000000 !important;
  border-color: #ffff00 !important;
  color: #ffffff !important;
}

/* ==============================================================
   RESPONSIVIDADE MOBILE & REFINAMENTOS DE LAYOUT (PORTAL VCPDTD)
   ============================================================== */
html, body {
  overflow-x: hidden !important;
  max-width: 100%;
  width: 100%;
}

/* Touch targets ergonômicos e acessíveis em dispositivos móveis */
@media (max-width: 640px) {
  button, 
  a.course-access-link, 
  select, 
  input {
    min-height: 42px;
  }

  /* Melhor aproveitamento da grade de cursos em smartphones */
  #courses-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .course-card {
    padding: 1rem;
  }
}

/* Rolagem horizontal suave para barra de categorias */
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* ==============================================================
   MENUS EM DROPDOWN MULTINÍVEL RECOLHÍVEIS (DESKTOP & MOBILE)
   ============================================================== */
.nav-cascata {
  position: relative;
}

/* Nível 2: Dropdown principal */
.nav-cascata-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.35rem;
  z-index: 50;
  animation: fadeInDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ponte invisível para evitar perda de foco/hover entre o botão e o dropdown */
.nav-cascata-menu::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-cascata-menu.nav-cascata-right {
  left: auto;
  right: 0;
}

/* Exibição controlada estritamente por classe .is-open para permitir recolhimento perfeito */
.nav-cascata.is-open > .nav-cascata-menu {
  display: block;
}

.nav-cascata.is-open > button .nav-cascata-arrow,
.nav-cascata.is-open > div > button .nav-cascata-arrow {
  transform: rotate(180deg);
}

.nav-cascata-arrow {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Nível 3: Submenus multinível recolhíveis */
.nav-submenu {
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.nav-submenu-content {
  display: none;
  overflow: hidden;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid #e2e8f0;
}

.nav-submenu.is-expanded > .nav-submenu-content {
  display: block;
  animation: fadeInDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-submenu-arrow {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-submenu.is-expanded > div > button .nav-submenu-arrow,
.nav-submenu.is-expanded > button .nav-submenu-arrow,
.nav-submenu.is-expanded > .nav-submenu-trigger .nav-submenu-arrow {
  transform: rotate(180deg);
}

/* Accordions Mobile Recolhíveis */
.nav-mobile-accordion-content {
  display: none;
}
.nav-mobile-accordion.is-expanded > .nav-mobile-accordion-content {
  display: block;
  animation: fadeInDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-mobile-accordion.is-expanded .nav-mobile-accordion-arrow {
  transform: rotate(180deg);
}
.nav-mobile-accordion-arrow {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================================
   FOLHA DE ESTILO PARA IMPRESSÃO LIMPA DO RESULTADO VOCACIONAL
   ============================================================== */
@media print {
  header,
  footer,
  #top-utility-bar,
  #visual-accessibility-widget,
  [vw],
  #catalog-view,
  #tracks-view,
  #career-test-view,
  #result-explore-other-areas-btn,
  #result-restart-test-btn,
  #result-back-to-catalog-btn,
  #result-explore-other-areas-top-btn,
  #result-print-btn,
  #career-review-modal,
  #career-explore-modal,
  .no-print {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
  }

  #main-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  #career-result-view {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .shadow-xl, .shadow-lg, .shadow-md, .shadow-sm {
    box-shadow: none !important;
  }

  /* Garante cores em gráficos e bordas */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   Modo Visualizador / Somente Leitura no Painel Administrativo
   ========================================================================== */
body.is-viewer-mode .viewer-hide {
  display: none !important;
}

body.is-viewer-mode .viewer-disable {
  opacity: 0.5 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

body.is-viewer-mode .viewer-only-alert {
  display: flex !important;
}

/* ==========================================================================
   Modo Escuro (Dark Mode) Completo e Confortável
   ========================================================================== */
html.dark body {
  background-color: #0b1120 !important;
  color: #e2e8f0 !important;
}

html.dark header {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border-bottom-color: #009639 !important;
}

html.dark #top-utility-bar {
  background: linear-gradient(to right, #003615, #004d1c, #003615) !important;
}

/* Hero Banner no Modo Noturno */
html.dark section.relative.bg-gradient-to-b {
  background: linear-gradient(to bottom, #062311, #0f172a, #0b1120) !important;
  border-bottom-color: #1e293b !important;
}

html.dark section.relative.bg-gradient-to-b h1 {
  color: #f8fafc !important;
}

html.dark section.relative.bg-gradient-to-b p {
  color: #cbd5e1 !important;
}

html.dark main {
  background-color: #0b1120 !important;
}

html.dark .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark .bg-slate-50 {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

html.dark .bg-slate-100 {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark .border-slate-200,
html.dark .border-slate-300,
html.dark .border-emerald-100,
html.dark .border-emerald-200 {
  border-color: #334155 !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark .text-slate-400 {
  color: #64748b !important;
}

html.dark .text-\[\#002776\] {
  color: #60a5fa !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html.dark .nav-cascata-menu {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .course-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .course-card:hover {
  border-color: #009639 !important;
}

html.dark .course-card h3 {
  color: #f8fafc !important;
}

html.dark .course-card p {
  color: #94a3b8 !important;
}

html.dark footer {
  background-color: #080d1a !important;
  border-color: #1e293b !important;
}

html.dark #mobile-nav-drawer {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border-top-color: #334155 !important;
}



/* ============================================================ */
/* MICRO-INTERAÇÕES & ELEVAÇÃO PREMIUM (CARDS & BOTOES)         */
/* ============================================================ */
.course-card,
.job-card,
.admin-card-hover {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
  will-change: transform, box-shadow;
}

.course-card:hover,
.job-card:hover,
.admin-card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -8px rgba(0, 39, 118, 0.14), 0 6px 14px -4px rgba(0, 150, 57, 0.08) !important;
  border-color: #009639 !important;
}

.dark .course-card:hover,
.dark .job-card:hover {
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.5), 0 6px 14px -4px rgba(59, 130, 246, 0.2) !important;
  border-color: #3b82f6 !important;
}

/* Linha de Destaque Sutil no Topo dos Cards */
.course-card::before,
.job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #009639 0%, #ffcc29 50%, #002776 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 15;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  pointer-events: none;
}

.course-card:hover::before,
.job-card:hover::before {
  opacity: 1;
}

/* Botão Voltar ao Topo Flutuante */
#btn-scroll-top {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, border-color 0.2s;
}
