import SwiftUI #if canImport(LCEssentials) import LCEssentials #endif struct LoginView: View { @Binding var root: RootFlow let navigate: (Route) -> Void @ViewBuilder private var logoImage: some View { SwiftUI.Image("pedifoods") .resizable() } var body: some View { LCENavigationView { content } .setLeftButton(image: AnyView(AppBackButtonIcon())) { withAnimation(.easeInOut(duration: 0.3)) { root = .main } } .setTitle(text: Text("Acesse sua conta").font(AppTypography.heading2).foregroundStyle(AppColors.textPrimary)) .setNavigationBarBackgroundColor(AppColors.backgroundLight) .buttonStyle(.plain) // The app ships no dark theme; force light so system dark mode // can't invert the nav bar / title against the fixed DS colors. .preferredColorScheme(.light) } private var content: some View { VStack(spacing: 20) { Spacer() logoImage .scaledToFit() .frame(height: 160) Text("Sua vontade, no seu tempo.\nTudo o que você precisa, em um toque.") .font(AppTypography.heading25) .foregroundStyle(AppColors.textPrimary) .multilineTextAlignment(.center) .padding(.horizontal, 28) Spacer() VStack(spacing: 12) { PrimaryButton(title: "Criar conta", image: Image(systemName: "arrow.right")) { navigate(.registration) } .tint(AppColors.tertiary) SecondaryButton(title: "Entrar") { navigate(.loginEmail) } } .padding(.horizontal, 28) legalLinks .padding(.top, 4) .padding(.bottom, 24) } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(AppColors.backgroundLight.ignoresSafeArea()) } private var legalLinks: some View { HStack(spacing: 6) { Button("Termos de Uso") { navigate(.terms) } .buttonStyle(.plain) Text("·") Button("Política de Privacidade") { navigate(.policy) } .buttonStyle(.plain) } .font(.system(size: 14, weight: .medium)) .foregroundStyle(AppColors.textMuted) } } #Preview { LoginView(root: .constant(.auth), navigate: { _ in }) }