<div class="auth-card">
    <div class="auth-header">
        <i class="fas fa-server auth-logo"></i>
        <h1>ServerManager</h1>
        <p>Linux Server Management Platform</p>
    </div>

    <?php if ($flash = \ServerManager\Core\Session::getFlash('error')): ?>
        <div class="alert alert-error">
            <i class="fas fa-exclamation-circle"></i>
            <?= htmlspecialchars($flash[0]) ?>
        </div>
    <?php endif; ?>

    <form method="POST" action="/login" class="auth-form" id="loginForm">
        <input type="hidden" name="_csrf_token" value="<?= $this->csrfToken() ?>">

        <div class="form-group">
            <label for="username">
                <i class="fas fa-user"></i> Username
            </label>
            <input type="text" id="username" name="username" class="form-input"
                   placeholder="Enter your username" required autofocus
                   autocomplete="username">
        </div>

        <div class="form-group">
            <label for="password">
                <i class="fas fa-lock"></i> Password
            </label>
            <div class="input-group">
                <input type="password" id="password" name="password" class="form-input"
                       placeholder="Enter your password" required
                       autocomplete="current-password">
                <button type="button" class="input-toggle-password" tabindex="-1">
                    <i class="fas fa-eye"></i>
                </button>
            </div>
        </div>

        <div class="form-group">
            <button type="submit" class="btn btn-primary btn-block">
                <i class="fas fa-sign-in-alt"></i> Sign In
            </button>
        </div>
        <div class="auth-footer">
            <p>Don't have an account? <a href="/register">Register</a></p>
        </div>
    </form>
</div>
