Files
tenderpilot/public/login.html
Peter Foster f969ecae04 feat: visual polish, nav login link, pricing badge fix, cursor fix, button contrast
- Hero mockup: enhanced 3D perspective and shadow
- Testimonials: illustrated SVG avatars
- Growth pricing card: visual prominence (scale, gradient, badge)
- Most Popular badge: repositioned to avoid overlapping heading
- Nav: added Log In link next to Start Free Trial
- Fixed btn-primary text colour on anchor tags (white on blue)
- Fixed cursor: default on all non-interactive elements
- Disabled user-select on non-form content to prevent text caret
2026-02-14 14:17:15 +00:00

433 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sign in to TenderRadar - AI-powered UK public sector tender intelligence">
<title>Sign In | TenderRadar</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="stylesheet" href="styles.css">
<style>
body {
background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
min-height: 100vh;
display: flex;
flex-direction: column;
}
.auth-wrapper {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem 1.5rem;
}
.login-card {
background: white;
border-radius: 1rem;
box-shadow: var(--shadow-xl);
padding: 3rem;
max-width: 450px;
width: 100%;
}
.login-header {
text-align: center;
margin-bottom: 2rem;
}
.login-header h1 {
font-size: 2rem;
font-weight: 800;
color: var(--text-primary);
margin-bottom: 0.5rem;
}
.login-header p {
color: var(--text-secondary);
font-size: 1rem;
}
.form-group {
margin-bottom: 1.25rem;
display: flex;
flex-direction: column;
}
.form-group label {
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--text-primary);
font-size: 1rem;
}
.form-group input {
width: 100%;
padding: 0.875rem 1rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
font-family: 'Inter', sans-serif;
font-size: 1rem;
transition: all 0.2s;
}
.form-group input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.password-group {
position: relative;
}
.password-toggle {
position: absolute;
right: 0.75rem;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
color: var(--text-secondary);
padding: 0.5rem;
}
.form-header-with-link {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.form-header-with-link label {
margin: 0;
}
.forgot-password {
font-size: 0.875rem;
color: var(--primary);
text-decoration: none;
font-weight: 600;
}
.forgot-password:hover {
text-decoration: underline;
}
.remember-me {
display: flex;
align-items: center;
gap: 0.5rem;
margin-top: -0.5rem;
margin-bottom: 1rem;
}
.remember-me input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: var(--primary);
}
.remember-me label {
margin: 0;
cursor: pointer;
font-size: 1rem;
font-weight: 500;
}
.error {
color: #dc2626;
font-size: 0.875rem;
margin-top: 0.25rem;
display: none;
}
.error.show {
display: block;
}
.form-group.error-state input {
border-color: #dc2626;
}
.submit-btn {
width: 100%;
padding: 1rem;
font-size: 1.0625rem;
font-weight: 700;
margin-top: 1.5rem;
background: var(--primary);
color: white;
border: none;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s;
}
.submit-btn:hover {
background: var(--primary-dark);
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
.auth-footer {
text-align: center;
margin-top: 2rem;
}
.auth-footer p {
color: var(--text-secondary);
font-size: 1rem;
}
.auth-footer a {
color: var(--primary);
text-decoration: none;
font-weight: 600;
}
.auth-footer a:hover {
text-decoration: underline;
}
.success-message,
.error-message {
padding: 0.875rem;
border-radius: 0.5rem;
margin-bottom: 1rem;
display: none;
font-size: 1rem;
}
.success-message {
background: #ecfdf5;
color: #065f46;
}
.error-message {
background: #fef2f2;
color: #7f1d1d;
}
.success-message.show,
.error-message.show {
display: block;
}
@media (max-width: 600px) {
.login-card {
padding: 2rem 1.5rem;
}
.login-header h1 {
font-size: 1.75rem;
}
}
</style>
</head>
<body>
<!-- Header/Navigation -->
<header class="header">
<nav class="nav container">
<a href="/" class="nav-brand">
<img src="/logo.png" alt="TenderRadar" class="logo-icon">
</a>
<ul class="nav-menu">
<li><a href="/#features">Features</a></li>
<li><a href="/#pricing">Pricing</a></li>
<li><a href="signup.html" class="btn btn-secondary">Sign Up</a></li>
</ul>
<button class="mobile-toggle" aria-label="Toggle menu">
<span></span>
<span></span>
<span></span>
</button>
</nav>
</header>
<!-- Login Form -->
<section class="auth-wrapper">
<div class="login-card">
<div class="login-header">
<h1>Welcome Back</h1>
<p>Sign in to your TenderRadar account</p>
</div>
<div class="success-message" id="successMessage">
Signing you in... Redirecting to dashboard...
</div>
<div class="error-message" id="errorMessage"></div>
<form id="loginForm" class="login-form">
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="you@company.com" required>
<div class="error" id="emailError"></div>
</div>
<div class="form-group password-group">
<div class="form-header-with-link">
<label for="password">Password</label>
<a href="#" class="forgot-password" id="forgotPasswordLink">Forgot password?</a>
</div>
<input type="password" id="password" name="password" placeholder="Enter your password" required>
<button type="button" class="password-toggle" id="togglePassword">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
<circle cx="12" cy="12" r="3"/>
</svg>
</button>
<div class="error" id="passwordError"></div>
</div>
<div class="remember-me">
<input type="checkbox" id="rememberMe" name="rememberMe">
<label for="rememberMe">Remember me</label>
</div>
<button type="submit" class="submit-btn" id="submitBtn">Sign In</button>
</form>
<div class="auth-footer">
<p>Don't have an account? <a href="signup.html">Sign up here</a></p>
</div>
</div>
</section>
<script>
const form = document.getElementById('loginForm');
const submitBtn = document.getElementById('submitBtn');
const errorMessage = document.getElementById('errorMessage');
const successMessage = document.getElementById('successMessage');
const forgotPasswordLink = document.getElementById('forgotPasswordLink');
// Password visibility toggle
document.getElementById('togglePassword').addEventListener('click', function(e) {
e.preventDefault();
const input = document.getElementById('password');
input.type = input.type === 'password' ? 'text' : 'password';
});
// Forgot password placeholder
forgotPasswordLink.addEventListener('click', function(e) {
e.preventDefault();
alert('Password reset functionality coming soon. Please contact support at support@tenderradar.com');
});
// Form validation
function validateForm() {
const errors = {};
const email = document.getElementById('email').value.trim();
const password = document.getElementById('password').value;
// Clear previous errors
document.querySelectorAll('.form-group.error-state').forEach(el => {
el.classList.remove('error-state');
});
document.querySelectorAll('.error').forEach(el => {
el.classList.remove('show');
el.textContent = '';
});
if (!email) {
errors.email = 'Email is required';
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
errors.email = 'Please enter a valid email address';
}
if (!password) {
errors.password = 'Password is required';
}
// Display errors
Object.keys(errors).forEach(field => {
const errorEl = document.getElementById(field + 'Error');
const formGroup = errorEl.closest('.form-group');
formGroup.classList.add('error-state');
errorEl.textContent = errors[field];
errorEl.classList.add('show');
});
return Object.keys(errors).length === 0;
}
form.addEventListener('submit', async (e) => {
e.preventDefault();
if (!validateForm()) {
return;
}
errorMessage.classList.remove('show');
errorMessage.textContent = '';
submitBtn.disabled = true;
submitBtn.textContent = 'Signing in...';
try {
const response = await fetch('/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: document.getElementById('email').value.trim(),
password: document.getElementById('password').value
})
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error || 'Login failed');
}
// Store token and user data
localStorage.setItem('token', data.token);
localStorage.setItem('user', JSON.stringify(data.user));
// Store remember me preference
if (document.getElementById('rememberMe').checked) {
localStorage.setItem('rememberMe', 'true');
}
successMessage.classList.add('show');
setTimeout(() => {
window.location.href = '/dashboard.html';
}, 1500);
} catch (error) {
errorMessage.textContent = error.message;
errorMessage.classList.add('show');
submitBtn.disabled = false;
submitBtn.textContent = 'Sign In';
}
});
// Check if user was previously remembered
window.addEventListener('load', function() {
if (localStorage.getItem('rememberMe') === 'true') {
const user = JSON.parse(localStorage.getItem('user'));
if (user && user.email) {
document.getElementById('email').value = user.email;
document.getElementById('rememberMe').checked = true;
}
}
});
// Mobile menu toggle
document.querySelector('.mobile-toggle')?.addEventListener('click', function() {
document.querySelector('.nav-menu').classList.toggle('active');
});
</script>
</body>
</html>