* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --brand: #22d3ee;
  --brand-strong: #06b6d4;
  --danger: #ef4444;
  --ring: rgba(34, 211, 238, .35);
  --card: #0b1220;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 1.125rem;
}

html {
  font-size: 80%;
  height: 100%;
}

body {
  background:
    radial-gradient(62.5vw 83.33vh at 80% -20%, rgba(6, 182, 212, .18), transparent 60%),
    radial-gradient(52.08vw 72.91vh at -10% 120%, rgba(52, 211, 153, .14), transparent 60%),
    var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.logo {
  width: 80%;
  max-width: 12.5rem;
  height: auto;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.logo.ativa {
  filter: grayscale(0%);
}

@media (max-width: 37.5em) {
  .logo {
    width: 50%;
  }
}

/* --- Menu de Navegação --- */
.top-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2.5rem;
  z-index: 1000;
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.menu-principal {
  display: flex;
  list-style: none;
}

.menu-principal a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1.125rem;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: var(--radius);
}

.menu-principal a:hover,
.menu-principal a:focus {
  color: var(--brand);
  text-shadow: 0 0 8px var(--ring);
}

/* --- Submenus (Desktop) --- */
.has-submenu {
  position: relative;
}

.submenu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 200px;
  padding-top: 0.5rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.has-submenu.ativo>.submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.submenu a {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.25rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease-out;
}

.submenu a:hover,
.submenu a:focus {
  color: var(--brand-strong);
  background-color: var(--card);
  box-shadow: var(--shadow);
  transform: scale(1.02);
}

.has-submenu>a svg {
  transition: transform 0.3s ease;
}

.has-submenu.ativo>a svg {
  transform: rotate(180deg);
}

/* --- Menu Hambúrguer (Mobile) --- */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--text);
  transition: all 0.3s ease-in-out;
}

/* --- Estilos Responsivos para o Menu --- */
@media (max-width: 50em) {
  /* CORREÇÃO APLICADA AQUI */
  .menu-principal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    
    /* Alinhamento à esquerda, não mais ao centro */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 6rem 2rem; /* Espaçamento interno (Topo, Laterais) */
    
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
  }

  .menu-principal.ativo {
    display: flex;
  }

  .menu-principal li {
    margin: 1rem 0;
    width: 100%;
  }

  .menu-principal a {
    justify-content: flex-start; /* Alinha o texto e a seta à esquerda */
    text-shadow: none;
  }

  /* --- CORREÇÃO no SUBMENU MOBILE --- */
  .submenu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 1rem;
    display: none;
  }

  .submenu li {
    margin: 0.5rem 0;
  }

  /* Hierarquia feita com indentação (padding) */
  .submenu a {
    padding-left: 2rem; /* Adiciona a indentação */
    font-size: 1rem;
    color: var(--muted);
    /* Remove o background e alinhamento central da versão anterior */
  }
  
  /* O hover global já se aplica, com sombra e fundo */
  .submenu a:hover,
  .submenu a:focus {
      color: var(--brand-strong);
      background-color: var(--card);
      box-shadow: var(--shadow);
      transform: scale(1.02);
  }

  .has-submenu.ativo>.submenu {
    display: block;
  }

  .has-submenu>a svg {
    transform: rotate(0deg);
  }

  .has-submenu.ativo>a svg {
    transform: rotate(180deg);
  }

  .hamburger-menu {
    display: block;
  }

  .hamburger-menu.ativo .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.ativo .hamburger-bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.ativo .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}