<?php
session_start(); // Starta sessionen för att hantera inloggning
$message = $_GET['msg'] ?? ''; // Eventuellt meddelande från andra sidor (t.ex. felmeddelande)
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<title>Logga in</title>
</head>
<style>
/* Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
background: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: #fff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}
h2 {
text-align: center;
margin-bottom: 30px;
color: #333;
}
label {
display: block;
margin-bottom: 5px;
color: #555;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
.login {
width: 100%;
padding: 12px;
background: #1b91f8ff;
border: none;
color: white;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s;
}
.login[type="submit"]:hover {
background: #0268dcff;
}
.message {
text-align: center;
margin-bottom: 15px;
}
p {
margin-top: 35px;
}
.btn {
display: inline-block;
padding: 12px 20px;
background: #1b91f8ff;
color: white;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
margin-left: 5px;
transition: background 0.3s;
}
.btn:hover {
background: #166fc0ff;
}
</style>
<body>
<div class="login-container">
<h2>Logga in</h2>
<?php if ($message)
echo "<p style='color:red;'>$message</p>"; ?>
<br>
<!-- Formulär för att logga in -->
<form action="login.php" method="post">
<label>Användarnamn:</label><br>
<input type="text" name="username" placeholder="Användarnamn" required><br><br>
<label>Lösenord:</label><br>
<input type="password" name="password" placeholder="Lösenord" required><br><br>
<button type="submit" class="login">Logga in</button>
</form>
<p>Har du inget konto? <a href="register.php" class="btn">Registrera dig här</a>
</p>
</div>
</body>
</html>