1+ @import url ('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap' );
2+
3+ * { margin : 0 ; padding : 0 ; box-sizing : border-box; }
4+
5+ body {
6+ font-family : 'Inter' , sans-serif;
7+ background : linear-gradient (135deg , # 667eea 0% , # 764ba2 100% );
8+ min-height : 100vh ;
9+ display : flex;
10+ align-items : center;
11+ justify-content : center;
12+ padding : 20px ;
13+ }
14+
15+ .container { width : 100% ; max-width : 500px ; }
16+
17+ .form-container {
18+ background : white;
19+ padding : 40px ;
20+ border-radius : 12px ;
21+ box-shadow : 0 4px 6px -1px rgba (0 , 0 , 0 , 0.1 );
22+ }
23+
24+ h1 { text-align : center; color : # 374151 ; font-size : 28px ; font-weight : 600 ; margin-bottom : 8px ; }
25+ .subtitle { text-align : center; color : # 6b7280 ; margin-bottom : 32px ; font-size : 16px ; }
26+
27+ .validation-form { display : flex; flex-direction : column; gap : 20px ; }
28+ .input-group , .checkbox-group { display : flex; flex-direction : column; gap : 6px ; }
29+ .checkbox-group { flex-direction : row; align-items : flex-start; gap : 12px ; }
30+
31+ label { font-weight : 500 ; color : # 374151 ; font-size : 14px ; }
32+ .required { color : # dc2626 ; }
33+
34+ input [type = "text" ], input [type = "email" ], input [type = "tel" ], input [type = "password" ] {
35+ padding : 12px 16px ;
36+ border : 2px solid # d1d5db ;
37+ border-radius : 8px ;
38+ font-size : 16px ;
39+ transition : all 0.2s ease;
40+ outline : none;
41+ }
42+
43+ input [type = "checkbox" ] { width : 18px ; height : 18px ; accent-color : # 4f46e5 ; cursor : pointer; margin-top : 2px ; }
44+ .checkbox-group label { cursor : pointer; line-height : 1.5 ; }
45+
46+ /* Focus and Validation States */
47+ input : focus { border-color : # 4f46e5 ; box-shadow : 0 0 0 3px rgba (79 , 70 , 229 , 0.1 ); }
48+ input : valid : not (: placeholder-shown ) { border-color : # 059669 ; }
49+ input : invalid : not (: focus ): not (: placeholder-shown ) { border-color : # dc2626 ; }
50+
51+ /* Error Messages - only show when field is invalid and touched */
52+ .error-message {
53+ color : # dc2626 ;
54+ font-size : 14px ;
55+ font-weight : 500 ;
56+ display : none;
57+ margin-top : 4px ;
58+ }
59+
60+ .input-group input : invalid : not (: focus ): not (: placeholder-shown ) + .error-message { display : block; }
61+
62+ /* Submit Button */
63+ .submit-button {
64+ background : # 4f46e5 ;
65+ color : white;
66+ border : none;
67+ padding : 14px 24px ;
68+ border-radius : 8px ;
69+ font-size : 16px ;
70+ font-weight : 600 ;
71+ cursor : pointer;
72+ transition : all 0.2s ease;
73+ margin-top : 12px ;
74+ }
75+
76+ .submit-button : hover { background : # 3730a3 ; transform : translateY (-1px ); }
77+ .submit-button : active { transform : translateY (0 ); }
78+
79+ /* Disable submit when form invalid */
80+ .validation-form : invalid .submit-button {
81+ background : # 9ca3af ;
82+ cursor : not-allowed;
83+ transform : none;
84+ }
85+
86+ /* Success Popup */
87+ .success-popup {
88+ position : fixed;
89+ top : 0 ;
90+ left : 0 ;
91+ width : 100% ;
92+ height : 100% ;
93+ background : rgba (0 , 0 , 0 , 0.5 );
94+ display : none;
95+ align-items : center;
96+ justify-content : center;
97+ z-index : 1000 ;
98+ }
99+
100+ .success-popup : target { display : flex; }
101+
102+ .popup-content {
103+ background : white;
104+ padding : 40px ;
105+ border-radius : 12px ;
106+ text-align : center;
107+ max-width : 400px ;
108+ margin : 20px ;
109+ box-shadow : 0 4px 6px -1px rgba (0 , 0 , 0 , 0.1 );
110+ }
111+
112+ .popup-content h2 { color : # 059669 ; margin-bottom : 16px ; font-size : 24px ; }
113+ .popup-content p { color : # 374151 ; line-height : 1.6 ; margin-bottom : 20px ; }
114+
115+ .close-btn {
116+ display : inline-block;
117+ background : # 4f46e5 ;
118+ color : white;
119+ padding : 10px 20px ;
120+ border-radius : 6px ;
121+ text-decoration : none;
122+ font-weight : 500 ;
123+ transition : all 0.2s ease;
124+ }
125+
126+ .close-btn : hover { background : # 3730a3 ; transform : translateY (-1px ); }
127+
128+ /* Links */
129+ a { color : # 4f46e5 ; text-decoration : none; }
130+ a : hover { text-decoration : underline; }
131+
132+ /* Responsive */
133+ @media (max-width : 640px ) {
134+ .form-container { padding : 24px ; margin : 10px ; }
135+ h1 { font-size : 24px ; }
136+ .subtitle { font-size : 14px ; }
137+ }
0 commit comments