function App() {
  const { useState, useEffect } = React;
  const [screen, setScreen] = useState('landing');
  const [lead, setLead] = useState({ nome: '', email: '', telefone: '' });

  useEffect(() => {
    window.scrollTo(0, 0);
  }, [screen]);

  return (
    <React.Fragment>
      {screen === 'landing' && (
        <Landing 
          onCheckout={() => setScreen('form')} 
          onTermos={() => setScreen('termos')}
          onPrivacidade={() => setScreen('privacidade')}
        />
      )}
      {screen === 'form' && (
        <FormPage
          initial={lead}
          onBack={() => setScreen('landing')}
          onContinue={(data) => { setLead(data); setScreen('checkout'); }}
        />
      )}
      {screen === 'checkout' && (
        <CheckoutPage
          lead={lead}
          onBack={() => setScreen('form')}
          onTermos={() => setScreen('termos')}
          onPrivacidade={() => setScreen('privacidade')}
        />
      )}
      {screen === 'termos' && (
        <TermosPage onBack={() => setScreen('landing')} />
      )}
      {screen === 'privacidade' && (
        <PrivacidadePage onBack={() => setScreen('landing')} />
      )}
    </React.Fragment>
  );
}