/* =========================================================
   BlueGest — estilos personalizados
   Fonte: Noto Sans | Paleta baseada no logótipo
   ========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #2962ff;
  color: #ffffff;
}

html.dark ::selection {
  background: #2962ff;
  color: #ffffff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #eef2ff;
}
::-webkit-scrollbar-thumb {
  background: #2962ff;
  border-radius: 8px;
  border: 2px solid #eef2ff;
}
::-webkit-scrollbar-thumb:hover {
  background: #0019b2;
}

html.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb {
  border-color: #0f172a;
}

/* ---- Navbar estados ---- */
#navbar {
  background: transparent;
  border-bottom: 1px solid rgba(0, 25, 178, 0.08);
}
#navbar.scrolled,
#navbar.menu-open {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 4px 24px rgba(0, 25, 178, 0.08);
}

html.dark #navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html.dark #navbar.scrolled,
html.dark #navbar.menu-open {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* ---- Navbar transparente sobre o hero azul (modo light) ---- */
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) .nav-link {
  color: rgba(255, 255, 255, 0.92);
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) .nav-link:hover {
  color: #ffffff;
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) #nav-logo {
  filter: brightness(0) invert(1);
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) #theme-toggle {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) #theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) .navbar-cta-outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) .navbar-cta-solid {
  background: #ffffff;
  color: #0019b2;
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) .navbar-cta-solid:hover {
  background: rgba(255, 255, 255, 0.85);
}
html:not(.dark) #navbar:not(.scrolled):not(.menu-open) #menu-btn {
  color: #ffffff;
}

/* ---- Nav link: underline animado ---- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---- Secção Sobre: fundo com parallax ---- */
#sobre {
  position: relative;
  background-color: #f4f7ff;
  background-image: url('../assets/fundo-sobre.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}
#sobre::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(244, 247, 255, 0.5);
  pointer-events: none;
}
#sobre > * {
  position: relative;
  z-index: 1;
}
html.dark #sobre {
  background-image: none;
}
html.dark #sobre::before {
  display: none;
}

/* ---- Tabs da secção Sobre ---- */
.tab-btn {
  padding: 0.65rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 25, 178, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  border-color: rgba(41, 98, 255, 0.5);
  color: #0019b2;
}
.tab-btn.active {
  background: #2962ff;
  border-color: #2962ff;
  color: #ffffff;
}
html.dark .tab-btn {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}
html.dark .tab-btn:hover {
  border-color: rgba(93, 134, 255, 0.6);
  color: #ffffff;
}
html.dark .tab-btn.active {
  background: #2962ff;
  border-color: #2962ff;
  color: #ffffff;
}
.tab-panel {
  animation: tab-fade-in 0.35s ease both;
}
@keyframes tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Painel de parceiros (azul em diagonal) ---- */
.partner-panel {
  background: linear-gradient(135deg, #001085 0%, #0019b2 55%, #2962ff 100%);
  clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
}
.partner-logo {
  transition: filter 0.3s ease;
}
.partner-logo:hover {
  filter: invert(16%) sepia(94%) saturate(5479%) hue-rotate(224deg) brightness(0.92) contrast(1.02);
}

/* ---- Animação de revelação ao scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---- FAQ ---- */
.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
}
.faq-item.is-open .faq-body {
  max-height: 300px;
}

/* ---- Mapa (cores com base na marca) ---- */
.map-frame {
  border: 0;
}
.map-tint {
  position: absolute;
  inset: 0;
  background: #2962ff;
  mix-blend-mode: color;
  pointer-events: none;
}
.map-pointer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -100%);
  z-index: 5;
  pointer-events: none;
}

/* ---- Cursor de digitação no editor de código ---- */
.type-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: #2962ff;
  animation: cursor-blink 1s steps(2, start) infinite;
}
@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .type-cursor {
    animation: none;
  }
}

/* ---- Timeline do método ---- */
#timeline-progress {
  transition: none;
}
.timeline-anim #timeline-progress {
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-step.past .timeline-node {
  background: #eef2ff;
  border-color: #2962ff;
  color: #2962ff;
}
html.dark .timeline-step.past .timeline-node {
  background: rgba(41, 98, 255, 0.2);
  border-color: #7c9bff;
  color: #a5bcff;
}
.timeline-step.past .timeline-card {
  background: #eef2ff;
  border-color: #b6c8ff;
}
html.dark .timeline-step.past .timeline-card {
  background: rgba(41, 98, 255, 0.15);
  border-color: rgba(124, 155, 255, 0.4);
}

.timeline-step.active .timeline-node {
  background: #2962ff;
  border-color: #2962ff;
  color: #fff;
  box-shadow: 0 0 0 6px rgba(41, 98, 255, 0.15);
  animation: node-pulse 2s ease-in-out infinite;
}
.timeline-step.active .timeline-card {
  background: #2962ff;
  border-color: #2962ff;
  box-shadow: 0 20px 45px -20px rgba(0, 25, 178, 0.35);
}
.timeline-step.active .timeline-card h3 {
  color: #fff;
}
.timeline-step.active .timeline-card p {
  color: rgba(255, 255, 255, 0.85);
}
html.dark .timeline-step.active .timeline-card {
  background: #2962ff;
  border-color: #7c9bff;
  box-shadow: 0 20px 45px -20px rgba(124, 155, 255, 0.25);
}

.timeline-step:hover .timeline-node {
  transform: scale(1.12);
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(41, 98, 255, 0.15); }
  50% { box-shadow: 0 0 0 12px rgba(41, 98, 255, 0.05); }
}

/* ---- Bandeira de chegada da timeline ---- */
.flag-pole { fill: #0f172a; }
.flag-dark { fill: #0019b2; }
.flag-light { fill: #2962ff; }
.timeline-step.past .flag-pole { fill: #0019b2; }
.timeline-step.past .flag-light { fill: #6f92ff; }
.timeline-step.active .flag-pole { fill: #ffffff; }
.timeline-step.active .flag-dark { fill: #ffffff; }
.timeline-step.active .flag-light { fill: #bfd4ff; }
.timeline-step.active .flag-node .checkered {
  animation: flag-wave 2.2s ease-in-out infinite;
  transform-origin: 9px 6px;
}
@keyframes flag-wave {
  0%, 100% { transform: skewY(0deg); }
  50% { transform: skewY(-7deg); }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-step.active .timeline-node {
    animation: none;
  }
  .timeline-step.active .flag-node .checkered {
    animation: none;
  }
}
