.elementor-kit-7{--e-global-color-primary:#100342;--e-global-color-secondary:#DDC039;--e-global-color-text:#FDFAFA;--e-global-color-accent:#FD8700;--e-global-color-1056485:#667085;--e-global-typography-primary-font-family:"Times New Roman";--e-global-typography-primary-font-size:30px;--e-global-typography-primary-font-weight:600;--e-global-typography-secondary-font-family:"Roboto Flex";--e-global-typography-secondary-font-size:20px;--e-global-typography-secondary-font-weight:400;--e-global-typography-text-font-family:"Roboto Flex";--e-global-typography-text-font-size:18px;--e-global-typography-text-font-weight:400;--e-global-typography-accent-font-family:"Roboto Flex";--e-global-typography-accent-font-weight:500;--e-global-typography-accent-letter-spacing:1.2px;font-family:"Times New Roman", Sans-serif;}.elementor-kit-7 button,.elementor-kit-7 input[type="button"],.elementor-kit-7 input[type="submit"],.elementor-kit-7 .elementor-button{background-color:#FCA100;text-transform:uppercase;border-radius:20px 20px 20px 20px;padding:20px 20px 20px 20px;}.elementor-kit-7 button:hover,.elementor-kit-7 button:focus,.elementor-kit-7 input[type="button"]:hover,.elementor-kit-7 input[type="button"]:focus,.elementor-kit-7 input[type="submit"]:hover,.elementor-kit-7 input[type="submit"]:focus,.elementor-kit-7 .elementor-button:hover,.elementor-kit-7 .elementor-button:focus{background-color:#FD6D00;}.elementor-kit-7 e-page-transition{background-color:#FFBC7D;}.elementor-section.elementor-section-boxed > .elementor-container{max-width:1140px;}.e-con{--container-max-width:1140px;}.elementor-widget:not(:last-child){margin-block-end:20px;}.elementor-element{--widgets-spacing:20px 20px;--widgets-spacing-row:20px;--widgets-spacing-column:20px;}{}h1.entry-title{display:var(--page-title-display);}.site-header .site-branding{flex-direction:column;align-items:stretch;}.site-header{padding-inline-end:0px;padding-inline-start:0px;}.site-footer .site-branding{flex-direction:column;align-items:stretch;}@media(max-width:1024px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:1024px;}.e-con{--container-max-width:1024px;}}@media(max-width:767px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:767px;}.e-con{--container-max-width:767px;}}/* Start custom CSS */// Sticky nav shadow on scroll
const nav = document.getElementById('main-nav');
window.addEventListener('scroll', () => {
  nav.classList.toggle('scrolled', window.scrollY > 10);
}, { passive: true });

// FAQ accordion
document.querySelectorAll('.faq-question').forEach(btn => {
  btn.addEventListener('click', () => {
    const item = btn.closest('.faq-item');
    const isOpen = item.classList.contains('open');
    document.querySelectorAll('.faq-item.open').forEach(i => {
      i.classList.remove('open');
      i.querySelector('.faq-question').setAttribute('aria-expanded', 'false');
    });
    if (!isOpen) {
      item.classList.add('open');
      btn.setAttribute('aria-expanded', 'true');
    }
  });
});

// Intersection Observer for fade-up animations
const fadeEls = document.querySelectorAll('.fade-up');
const observer = new IntersectionObserver((entries) => {
  entries.forEach(e => {
    if (e.isIntersecting) {
      e.target.classList.add('visible');
      observer.unobserve(e.target);
    }
  });
}, { threshold: 0.1, rootMargin: '0px 0px -40px 0px' });
fadeEls.forEach(el => observer.observe(el));

// Form submission
const form = document.getElementById('application-form');
form.addEventListener('submit', (e) => {
  e.preventDefault();
  const nome = document.getElementById('nome').value.trim();
  const email = document.getElementById('email').value.trim();
  const telefone = document.getElementById('telefone').value.trim();
  const gdpr = document.getElementById('gdpr').checked;

  if (!nome || !email || !telefone || !gdpr) {
    [['nome', nome], ['email', email], ['telefone', telefone]].forEach(([id, val]) => {
      const el = document.getElementById(id);
      el.style.borderColor = val ? 'var(--color-border)' : '#e53935';
    });
    if (!gdpr) {
      document.getElementById('gdpr').style.outline = '2px solid #e53935';
    }
    return;
  }

  document.getElementById('main-form').style.display = 'none';
  document.getElementById('form-success').classList.add('show');
  document.getElementById('form-candidatura').scrollIntoView({ behavior: 'smooth', block: 'center' });
});

// Clear validation on input
['nome','email','telefone'].forEach(id => {
  document.getElementById(id).addEventListener('input', function() {
    this.style.borderColor = '';
  });
});
document.getElementById('gdpr').addEventListener('change', function() {
  this.style.outline = '';
});/* End custom CSS */