* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #10451d, #1a6b2f, #10451d);
background-size: 400% 400%;
animation: gradientShift 15s ease infinite;
padding: 1rem;
}
@keyframes gradientShift {
0%, 100% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
}
.login-container {
background: white;
padding: 3rem 2.5rem;
border-radius: 24px;
box-shadow: 0 20px 60px rgba(16, 69, 29, 0.4);
width: 100%;
max-width: 420px;
animation: slideIn 0.6s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.login-header {
text-align: center;
margin-bottom: 2.5rem;
}
.logo-icon {
width: 70px;
height: 70px;
background: linear-gradient(135deg, #10451d, #1a6b2f);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1.5rem;
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(16, 69, 29, 0.4);
}
50% {
transform: scale(1.05);
box-shadow: 0 0 0 10px rgba(16, 69, 29, 0);
}
}
.logo-icon ion-icon {
font-size: 2.5rem;
color: white;
}
.login-header h2 {
color: #10451d;
font-size: 1.875rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
.login-header p {
color: #6c757d;
font-size: 0.925rem;
}
.form-group {
margin-bottom: 1.5rem;
position: relative;
}
.form-group label {
display: block;
color: #2c3e50;
font-size: 0.875rem;
font-weight: 500;
margin-bottom: 0.5rem;
transition: all 0.3s ease;
}
.input-wrapper {
position: relative;
}
.input-icon {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
font-size: 1.25rem;
color: #6c757d;
transition: all 0.3s ease;
}
.form-group input {
width: 100%;
padding: 0.875rem 1rem 0.875rem 3rem;
border: 2px solid #e0e0e0;
border-radius: 12px;
font-size: 0.95rem;
transition: all 0.3s ease;
outline: none;
}
.form-group input:focus {
border-color: #10451d;
box-shadow: 0 0 0 4px rgba(16, 69, 29, 0.1);
}
.form-group input:focus ~ .input-icon {
color: #10451d;
}
.toggle-password {
position: absolute;
right: 1rem;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
font-size: 1.25rem;
color: #6c757d;
transition: all 0.3s ease;
}
.toggle-password:hover {
color: #10451d;
}
.form-options {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
font-size: 0.875rem;
}
.remember-me {
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
color: #6c757d;
}
.remember-me input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: #10451d;
}
.forgot-password {
color: #10451d;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
}
.forgot-password:hover {
color: #1a6b2f;
text-decoration: underline;
}
.login-btn {
width: 100%;
padding: 1rem;
background: linear-gradient(135deg, #10451d, #1a6b2f);
color: white;
border: none;
border-radius: 12px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(16, 69, 29, 0.3);
position: relative;
overflow: hidden;
}
.login-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
}
.login-btn:hover::before {
left: 100%;
}
.login-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(16, 69, 29, 0.4);
}
.login-btn:active {
transform: translateY(0);
}
.divider {
display: flex;
align-items: center;
margin: 2rem 0;
color: #6c757d;
font-size: 0.875rem;
}
.divider::before,
.divider::after {
content: '';
flex: 1;
height: 1px;
background: #e0e0e0;
}
.divider span {
padding: 0 1rem;
}
.social-login {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
}
.social-btn {
flex: 1;
padding: 0.875rem;
border: 2px solid #e0e0e0;
border-radius: 12px;
background: white;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
color: #2c3e50;
}
.social-btn ion-icon {
font-size: 1.25rem;
}
.social-btn:hover {
border-color: #10451d;
background: rgba(16, 69, 29, 0.05);
transform: translateY(-2px);
}
.signup-link {
text-align: center;
color: #6c757d;
font-size: 0.925rem;
}
.signup-link a {
color: #10451d;
text-decoration: none;
font-weight: 600;
transition: all 0.3s ease;
}
.signup-link a:hover {
color: #1a6b2f;
text-decoration: underline;
}
.error-message {
color: #dc3545;
font-size: 0.825rem;
margin-top: 0.5rem;
display: none;
animation: shake 0.3s ease;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
75% { transform: translateX(5px); }
}
.error-message.show {
display: block;
}
function togglePassword() {
const passwordInput = document.getElementById('password');
const toggleIcon = document.querySelector('.toggle-password');
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
toggleIcon.setAttribute('name', 'eye-off-outline');
} else {
passwordInput.type = 'password';
toggleIcon.setAttribute('name', 'eye-outline');
}
}
function handleLogin() {
const email = document.getElementById('email');
const password = document.getElementById('password');
const emailError = document.getElementById('emailError');
const passwordError = document.getElementById('passwordError');
let isValid = true;
// Reset errors
emailError.classList.remove('show');
passwordError.classList.remove('show');
email.style.borderColor = '#e0e0e0';
password.style.borderColor = '#e0e0e0';
// Validate email
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!email.value || !emailRegex.test(email.value)) {
emailError.classList.add('show');
email.style.borderColor = '#dc3545';
isValid = false;
}
// Validate password
if (!password.value || password.value.length < 6) {
passwordError.classList.add('show');
password.style.borderColor = '#dc3545';
isValid = false;
}
if (isValid) {
alert('Login successful! 🎉');
// Here you would typically send data to your server
}
}
function socialLogin(provider) {
alert(`Signing in with ${provider}...`);
// Here you would typically implement OAuth flow
}
// Add enter key support
document.getElementById('password').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
handleLogin();
}
});
document.getElementById('email').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
handleLogin();
}
});
No comments yet. Be the first!