1+ <!DOCTYPE html>
2+ < html lang ="pt-BR ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Terra Dourada — Login</ title >
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+
8+ < style >
9+ body {
10+ background : # 0a0f0a ;
11+ color : # f5f5f5 ;
12+ font-family : system-ui, sans-serif;
13+ display : flex;
14+ justify-content : center;
15+ align-items : center;
16+ height : 100vh ;
17+ text-align : center;
18+ padding : 20px ;
19+ }
20+ .box {
21+ background : # 111 ;
22+ padding : 40px ;
23+ border-radius : 20px ;
24+ border : 1px solid # d4af37 ;
25+ width : 380px ;
26+ box-shadow : 0 0 20px rgba (212 , 175 , 55 , 0.35 );
27+ animation : fadeIn 0.6s ease-out;
28+ }
29+ @keyframes fadeIn {
30+ from {opacity : 0 ; transform : scale (0.95 );}
31+ to {opacity : 1 ; transform : scale (1 );}
32+ }
33+ h1 {
34+ color : # d4af37 ;
35+ margin-bottom : 25px ;
36+ }
37+ input {
38+ width : 100% ;
39+ padding : 12px ;
40+ margin : 10px 0 ;
41+ background : # 1a1a1a ;
42+ border : 1px solid # 333 ;
43+ border-radius : 8px ;
44+ color : # fff ;
45+ font-size : 1rem ;
46+ box-sizing : border-box;
47+ }
48+ input : focus {
49+ border-color : # d4af37 ;
50+ outline : none;
51+ }
52+ button {
53+ margin-top : 20px ;
54+ padding : 12px 30px ;
55+ background : # d4af37 ;
56+ border : none;
57+ border-radius : 25px ;
58+ color : # 000 ;
59+ cursor : pointer;
60+ font-size : 1rem ;
61+ font-weight : bold;
62+ width : 100% ;
63+ }
64+ button : hover {
65+ background : # b9962c ;
66+ }
67+ .links {
68+ margin-top : 20px ;
69+ font-size : 0.9rem ;
70+ }
71+ .links a {
72+ color : # d4af37 ;
73+ text-decoration : none;
74+ }
75+ .links a : hover {
76+ text-decoration : underline;
77+ }
78+ </ style >
79+ </ head >
80+
81+ < body >
82+ < div class ="box ">
83+ < h1 > 🔐 Login da Eleição</ h1 >
84+
85+ < input type ="email " id ="email " placeholder ="Seu e-mail " required >
86+ < input type ="password " id ="senha " placeholder ="Sua senha " required >
87+
88+ < button onclick ="fazerLogin() "> Entrar</ button >
89+
90+ < div class ="links ">
91+ < a href ="cadastro.html "> 📝 Não tenho cadastro</ a >
92+ </ div >
93+ </ div >
94+
95+ < script >
96+ function fazerLogin ( ) {
97+ const email = document . getElementById ( 'email' ) . value ;
98+ const senha = document . getElementById ( 'senha' ) . value ;
99+
100+ if ( ! email || ! senha ) {
101+ alert ( 'Por favor, preencha todos os campos' ) ;
102+ return ;
103+ }
104+
105+ // Simulação de verificação de login
106+ // Na prática, isso viria de um backend
107+ const usuarioSalvo = localStorage . getItem ( 'user_email' ) ;
108+ const senhaSalva = localStorage . getItem ( 'user_senha' ) ; // Em produção usar hash!
109+
110+ if ( email === usuarioSalvo && senha === senhaSalva ) {
111+ // Login bem-sucedido - redireciona para autorização
112+ window . location . href = 'autorizacao.html' ;
113+ } else {
114+ alert ( 'E-mail ou senha incorretos' ) ;
115+ }
116+ }
117+
118+ // Enter para submeter
119+ document . addEventListener ( 'keypress' , function ( e ) {
120+ if ( e . key === 'Enter' ) {
121+ fazerLogin ( ) ;
122+ }
123+ } ) ;
124+ </ script >
125+
126+ </ body >
127+ </ html >
0 commit comments