package templates

templ Register() {
	<!DOCTYPE html>
	<html lang="en">
		<head>
			<meta charset="UTF-8"/>
			<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
			<title>Register</title>
			<script src="/static/htmx.min.js"></script>
			<script src="/static/main.js" defer></script>
			<link href="/static/style.css" rel="stylesheet"/>
		</head>
		<body class="theme-tokyo-night min-h-screen" x-data="register" x-init="initRegisterTheme()">
			<div class="container mx-auto px-4 py-8 max-w-md">
				<h1 class="text-3xl font-bold text-center mb-8">Register for Bookhoard</h1>
				<form hx-post="/api/auth/register" hx-target="#result" hx-swap="innerHTML" class="card p-6 rounded-lg shadow-md border">
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">Email</label>
						<input type="email" id="email" name="email" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
					</div>
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">Username</label>
						<input type="text" id="username" name="username" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
					</div>
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">First Name</label>
						<input type="text" name="first_name" placeholder="Optional" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)"/>
					</div>
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">Last Name</label>
						<input type="text" name="last_name" placeholder="Optional" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)"/>
					</div>
					<div id="password-requirements" class="mb-4 p-4 rounded-lg border text-sm" style="background-color: var(--bg-secondary); border-color: var(--border)">
						<p class="font-semibold mb-2" style="color: var(--text-primary)">Password Requirements:</p>
						<ul class="space-y-1" style="color: var(--text-secondary)">
							<li id="req-length" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> At least 8 characters
							</li>
							<li id="req-upper" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> One uppercase letter
							</li>
							<li id="req-lower" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> One lowercase letter
							</li>
							<li id="req-number" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> One number
							</li>
							<li id="req-special" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> One special character
							</li>
							<li id="req-match" class="flex items-center gap-2">
								<span class="requirement-icon">○</span> Passwords match
							</li>
						</ul>
					</div>
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">Password</label>
						<input type="password" id="password" name="password" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
					</div>
					<div class="mb-4">
						<label class="block text-sm font-medium mb-1" style="color: var(--text-secondary)">Confirm Password</label>
						<input type="password" id="confirm-password" name="confirm_password" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
					</div>
					<button type="submit" id="register-btn" class="btn-primary w-full py-2 rounded opacity-50 cursor-not-allowed" disabled>
						Register
					</button>
				</form>
				<div id="result" class="mt-4 text-center"></div>
				<p class="text-center mt-4">
					<a href="/login" class="text-blue-500 hover:underline">Already have an account? Login</a>
				</p>
			</div>
		</body>
	</html>
}

