- 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
462 lines
16 KiB
HTML
462 lines
16 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 up for TenderRadar - AI-powered UK public sector tender intelligence">
|
|
<title>Sign Up | 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&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>
|
|
.auth-page {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.auth-container {
|
|
width: 100%;
|
|
max-width: 450px;
|
|
}
|
|
|
|
.auth-card {
|
|
background: white;
|
|
border-radius: 0.75rem;
|
|
box-shadow: var(--shadow-lg);
|
|
padding: 2.5rem;
|
|
}
|
|
|
|
.auth-header {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.auth-header .logo-icon {
|
|
height: 50px;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.auth-header h1 {
|
|
font-size: 1.875rem;
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.auth-header p {
|
|
color: var(--text-secondary);
|
|
font-size: 0.9375rem;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 0.5rem;
|
|
font-weight: 500;
|
|
color: var(--text-primary);
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.form-group input,
|
|
.form-group select {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 1px solid var(--border);
|
|
border-radius: 0.5rem;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 0.9375rem;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.form-group input:focus,
|
|
.form-group select:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
|
|
}
|
|
|
|
.form-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.form-row .form-group {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.form-row {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
.password-group {
|
|
position: relative;
|
|
}
|
|
|
|
.password-toggle {
|
|
position: absolute;
|
|
right: 0.75rem;
|
|
top: 2.25rem;
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
color: var(--text-secondary);
|
|
padding: 0.25rem 0.5rem;
|
|
}
|
|
|
|
.error {
|
|
color: #dc2626;
|
|
font-size: 0.875rem;
|
|
margin-top: 0.25rem;
|
|
display: none;
|
|
}
|
|
|
|
.error.show {
|
|
display: block;
|
|
}
|
|
|
|
.form-group.error-state input,
|
|
.form-group.error-state select {
|
|
border-color: #dc2626;
|
|
}
|
|
|
|
.submit-btn {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.auth-footer {
|
|
text-align: center;
|
|
margin-top: 1.5rem;
|
|
}
|
|
|
|
.auth-footer p {
|
|
color: var(--text-secondary);
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.auth-footer a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.auth-footer a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.loading {
|
|
display: none;
|
|
text-align: center;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.success-message {
|
|
background: #ecfdf5;
|
|
color: #065f46;
|
|
padding: 0.875rem;
|
|
border-radius: 0.5rem;
|
|
margin-bottom: 1rem;
|
|
display: none;
|
|
}
|
|
|
|
.success-message.show {
|
|
display: block;
|
|
}
|
|
|
|
.error-message {
|
|
background: #fef2f2;
|
|
color: #7f1d1d;
|
|
padding: 0.875rem;
|
|
border-radius: 0.5rem;
|
|
margin-bottom: 1rem;
|
|
display: none;
|
|
}
|
|
|
|
.error-message.show {
|
|
display: block;
|
|
}
|
|
|
|
.terms {
|
|
font-size: 0.8125rem;
|
|
color: var(--text-secondary);
|
|
margin-top: 1rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.terms a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.terms a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
</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="login.html" class="btn btn-secondary btn-sm">Sign In</a></li>
|
|
</ul>
|
|
<button class="mobile-toggle" aria-label="Toggle menu">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</button>
|
|
</nav>
|
|
</header>
|
|
|
|
<!-- Signup Form -->
|
|
<section class="auth-page">
|
|
<div class="auth-container">
|
|
<div class="auth-card">
|
|
<div class="auth-header">
|
|
<img src="/logo.png" alt="TenderRadar" class="logo-icon">
|
|
<h1>Create Account</h1>
|
|
<p>Start your 14-day free trial</p>
|
|
</div>
|
|
|
|
<div class="success-message" id="successMessage">
|
|
Account created successfully! Redirecting to dashboard...
|
|
</div>
|
|
|
|
<div class="error-message" id="errorMessage"></div>
|
|
|
|
<form id="signupForm" class="signup-form">
|
|
<div class="form-group">
|
|
<label for="companyName">Company Name *</label>
|
|
<input type="text" id="companyName" name="companyName" placeholder="Your company name" required>
|
|
<div class="error" id="companyNameError"></div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="email">Work Email *</label>
|
|
<input type="email" id="email" name="email" placeholder="you@company.com" required>
|
|
<div class="error" id="emailError"></div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label for="industry">Industry/Sector *</label>
|
|
<select id="industry" name="industry" required>
|
|
<option value="">Select sector...</option>
|
|
<option value="technology">Technology</option>
|
|
<option value="construction">Construction</option>
|
|
<option value="consulting">Consulting</option>
|
|
<option value="engineering">Engineering</option>
|
|
<option value="healthcare">Healthcare</option>
|
|
<option value="facilities">Facilities & Maintenance</option>
|
|
<option value="security">Security</option>
|
|
<option value="transport">Transport & Logistics</option>
|
|
<option value="training">Training & Education</option>
|
|
<option value="financial">Financial Services</option>
|
|
<option value="other">Other</option>
|
|
</select>
|
|
<div class="error" id="industryError"></div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="companySize">Company Size *</label>
|
|
<select id="companySize" name="companySize" required>
|
|
<option value="">Select size...</option>
|
|
<option value="1-10">1-10 employees</option>
|
|
<option value="11-50">11-50 employees</option>
|
|
<option value="51-250">51-250 employees</option>
|
|
<option value="250+">250+ employees</option>
|
|
</select>
|
|
<div class="error" id="companySizeError"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group password-group">
|
|
<label for="password">Password *</label>
|
|
<input type="password" id="password" name="password" placeholder="At least 8 characters" 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="form-group password-group">
|
|
<label for="confirmPassword">Confirm Password *</label>
|
|
<input type="password" id="confirmPassword" name="confirmPassword" placeholder="Confirm your password" required>
|
|
<button type="button" class="password-toggle" id="toggleConfirmPassword">
|
|
<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="confirmPasswordError"></div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary submit-btn" id="submitBtn">Create Account</button>
|
|
|
|
<div class="terms">
|
|
By creating an account, you agree to our <a href="#">Terms of Service</a> and <a href="#">Privacy Policy</a>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="auth-footer">
|
|
<p>Already have an account? <a href="login.html">Sign in here</a></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script>
|
|
const form = document.getElementById('signupForm');
|
|
const submitBtn = document.getElementById('submitBtn');
|
|
const errorMessage = document.getElementById('errorMessage');
|
|
const successMessage = document.getElementById('successMessage');
|
|
|
|
// Password visibility toggles
|
|
document.getElementById('togglePassword').addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
const input = document.getElementById('password');
|
|
input.type = input.type === 'password' ? 'text' : 'password';
|
|
});
|
|
|
|
document.getElementById('toggleConfirmPassword').addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
const input = document.getElementById('confirmPassword');
|
|
input.type = input.type === 'password' ? 'text' : 'password';
|
|
});
|
|
|
|
// Form validation
|
|
function validateForm() {
|
|
const errors = {};
|
|
const companyName = document.getElementById('companyName').value.trim();
|
|
const email = document.getElementById('email').value.trim();
|
|
const industry = document.getElementById('industry').value;
|
|
const companySize = document.getElementById('companySize').value;
|
|
const password = document.getElementById('password').value;
|
|
const confirmPassword = document.getElementById('confirmPassword').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 (!companyName) {
|
|
errors.companyName = 'Company name is required';
|
|
}
|
|
|
|
if (!email) {
|
|
errors.email = 'Email is required';
|
|
} else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
errors.email = 'Please enter a valid email address';
|
|
}
|
|
|
|
if (!industry) {
|
|
errors.industry = 'Please select an industry';
|
|
}
|
|
|
|
if (!companySize) {
|
|
errors.companySize = 'Please select company size';
|
|
}
|
|
|
|
if (!password) {
|
|
errors.password = 'Password is required';
|
|
} else if (password.length < 8) {
|
|
errors.password = 'Password must be at least 8 characters';
|
|
}
|
|
|
|
if (!confirmPassword) {
|
|
errors.confirmPassword = 'Please confirm your password';
|
|
} else if (password !== confirmPassword) {
|
|
errors.confirmPassword = 'Passwords do not match';
|
|
}
|
|
|
|
// 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 = 'Creating account...';
|
|
|
|
try {
|
|
const response = await fetch('/api/auth/register', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify({
|
|
company_name: document.getElementById('companyName').value.trim(),
|
|
email: document.getElementById('email').value.trim(),
|
|
password: document.getElementById('password').value,
|
|
tier: 'free'
|
|
})
|
|
});
|
|
|
|
const data = await response.json();
|
|
|
|
if (!response.ok) {
|
|
throw new Error(data.error || 'Registration failed');
|
|
}
|
|
|
|
// Store token and redirect
|
|
localStorage.setItem('token', data.token);
|
|
localStorage.setItem('user', JSON.stringify(data.user));
|
|
|
|
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 = 'Create Account';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|