<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reitti - Login</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=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap"
          rel="stylesheet">
    <style>
        :root {
            --color-highlight: #F5DEB3FF;
            --color-background-dark: #3b3b3b;
            --color-background-dark-light: #5c5c5c;
            --color-text-white: #e3e3e3;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #111111;
            background: linear-gradient(135deg, #111111 0%, #3b3b3b 100%);
            color: var(--color-text-white);
        }
        
        .login-container {
            background-color: var(--color-background-dark);
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            width: 350px;
            border: 1px solid var(--color-highlight);
            backdrop-filter: blur(10px);
        }
        
        h1 {
            text-align: center;
            color: var(--color-highlight);
            margin-bottom: 30px;
            font-family: "Fraunces", serif;
            font-size: 3rem;
            font-weight: lighter;
        }
        
        .form-group {
            margin-bottom: 25px;
        }
        
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 400;
            color: var(--color-text-white);
        }
        
        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 12px;
            background-color: var(--color-background-dark-light);
            border: 1px solid #666;
            border-radius: 4px;
            box-sizing: border-box;
            color: var(--color-text-white);
            transition: border-color 0.3s;
        }
        
        input[type="text"]:focus,
        input[type="password"]:focus {
            border-color: var(--color-highlight);
            outline: none;
        }
        
        .remember-me {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .remember-me input {
            margin-right: 8px;
        }
        
        button {
            background-color: transparent;
            color: var(--color-highlight);
            border: 1px solid var(--color-highlight);
            padding: 12px;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            font-size: 16px;
            transition: background-color 0.3s, color 0.3s;
        }
        
        button:hover {
            background-color: var(--color-highlight);
            color: var(--color-background-dark);
        }
        
        .error-message {
            color: #ff6b6b;
            margin-bottom: 20px;
            text-align: center;
            padding: 10px;
            background-color: rgba(255, 107, 107, 0.1);
            border-radius: 4px;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h1>Reitti</h1>
        
        <div th:if="${param.error}" class="error-message" th:text="#{login.invalid.credentials}">
            Invalid username or password
        </div>
        
        <form th:action="@{/login}" method="post">
            <div class="form-group">
                <label for="username" th:text="#{login.username}">Username</label>
                <input type="text" id="username" name="username" required autofocus>
            </div>
            
            <div class="form-group">
                <label for="password" th:text="#{login.password}">Password</label>
                <input type="password" id="password" name="password" required>
            </div>
            
            <div class="remember-me">
                <input type="checkbox" id="remember-me" name="remember-me">
                <label for="remember-me" th:text="#{login.remember.me}">Remember me</label>
            </div>
            
            <button type="submit" th:text="#{login.button}">Login</button>
        </form>
    </div>
</body>
</html>
