Voltar ao Site

FinAuto Connect

Gestão financeira inteligente para o seu negócio

Controle Total

Gerencie suas finanças em tempo real

Relatórios Avançados

Insights poderosos para decisões inteligentes

100% Seguro

Seus dados protegidos com criptografia

1
2
3
4

Vamos começar!

Preencha seus dados básicos

Já tem uma conta? Fazer Login

// Password Toggle (Show/Hide) $('.password-toggle').on('click', function() { const targetId = $(this).data('target'); const $input = $(`#${targetId}`); const currentType = $input.attr('type'); if(currentType === 'password') { $input.attr('type', 'text'); $(this).addClass('active'); } else { $input.attr('type', 'password'); $(this).removeClass('active'); } }); $('#btnNext').on('click', function() { // Basic validation per step const $currentFormStep = $(`.form-step[data-step="${currentStep}"]`); const $inputs = $currentFormStep.find('input[required], select[required]'); let valid = true; $inputs.each(function() { if(!$(this).val()) { valid = false; $(this).addClass('border-red-500'); // Busca o label para feedback específico let labelText = ''; const $group = $(this).closest('.input-group, .col-span-1, .col-span-2, .col-span-3'); const $label = $group.find('.input-label'); if ($label.length) { labelText = $label.text().replace('*', '').trim(); } else { labelText = $(this).attr('placeholder') || 'este campo'; } toastr.warning(`O campo "${labelText}" é obrigatório`); $(this).focus(); return false; } $(this).removeClass('border-red-500'); }); if(valid && currentStep < totalSteps) showStep(currentStep + 1); }); $('#btnPrev').on('click', function() { if(currentStep > 1) showStep(currentStep - 1); }); // Form Submit $('#registerForm').on('submit', function(e) { e.preventDefault(); if($('#password').val() !== $('#password_confirmation').val()){ toastr.error('As senhas não conferem.'); $('#password_confirmation').focus(); return; } $('#loadingOverlay').removeClass('hidden'); const formData = { company_name: $('#company_name').val(), email: $('#email').val(), password: $('#password').val(), password_confirmation: $('#password_confirmation').val(), document_type: $type.val(), document: $doc.val().replace(/\D/g, ''), phone: $('#phone').val().replace(/\D/g, ''), zip_code: $('#zip_code').val().replace(/\D/g, ''), address: $('#address').val(), number: $('#number').val(), complement: $('#complement').val(), neighborhood: $('#neighborhood').val(), city: $('#city').val(), state: $('#state').val(), terms: $('#terms').is(':checked') ? 1 : 0 }; $.ajax({ url: $(this).attr('action'), method: 'POST', contentType: 'application/json', headers: { 'X-CSRF-TOKEN': '' }, data: JSON.stringify(formData), success: function(res) { if(res.success) { // Limpa persistence localStorage.removeItem(STORAGE_KEY); localStorage.removeItem('current_registration_step'); confetti({ particleCount: 150, spread: 80, origin: { y: 0.6 }, colors: ['#667eea', '#764ba2', '#fbbf24', '#10b981'] }); const msg = res.message || 'Conta criada com sucesso!'; toastr.success(msg, '', { timeOut: 4000 }); // Se requer ativação, vai para login const target = res.requires_activation ? '/login' : (res.redirect || '/dashboard'); setTimeout(() => window.location.href = target, 4500); } else { $('#loadingOverlay').addClass('hidden'); const errorMsg = res.errors ? Object.values(res.errors)[0] : (res.message || res.error || 'Erro ao criar conta.'); toastr.error(errorMsg); } }, error: function(xhr) { $('#loadingOverlay').addClass('hidden'); const res = xhr.responseJSON; const errorMsg = res?.errors ? Object.values(res.errors)[0] : (res?.message || res?.error || 'Erro de conexão com o servidor.'); toastr.error(errorMsg); } }); }); });