/* Reset e estilos base */
*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* Compatibilidade IE */
* {
  -ms-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  scroll-behavior: smooth;
  color-scheme: dark;
  /* Deslocamento para cabeçalho fixo - compensa a altura do cabeçalho */
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  /* Background transparente para mostrar o slider */
  background-color: transparent;
  color: #e2e8f0;
}

.form-feedback {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  display: none;
}

.form-feedback.visible {
  display: block;
}

.form-feedback.success {
  background-color: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.4);
  color: #bbf7d0;
}

.form-feedback.error {
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

/* Link para saltar conteúdo */
.skip {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #4a5568;
  color: #e2e8f0;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 100;
}

.skip:focus {
  top: 6px;
}

/* Contentores de layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.margem {
  margin-top: 2rem;
}

/* Cabeçalho */
header {
  background-color: rgba(45, 55, 72, 0.9);
  border-bottom: 1px solid rgba(74, 85, 104, 0.6);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 250px;
  /* Definir altura inicial explícita para poder animar durante o scroll */
  height: 100px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

.logo img {
  width: 100%;
  height: 100%;
  /* Fallback para navegadores sem object-fit */
  max-width: 100%;
  max-height: 100%;
  /* Navegadores modernos com suporte object-fit */
  object-fit: contain;
  border-radius: 8px;
  /* Compatibilidade IE */
  -ms-interpolation-mode: bicubic;
}

/* Polyfill object-fit para IE */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .logo img {
    width: auto;
    height: 100%;
    max-width: 100%;
  }
}

/* Redimensionamento suave do logótipo quando a página faz scroll - Compatível entre navegadores */

/* Navegadores Webkit (Safari, Chrome, versões antigas) */
@-webkit-keyframes logo-shrink {
  from { height: 100px; }
  to   { height: 40px; }
}

/* Mozilla Firefox */
@-moz-keyframes logo-shrink {
  from { height: 100px; }
  to   { height: 40px; }
}

/* Opera */
@-o-keyframes logo-shrink {
  from { height: 100px; }
  to   { height: 40px; }
}

/* Keyframes padrão */
@keyframes logo-shrink {
  from { height: 100px; }
  to   { height: 40px; }
}

/* Animação do logótipo com fallbacks para navegadores antigos */
.logo {
  /* Fallback de transição para navegadores sem suporte scroll-timeline */
  -webkit-transition: height 0.3s ease-out;
  -moz-transition: height 0.3s ease-out;
  -o-transition: height 0.3s ease-out;
  transition: height 0.3s ease-out;
}

/* Navegadores modernos com suporte a animações baseadas em scroll */
@supports (animation-timeline: scroll(root)) {
  .logo {
    -webkit-animation: logo-shrink linear both;
    -moz-animation: logo-shrink linear both;
    -o-animation: logo-shrink linear both;
    animation: logo-shrink linear both;
    animation-timeline: scroll(root);
    animation-range: 0 240px;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .logo { 
    -webkit-animation: none !important;
    -moz-animation: none !important;
    -o-animation: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
  }
}

.title {
  font-weight: 600;
  font-size: 1.25rem;
  color: #e2e8f0;
}

.menu {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.menu a {
  color: #a0aec0;
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
}

.menu a:focus {
  color: #e2e8f0;
  border-bottom-color: #4f7942;
  outline: 2px solid #4f7942;
  outline-offset: 2px;
}

.menu a:hover {
  color: #e2e8f0;
  border-bottom-color: #4f7942;
}

/* BOTÃO: geometria estável e independente de flex */
.hamburger {
  /* mostra com media query */
  position: relative;         /* para posicionar as linhas */
  display: none;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;

  /* parâmetros (ajusta se mudares o tamanho) */
  --size: 30px;               /* só informativo */
  --thickness: 3px;           /* espessura da barra */
  --offset: 7px;              /* distância vertical do centro p/ topo e base */
  color: #e2e8f0;             /* usa currentColor nas linhas */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/*.hamburger:focus {
  outline: 2px solid #4f7942;
  outline-offset: 2px;
}*/

/* LINHAS: sempre ancoradas ao centro do botão */
.hamburger-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;                    /* 70% evita cortar as pontas no X */
  height: var(--thickness);
  background-color: currentColor;
  border-radius: 2px;
  -webkit-transform-origin: center;
          transform-origin: center;
  -webkit-transition: -webkit-transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
          transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
}

/* Estado fechado: top / middle / bottom por translação vertical */
.hamburger-line:nth-child(1) {
  -webkit-transform: translate(-50%, calc(-50% - var(--offset)));
          transform: translate(-50%, calc(-50% - var(--offset)));
}
.hamburger-line:nth-child(2) {
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
.hamburger-line:nth-child(3) {
  -webkit-transform: translate(-50%, calc(-50% + var(--offset)));
          transform: translate(-50%, calc(-50% + var(--offset)));
}

/* Estado aberto: ambas as barras vão AO CENTRO e rodam ±45° */
.hamburger.active .hamburger-line:nth-child(1) {
  -webkit-transform: translate(-50%, -50%) rotate(45deg);
          transform: translate(-50%, -50%) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  -webkit-transform: translate(-50%, -50%) scaleX(0.001); /* evita glitch WebKit */
          transform: translate(-50%, -50%) scaleX(0.001);
}
.hamburger.active .hamburger-line:nth-child(3) {
  -webkit-transform: translate(-50%, -50%) rotate(-45deg);
          transform: translate(-50%, -50%) rotate(-45deg);
}

/* Mostra o botão no mobile */
@media (max-width: 768px) {
  .hamburger { display: block; }
}

/* Respeito a preferências de movimento */
@media (prefers-reduced-motion: reduce) {
  .hamburger-line { transition: none; }
}



/* Seletor de idioma */
.language-switcher {
  display: flex;
  gap: 0.25rem;
  background: rgba(74, 85, 104, 0.3);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid #4a5568;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 120px;
  height: 50px;
  min-width: 120px;
  min-height: 50px;
  flex-shrink: 0;
}

.language-switcher::before {
  content: '';
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.25rem);
  height: 40px;
  background: linear-gradient(135deg, #d9ed4b, #8ea332);
  border-radius: 4px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 6px rgba(79, 121, 66, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.language-switcher[data-active="en"]::before {
  transform: translateX(100%);
}

.language-switcher a {
  position: relative;
  z-index: 2;
  padding: 0;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: #a0aec0;
  border: none;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-align: center;
  width: 50px;
  height: 40px;
  min-width: 50px;
  min-height: 40px;
  flex: 1;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-switcher a:hover {
  color: #e2e8f0;
  transform: translateY(-1px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.language-switcher a.active {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

/* Animação quando idioma é selecionado */
.language-switcher a.idioma-selecionado {
  animation: pulseIdioma 0.3s ease-out;
}

@keyframes pulseIdioma {
  0% { transform: translateY(-1px) scale(1); }
  50% { transform: translateY(-2px) scale(1.05); }
  100% { transform: translateY(-1px) scale(1); }
}

/* Efeito adicional de brilho no hover */
.language-switcher a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 4px;
}

.language-switcher a:hover::after {
  opacity: 1;
}

/* Secção hero */
.hero {
  position: relative;
  min-height: 100vh;
  text-align: center;
  overflow: hidden;
  display: table;
  width: 100%;
}

/* Flexbox fallback for modern browsers */
@supports (display: flex) {
  .hero {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Hero Background Slider - Estendido para toda a página */
.hero-slider {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  -webkit-transition: opacity 1.5s ease-in-out;
  -moz-transition: opacity 1.5s ease-in-out;
  -o-transition: opacity 1.5s ease-in-out;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  /* Fallback for older browsers */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Modern browsers with object-fit support */
@supports (object-fit: cover) {
  .hero-slide img {
    object-fit: cover;
    object-position: center;
  }
}

/* Hero overlay expandido para toda a página */
.hero-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  /* IE fallback */
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000, endColorstr=#66000000);
  z-index: 0;
  pointer-events: none;
}

.box {
  position: relative;
  z-index: 20;
  background-color: rgba(45, 55, 72, 0.3);
  padding: 3rem 2rem;
  border-radius: 12px;
  -webkit-box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  margin: 0 auto;
  /* Table-cell alignment for older browsers */
  display: table-cell;
  vertical-align: middle;
}

/* Modern browsers with backdrop-filter support */
@supports (backdrop-filter: blur(15px)) {
  .box {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }
}

/* Flexbox layout for modern browsers */
@supports (display: flex) {
  .box {
    display: block;
  }
}

/* Dark mode support for modern browsers */
.kicker {
  color: #d9ed4b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

h1 {
  font-family: "Crete Round", serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
  color: #e2e8f0;
}

.muted {
  color: #a0aec0;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* Botões de chamada para ação */
.cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn.primary {
  background-color: #d9ed4b;
  color: #333;
  box-shadow: 0 4px 12px rgba(79, 121, 66, 0.3);
}

.btn.primary:hover {
  background-color: #cfed4b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(142, 143, 76, 0.4);
}

.btn.ghost {
  background-color: transparent;
  color: #a0aec0;
  border: 2px solid #4a5568;
}

.btn.ghost:hover {
  background-color: #4a5568;
  color: #e2e8f0;
}

/* Secções de conteúdo principal */
main {
  padding: 0 0 2rem 0;
  position: relative;
  z-index: 10;
}

section {
  margin-bottom: 3rem;
  position: relative;
  z-index: 10;
}

/* Seções transparentes para mostrar o slider */
section:not(.hero) {
  background-color: transparent;
  z-index: 10;
}

section:not(.hero) .container {
  position: relative;
  z-index: 12;
}

/* Fallback for browsers without scroll-padding-top support */
section[id] {
  position: relative;
}

section[id]::before {
  content: "";
  display: block;
  height: 120px;
  margin-top: -120px;
  visibility: hidden;
  pointer-events: none;
}

/* Hide the offset pseudo-element if scroll-padding is supported */
@supports (scroll-padding-top: 120px) {
  section[id]::before {
    display: none;
  }
}

.card {
  background-color: rgba(45, 55, 72, 0.9);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(74, 85, 104, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  position: relative;
  z-index: 15;
}

h2 {
  font-size: 1.875rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  color: #d9ed4b;
  border-bottom: 1px solid #000;
  font-family: "crete round";
  padding-bottom: 10px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  color: #d9ed4b;
}

p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

/* Listas */
ol, ul {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

.list-tight li {
  margin-bottom: 0.5rem;
}

li {
  line-height: 1.6;
}

/* Layout em grelha */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid li {
  list-style: none;
  padding: 0.5rem 0.75rem;
  background-color: #4a5568;
  border-radius: 6px;
  border-left: 3px solid #d9ed4b;
}

.grid ul {
  padding: 0;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Links */
a {
  color: #d9ed4b;
  transition: color 0.2s ease;
}

a:hover {
  color: #ffffff;
}

/* Keyboard shortcut styling */
.kbd {
  background-color: #4a5568;
  border: 1px solid #718096;
  border-radius: 4px;
  padding: 0.125rem 0.25rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
}

/* Rodapé */
footer {
  background-color: #2d3748;
  border-top: 1px solid #4a5568;
  padding: 2rem 0;
  margin-top: 4rem;
  position: relative;
  z-index: 10;
}

footer p {
  text-align: center;
  color: #a0aec0;
  margin: 0;
  font-size: 0.875rem;
}

/* Mobile Language Switcher Control */
.mobile-lang {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #4a5568;
  justify-content: center;
}

.desktop-lang {
  display: flex;
  flex-shrink: 0;
  min-width: 120px;
  min-height: 50px;
}

/* Design responsivo */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 100px;
  }
  
  /* Fallback for browsers without scroll-padding-top support */
  section[id]::before {
    height: 100px;
    margin-top: -100px;
  }
  
  nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  
  /* Show hamburger button on mobile */
  .hamburger {
    display: flex;
    order: 3;
  }
  
  /* Hide desktop language switcher */
  .desktop-lang {
    display: none;
  }
  
  /* Show mobile language switcher inside menu */
  .mobile-lang {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #4a5568;
    width: 100%;
    order: 999;
    flex-basis: 100%;
    align-self: center;
  }
  
  /* Mobile menu styles */
  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: rgba(45, 55, 72, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(74, 85, 104, 0.6);
    border-top: none;
    z-index: 999;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(-10px);
    -moz-transform: translateY(-10px);
    -o-transform: translateY(-10px);
    transform: translateY(-10px);
    /* Transitions */
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
  }
  
  /* Active menu state */
  .menu.active {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
  }
  
  /* Menu links in mobile */
  .menu a {
    padding: 0.75rem 2rem;
    text-align: center;
    border-bottom: none;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    width: auto;
    max-width: 280px;
    min-width: 200px;
    flex-shrink: 0;
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .menu a:focus {
    color: #e2e8f0;
    border-bottom-color: #4f7942;
    outline: 2px solid #4f7942;
    outline-offset: 2px;
  }
  
  /* Dark mode for menu links */
  
  .hero {
    min-height: 80vh;
  }
  
  .box {
    padding: 2rem 1rem;
    max-width: 90%;
  }
  
  .cta {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
  
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  html {
    scroll-padding-top: 80px;
  }
  
  /* Fallback for browsers without scroll-padding-top support */
  section[id]::before {
    height: 80px;
    margin-top: -80px;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .muted {
    font-size: 1rem;
  }
  
  /* Menu mobile mais touch-friendly */
  .menu {
    padding: 0.75rem;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling no iOS */
  }
  
  .menu a {
    font-size: 0.875rem;
    padding: 0.75rem 0; /* Aumentado para melhor área de toque */
    min-height: 44px; /* Área mínima de toque recomendada */
    display: flex;
    align-items: center;
  }
  
  /* Language switcher mobile otimizado */
  .mobile-lang {
    padding: 1rem 0.5rem 0.5rem;
    margin-top: 0.5rem;
  }
  
  /* Redimensionar mobile language switcher */
  .mobile-lang.language-switcher {
    width: 100px;
    height: 42px;
    min-width: 100px;
    min-height: 42px;
    padding: 0.125rem;
    gap: 0.125rem;
    margin: 0 auto;
  }
  
  .mobile-lang.language-switcher a {
    width: 46px;
    height: 36px;
    min-width: 46px;
    min-height: 36px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-lang.language-switcher::before {
    height: 36px;
    width: calc(50% - 0.0625rem);
    top: 0.125rem;
    left: 0.125rem;
  }
  
  .mobile-lang .lang-selector {
    padding: 0.5rem 1rem;
    min-width: 80px;
    min-height: 44px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero {
    min-height: 70vh;
  }
  
  .box {
    padding: 1.5rem 1rem;
    max-width: 95%;
  }
  
  /* Botões touch-friendly */
  .btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  
  /* Formulários otimizados para mobile */
  input,
  textarea,
  select {
    min-height: 44px;
    padding: 0.75rem;
    font-size: 16px; /* Evita zoom automático no iOS */
  }
  
  /* Hero content ajustado */
  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  /* Cards com melhor espaçamento */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Fallback for browsers without vh support */
  .hero {
    min-height: 400px;
    min-height: 70vh;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Melhorar interação touch em todos os elementos clicáveis */
  .btn,
  .hamburger,
  .lang-selector,
  .menu a,
  .back-to-top {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  /* Remover hover effects em dispositivos touch */
  .btn:hover,
  .lang-selector:hover,
  .menu a:hover {
    transform: none;
    box-shadow: none;
    background-color: initial;
  }
  
  /* Adicionar feedback visual com :active */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.8;
  }
  
  .hamburger:active {
    opacity: 0.8;
    transform: scale(0.95);
  }
  
  .hamburger:active .hamburger-line {
    background-color: #4f7942;
  }
  
  .lang-selector:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
  
  .menu a:active {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* Tablet optimizations (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  /* Menu para tablets com melhor aproveitamento do espaço */
  .menu {
    padding: 1rem;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    flex-wrap: nowrap;
  }
  
  .menu a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    order: 1;
  }
  
  /* Hamburger para tablet */
  .hamburger {
    width: var(--size);
    height: var(--size);
    padding: 0;
    /* Ajustar variáveis para tablet se necessário */
    --size: 30px;
    --thickness: 3px;
    --offset: 7px;
  }
  
  /* Language switcher para tablet */
  .mobile-lang {
    width: 100%;
    order: 999;
    flex-basis: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #4a5568;
  }
  
  .mobile-lang.language-switcher {
    width: 110px;
    height: 44px;
    min-width: 110px;
    min-height: 44px;
    padding: 0.125rem;
    gap: 0.125rem;
    margin: 0 auto;
  }
  
  .mobile-lang.language-switcher a {
    width: 51px;
    height: 38px;
    min-width: 51px;
    min-height: 38px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-lang.language-switcher::before {
    height: 38px;
    width: calc(50% - 0.0625rem);
    top: 0.125rem;
    left: 0.125rem;
  }
  
  .mobile-lang .lang-selector {
    padding: 0.75rem 1.25rem;
    min-width: 100px;
    font-size: 1rem;
  }
  
  /* Grid layout otimizado para tablet */
  .grid.cols-2 {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .grid.cols-3 {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  
  /* Hero content para tablet */
  .hero-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  .hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
  }
  
  /* Buttons com melhor espaçamento */
  .btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
  
  /* Cards com layout melhorado */
  .card {
    padding: 2rem;
  }
  
  /* .container {
    padding: 0 1.5rem;
  } */
}

/* Additional cross-browser compatibility */

/* Fallback for browsers without vh unit support */
.hero {
  min-height: 600px; /* Fallback */
  min-height: 100vh;
}

/* IE 10+ specific styles */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .hero {
    height: 600px;
  }
  
  .hero-slide img {
    width: 100%;
    height: 100%;
  }
}

/* Safari specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .hero-slide img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #d9ed4b;
  /* Fallback for older browsers */
  background-color: #d9ed4b;
  color: #333;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Cross-browser box shadow */
  -webkit-box-shadow: 0 4px 12px rgba(79, 121, 66, 0.3);
  -moz-box-shadow: 0 4px 12px rgba(79, 121, 66, 0.3);
  box-shadow: 0 4px 12px rgba(79, 121, 66, 0.3);
  /* Transitions */
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  /* Transform */
  -webkit-transform: translateY(100px);
  -moz-transform: translateY(100px);
  -o-transform: translateY(100px);
  transform: translateY(100px);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  /* Remove default link styles */
  outline: none;
  cursor: pointer;
}

/* Fallback for flexbox */
.back-to-top {
  line-height: 50px;
  text-align: center;
}

/* Modern browsers with flexbox */
@supports (display: flex) {
  .back-to-top {
    display: flex;
    line-height: normal;
    text-align: initial;
  }
}

/* Visible state */
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}

/* Hover effects */
.back-to-top:hover {
  background: #cfed4b;
  -webkit-transform: translateY(-2px);
  -moz-transform: translateY(-2px);
  -o-transform: translateY(-2px);
  transform: translateY(-2px);
  -webkit-box-shadow: 0 6px 16px rgba(79, 121, 66, 0.4);
  -moz-box-shadow: 0 6px 16px rgba(79, 121, 66, 0.4);
  box-shadow: 0 6px 16px rgba(79, 121, 66, 0.4);
}

.back-to-top:hover.visible {
  -webkit-transform: translateY(-2px);
  -moz-transform: translateY(-2px);
  -o-transform: translateY(-2px);
  transform: translateY(-2px);
}

/* Focus state for accessibility */
.back-to-top:focus {
  outline: 2px solid #cfed4b;
  outline-offset: 2px;
}

/* Icon styles */
.back-to-top-icon {
  color: #333;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  /* Ensure icon is centered */
  display: block;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    line-height: 45px;
  }
  
  .back-to-top-icon {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    line-height: 40px;
  }
  
  .back-to-top-icon {
    font-size: 16px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    -webkit-transition: opacity 0.3s ease;
    -moz-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
  }
  
  .back-to-top:hover {
    -webkit-transform: none;
    -moz-transform: none;
    -o-transform: none;
    transform: none;
  }
  
  .back-to-top.visible {
    -webkit-transform: none;
    -moz-transform: none;
    -o-transform: none;
    transform: none;
  }
}

/* === Estilos específicos para o mapa Leaflet === */
#map {
  position: relative;
  z-index: 100;
  background-color: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.2);
  width: 100%;
  height: 70vh !important;
}

/* Garantir que os controles do Leaflet funcionem */
.leaflet-control-container {
  position: relative;
  z-index: 150;
}

.leaflet-control-container .leaflet-control {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Container do Leaflet */
.leaflet-container {
  position: relative;
  z-index: 100;
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
}

/* Estilo dos popups do mapa */
.leaflet-popup-content {
  background-color: #2d3748 !important;
  color: #e2e8f0 !important;
  border-radius: 8px;
  padding: 1rem;
}

.leaflet-popup-content-wrapper {
  background-color: #2d3748 !important;
  border-radius: 8px;
}

.leaflet-popup-tip {
  background-color: #2d3748 !important;
}

/* Ajustes para compatibilidade */
.leaflet-container {
  background-color: #f8f9fa;
  font-family: inherit !important;
}

/* Reset para elementos do Leaflet */
#map img {
  max-width: none !important;
}

#map .leaflet-container a {
  color: #0078A8;
}

/* Garantir z-index correto para todos os elementos do mapa */
.leaflet-pane {
  z-index: 100;
}

.leaflet-tile-pane {
  z-index: 100;
}

.leaflet-overlay-pane {
  z-index: 110;
}

.leaflet-shadow-pane {
  z-index: 120;
}

.leaflet-marker-pane {
  z-index: 130;
}

.leaflet-tooltip-pane {
  z-index: 140;
}

.leaflet-popup-pane {
  z-index: 145;
}

/* === Formulário de Contacto === */
.contact-form {
  max-width: 100%;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #e2e8f0;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(74, 85, 104, 0.6);
  border-radius: 6px;
  background-color: rgba(45, 55, 72, 0.8);
  color: #e2e8f0;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4f7942;
  box-shadow: 0 0 0 2px rgba(79, 121, 66, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a0aec0;
}

.form-group select {
  cursor: pointer;
}

.form-group select option {
  background-color: #2d3748;
  color: #e2e8f0;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-note {
  font-size: 0.75rem;
  color: #a0aec0;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Estados de validação */
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid:not(:focus),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #e53e3e;
}

.form-group input:valid:not(:focus):not(:placeholder-shown),
.form-group select:valid:not(:focus),
.form-group textarea:valid:not(:focus):not(:placeholder-shown) {
  border-color: #4f7942;
}

/* Estilos para listas tight - posicionamento natural ao lado de imagens flutuantes */
.list-tight {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.6;
  /* Reduz a largura das listas para se ajustarem melhor ao lado da imagem */
  max-width: calc(100% - 300px);
  /* Garante que as listas não ficam muito coladas à imagem */
  margin-right: 1rem;
}

.list-tight li {
  margin-bottom: 0.4rem;
}

/* Responsividade para listas - em ecrãs pequenos, remove a limitação de largura */
@media (max-width: 768px) {
  .list-tight {
    max-width: none;
    margin-right: 0;
  }
}