<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"
    Inherits="UserAuthApp.Web.Login" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Login - User Authentication</title>
    <style>
        body {
            font-family: 'Segoe UI', Arial, sans-serif;
            background-color: #f0f2f5;
            margin: 0;
            padding: 20px;
        }
        .container {
            width: 380px;
            margin: 80px auto;
            padding: 35px;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        h2 {
            text-align: center;
            color: #1a1a2e;
            margin-bottom: 25px;
        }
        .form-group {
            margin-bottom: 18px;
        }
        .form-group label {
            display: block;
            margin-bottom: 6px;
            font-weight: 600;
            color: #444;
            font-size: 14px;
        }
        .form-group input[type="text"],
        .form-group input[type="password"] {
            width: 100%;
            padding: 11px 14px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }
        .form-group input:focus {
            border-color: #2196F3;
            outline: none;
        }
        .btn-login {
            width: 100%;
            padding: 13px;
            background-color: #2196F3;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            margin-top: 10px;
        }
        .btn-login:hover {
            background-color: #1976D2;
        }
        .message {
            text-align: center;
            margin-top: 15px;
            padding: 12px;
            border-radius: 6px;
            font-size: 14px;
        }
        .error { background-color: #f8d7da; color: #721c24; }
        .link-section {
            text-align: center;
            margin-top: 20px;
            font-size: 14px;
        }
        .link-section a {
            color: #2196F3;
            text-decoration: none;
            font-weight: 600;
        }
        .validation-error {
            color: red;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <form id="frmLogin" runat="server">
        <div class="container">
            <h2>Sign In</h2>

            <!-- Username -->
            <div class="form-group">
                <label>Username</label>
                <asp:TextBox ID="txtUsername" runat="server" placeholder="Enter your username" />
                <asp:RequiredFieldValidator ID="rfvUsername" runat="server"
                    ControlToValidate="txtUsername"
                    ErrorMessage="* Username is required"
                    CssClass="validation-error"
                    Display="Dynamic" />
            </div>

            <!-- Password -->
            <div class="form-group">
                <label>Password</label>
                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"
                    placeholder="Enter your password" />
                <asp:RequiredFieldValidator ID="rfvPassword" runat="server"
                    ControlToValidate="txtPassword"
                    ErrorMessage="* Password is required"
                    CssClass="validation-error"
                    Display="Dynamic" />
            </div>

            <!-- Login Button -->
            <asp:Button ID="btnLogin" runat="server" Text="Sign In"
                CssClass="btn-login" OnClick="btnLogin_Click" />

            <!-- Message Label -->
            <asp:Label ID="lblMessage" runat="server" CssClass="message" />

            <!-- Link to Register page -->
            <div class="link-section">
                Don't have an account? <a href="Register.aspx">Create one here</a>
            </div>
        </div>
    </form>
</body>
</html>
