<h2 class="mb-4">Zmiana hasła</h2>

<div class="card" style="max-width: 500px;">
    <div class="card-body">
        <?php if (!empty($error)): ?>
            <div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
        <?php endif; ?>

        <form method="post" action="/change-password">
            <div class="mb-3">
                <label for="current_password" class="form-label">Aktualne hasło</label>
                <input type="password" class="form-control" id="current_password" name="current_password" required>
            </div>

            <div class="mb-3">
                <label for="new_password" class="form-label">Nowe hasło</label>
                <input type="password" class="form-control" id="new_password" name="new_password" required minlength="6">
                <div class="form-text">Minimum 6 znaków</div>
            </div>

            <div class="mb-3">
                <label for="confirm_password" class="form-label">Powtórz nowe hasło</label>
                <input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
            </div>

            <div class="d-flex gap-2">
                <button type="submit" class="btn btn-primary">Zmień hasło</button>
                <a href="/" class="btn btn-outline-secondary">Anuluj</a>
            </div>
        </form>
    </div>
</div>
