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