*>*> < { margin: 0; padding: 0; box-sizing: border-box; /* Ensures padding and borders are included in element width/height */ font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif; }>{> /* Full height body with centered content */ body { height: 100vh; /* Full viewport height */ display: flex; align-items: center; /* Center vertically */ justify-content: center; /* Center horizontally */ background: linear-gradient(120deg, #a1c4fd, #c2e9fb); /* Soft blue gradient background */ } /* Main login container */ .login-container { background-color: white; border-radius: 10px; box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.05); /* Layered shadows for depth */ width: 400px; max-width: 90%; /* Responsive width on smaller screens */ padding: 2rem; } /* Header section styling */ .login-header { margin-bottom: 2rem; text-align: center; } .login-header h1 { color: #333; margin-bottom: 0.5rem; font-size: 2.5rem; } .login-header p { color: #777; /* Lighter color for subtitle */ font-size: 1rem; } /* Form group container */ .form-group { margin-bottom: 1.5rem; /* Space between form elements */ } /* Label styling */ .form-group label { display: block; margin-bottom: 0.5rem; color: #555; font-size: 1rem; } /* Input field styling */ .form-group input[type=”text”], .form-group input[type=”password”] { width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 4px; transition: border-color 0.3s, box-shadow 0.3s; /* Smooth transitions for interactions */ } /* Focus state for input fields */ .form-group input:focus { border-color: #4a90e2; /* Blue border on focus */ box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.25); /* Subtle glow effect */ outline: none; /* Remove default browser outline */ } /* Password field wrapper for positioning the toggle button */ .password-field { position: relative; /* Allows absolute positioning of child elements */ display: flex; align-items: center; } /* Password visibility toggle button */ .toggle-password { position: absolute; right: 10px; /* Position from the right edge */ top: 50%; transform: translateY(-50%); /* Center vertically */ background: none; border: none; cursor: pointer; padding: 0; color: #777; } /* Eye icon styling */ .eye-icon { width: 20px; height: 20px; fill: #777; /* Gray color for the icon */ } /* Toggle between eye icons when password visibility changes */ .password-visible .eye-open { display: none; /* Hide open eye when password is visible */ } .password-visible .eye-closed { display: block !important; /* Show closed eye when password is visible */ } /* Error state styling for form inputs */ .form-group input.error { border-color: #e74c3c; /* Red border for validation errors */ } /* Error message styling */ .error-message { color: #e74c3c; /* Red text for error messages */ font-size: 0.8rem; margin-top: 0.5rem; display: none; /* Hidden by default, shown via JavaScript */ } /* Form options container (Remember me and Forgot password) */ .form-options { display: flex; justify-content: space-between; /* Space items evenly */ align-items: center; margin-bottom: 1.5rem; } /* Remember me checkbox styling */ .remember-me { display: flex; align-items: center; } .remember-me input[type=”checkbox”] { margin-right: 0.5rem; /* Space between checkbox and label */ } .remember-me label { font-size: 0.9rem; color: #666; } /* Forgot password link styling */ .forgot-password { font-size: 0.9rem; color: #4a90e2; /* Blue color for links */ text-decoration: none; } .forgot-password:hover { text-decoration: underline; /* Underline on hover for better UX */ } /* Main login button styling */ .login-button { width: 100%; padding: 0.8rem; background: #4a90e2; /* Primary blue background */ border: none; border-radius: 4px; color: white; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.3s, transform 0.1s; /* Smooth hover and click effects */ } /* Button hover state */ .login-button:hover { background: #3a80d2; /* Darker blue on hover */ } /* Button active/pressed state */ .login-button:active { transform: scale(0.98); /* Slight scale down when clicked */ } /* Registration link container */ .register-link { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: #666; } /* Registration link styling */ .register-link a { color: #4a90e2; /* Blue color to match other links */ text-decoration: none; } .register-link a:hover { text-decoration: underline; /* Underline on hover */ }/* Responsive design for mobile devices */ @media (max-width: 480px) { .login-container { padding: 1.5rem; /* Reduced padding on small screens */ } .login-header h1 { font-size: 2rem; /* Smaller heading on mobile */ } /* Stack form options vertically on small screens */ .form-options { flex-direction: column; align-items: flex-start; } .forgot-password { margin-top: 0.5rem; /* Add space when stacked */ } } document.addEventListener(‘DOMContentLoaded’, function() { const form = document.querySelector(‘.login-form’); const passwordInput = document.getElementById(‘password’); const togglePassword = document.querySelector(‘.toggle-password’); const errorMessage = document.querySelector(‘.error-message’); const eyeOpen = document.querySelector(‘.eye-open’); const eyeClosed = document.querySelector(‘.eye-closed’); // Toggle password visibility togglePassword.addEventListener(‘click’, function() { // Toggle password field type const type = passwordInput.getAttribute(‘type’) === ‘password’ ? ‘text’ : ‘password’; passwordInput.setAttribute(‘type’, type); // Toggle eye icon if (type === ‘text’) { eyeOpen.style.display = ‘none’; eyeClosed.style.display = ‘block’; } else { eyeOpen.style.display = ‘block’; eyeClosed.style.display = ‘none’; } Modern Login Page Welcome Back Enter your credentials to access your account Username or Email Password Password must be at least 6 characters Remember me Forgot password? Log In Don’t have an account? Sign up }); // Form validation form.addEventListener(‘submit’, function(e) { let valid = true; // Reset previous error states errorMessage.style.display = ‘none’; passwordInput.classList.remove(‘error’); // Validate password if (passwordInput.value.length < 6) { valid = false; passwordInput.classList.add(‘error’); errorMessage.style.display = ‘block’; } if (!valid) { e.preventDefault(); } }); });
Enter your credentials to access your account
Don’t have an account? Sign up